Skip to content
intermediate Phase 3 · Operating System Hardening and Permissions

Hardening with CIS Benchmarks

Apply vendor-hardening baselines and verify them with automated scans.

50m
0 problems
Topic Progress 0%

CIS Benchmarks: The Industry Standard for Hardening

CIS Benchmarks: The Industry Standard for Hardening

The Center for Internet Security (CIS) Benchmarks are the most widely adopted configuration hardening standards in the world. They provide specific, actionable guidance for securely configuring operating systems, databases, cloud platforms, and applications.

Why CIS Benchmarks exist

Every operating system ships with insecure defaults. Services run with excessive permissions, unnecessary ports are open, and logging is minimal. CIS Benchmarks give you a prioritized, community-reviewed set of configuration changes that reduce attack surface without breaking functionality.

The two profile levels

Level 1 — Apply to every system:

  • Minimal service disruption
  • Significant security improvement
  • Suitable for all environments
  • Examples: disable root SSH login, set password policies, disable unnecessary services

Level 2 — Apply when security outweighs functionality:

  • May cause service disruption or reduced functionality
  • Suitable for high-security environments (government, financial, healthcare)
  • Examples: enable SELinux enforcing mode, implement strict audit policies, disable all unnecessary kernel modules

Decision framework

  1. Start with Level 1 on all systems
  2. Identify systems where Level 2 is required (internet-facing, sensitive data, regulatory requirements)
  3. Test Level 2 settings in staging before deploying to production
  4. Document any Level 2 settings that cannot be applied and why

Implementing and Auditing Benchmark Compliance

From Benchmark to Baseline to Continuous Compliance

Automated Compliance Scanning

For environments with more than a handful of systems, manual benchmark application is impractical. Automated tools continuously assess compliance:

OpenSCAP (open source):

# Scan a system against CIS Benchmark Level 1
oscap xccdf eval \\
  --profile xccdf_org.cisecurity.benchmark_profile_level_1 \\
  --results /tmp/scan-results.xml \\
  --report /tmp/scan-report.html \\
  /usr/share/xml/scap/ssg/content/ssg-ubuntu2204-ds.xml

# View summary statistics
oscap xccdf eval --profile xccdf_org.cisecurity.benchmark_profile_level_1 \\
  /usr/share/xml/scap/ssg/content/ssg-ubuntu2204-ds.xml 2>&1 | \\
  grep -E '(pass|fail|error|unknown)'

Cloud-native scanners:

  • AWS Security Hub: checks CIS Foundations benchmark automatically
  • Azure Defender for Cloud: compliance dashboard in the Azure portal
  • Google Cloud Security Command Center: compliance reports

Building a Continuous Compliance Program

  1. Baseline: Scan all systems against CIS Level 1
  2. Remediate: Fix failing checks, starting with internet-facing systems
  3. Harden: Apply Level 2 to high-value systems
  4. Monitor: Schedule weekly scans and alert on new failures
  5. Report: Generate monthly compliance reports for leadership

Common CIS Benchmark Findings

Finding Level Impact Remediation
SSH root login enabled 1 Critical Set PermitRootLogin no
No password policy 1 High Configure pam_pwquality
Unnecessary services running 1 Medium Disable and mask services
No audit logging 2 High Enable and configure auditd
SELinux in permissive mode 2 High Set enforcing in /etc/selinux/config

Practice Problems

0 / 1 solved
CIS Benchmark Compliance Strategy
Compliance Planning

A company has 200 Linux servers. They want to achieve CIS Benchmark Level 1 compliance but have limited staff. Describe an approach to implement and maintain compliance across all systems efficiently.

Optimal Solution — time, space

Use infrastructure-as-code to apply CIS benchmarks at build time, then use OpenSCAP for continuous scanning. Prioritize internet-facing systems first, then work inward. Automate remediation for common findings and track exceptions formally.

# Example: Apply CIS Level 1 via Ansible
# ansible-playbook -i inventory cis-level1.yml

# Example: Schedule weekly OpenSCAP scans
# crontab entry:
# 0 2 * * 0 /usr/local/bin/cis-scan.sh

# Example: Alert on new failures
# diff <(cat /tmp/last-scan.txt) <(cat /tmp/current-scan.txt)

Edge Cases:

  • Systems that cannot be rebooted
  • Legacy applications with specific kernel requirements

Quiz

1. What is the primary difference between CIS Benchmark Level 1 and Level 2?

Question 1 options

2. Which tool is commonly used to automate CIS Benchmark compliance scanning on Linux?

Question 2 options

3. What is the recommended first step when implementing CIS Benchmarks across an organization?

Question 3 options

Flashcards

Question

What are CIS Benchmarks?

Answer

Community-reviewed configuration hardening standards for operating systems, databases, and cloud platforms.

Question

CIS Level 1 vs Level 2

Answer

Level 1: minimal disruption, apply everywhere. Level 2: stronger security, may cause disruption, for high-security environments.

Question

What is OpenSCAP?

Answer

Open-source tool for automated compliance scanning against CIS Benchmarks and other security standards.

Question

What is continuous compliance?

Answer

Ongoing scanning and remediation to maintain security baseline over time, not just point-in-time fixes.

Revision Notes

Key Takeaways

  • 1. CIS Benchmarks provide prioritized, actionable hardening guidance
  • 2. Level 1 is for all systems; Level 2 is for high-security environments
  • 3. Automate scanning with OpenSCAP or cloud-native tools
  • 4. Continuous compliance requires ongoing monitoring, not just point-in-time fixes

Interview Tips

  • • Explain how you would roll out CIS Benchmarks across a large environment
  • • Discuss the trade-offs between Level 1 and Level 2 profiles
  • • Describe how you handle systems that cannot meet certain benchmark requirements

Cheat Sheet

CIS Benchmarks Cheat Sheet

Phase: Operating System Hardening and Permissions | Level: intermediate

Key points:

  • CIS Benchmarks are industry-standard hardening guidelines
  • Level 1: minimal disruption, apply to all systems
  • Level 2: stronger security, may cause disruption
  • Use OpenSCAP for automated scanning
  • Build continuous compliance: baseline, remediate, harden, monitor, report

Tags: hardening, compliance, benchmarks

Continue Learning