hardening-linux-endpoint-with-cis-benchmark▌
mukul975/Anthropic-Cybersecurity-Skills · updated May 25, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Hardens Linux endpoints using CIS Benchmark recommendations for Ubuntu, RHEL, and CentOS to reduce attack surface, enforce security baselines, and meet compliance requirements. Use when deploying new Linux servers, remediating audit findings, or establishing security baselines for Linux infrastructure. Activates for requests involving Linux hardening, CIS benchmarks for Linux, server security baselines, or Linux configuration compliance.
| name | hardening-linux-endpoint-with-cis-benchmark |
| description | 'Hardens Linux endpoints using CIS Benchmark recommendations for Ubuntu, RHEL, and CentOS to reduce attack surface, enforce security baselines, and meet compliance requirements. Use when deploying new Linux servers, remediating audit findings, or establishing security baselines for Linux infrastructure. Activates for requests involving Linux hardening, CIS benchmarks for Linux, server security baselines, or Linux configuration compliance. ' |
| domain | cybersecurity |
| subdomain | endpoint-security |
| tags | - endpoint - hardening - linux-security - CIS-benchmark - Ubuntu - RHEL |
| version | 1.0.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | - PR.PS-01 - PR.PS-02 - DE.CM-01 - PR.IR-01 |
Hardening Linux Endpoint with CIS Benchmark
When to Use
Use this skill when:
- Hardening Linux servers (Ubuntu, RHEL, CentOS, Debian) against CIS benchmarks
- Automating Linux security baselines using Ansible, OpenSCAP, or shell scripts
- Meeting compliance requirements (PCI DSS, HIPAA, SOC 2) for Linux endpoints
- Remediating findings from vulnerability scans or security audits
Do not use for Windows hardening (use hardening-windows-endpoint-with-cis-benchmark).
Prerequisites
- Root or sudo access on target Linux endpoints
- CIS Benchmark PDF for target distribution (from cisecurity.org)
- OpenSCAP or CIS-CAT for automated assessment
- Ansible for enterprise-scale remediation (optional)
Workflow
Step 1: Filesystem Configuration (Section 1)
# 1.1.1 Disable unused filesystems
cat >> /etc/modprobe.d/CIS.conf << 'EOF'
install cramfs /bin/true
install freevxfs /bin/true
install jffs2 /bin/true
install hfs /bin/true
install hfsplus /bin/true
install squashfs /bin/true
install udf /bin/true
EOF
# 1.1.2 Ensure /tmp is a separate partition with nodev,nosuid,noexec
# /etc/fstab entry:
# tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0
systemctl unmask tmp.mount
systemctl enable tmp.mount
# 1.1.8 Ensure nodev option on /dev/shm
mount -o remount,nodev,nosuid,noexec /dev/shm
echo "tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0" >> /etc/fstab
# 1.4 Secure boot settings
chown root:root /boot/grub/grub.cfg
chmod 600 /boot/grub/grub.cfg
# Set GRUB password
grub-mkpasswd-pbkdf2 # Generate hash, add to /etc/grub.d/40_custom
Step 2: Services and Network (Sections 2-3)
# 2.1 Disable unnecessary services
systemctl disable --now avahi-daemon
systemctl disable --now cups
systemctl disable --now rpcbind
systemctl disable --now xinetd
# 2.2 Ensure NTP is configured
apt install chrony -y # or systemd-timesyncd
systemctl enable --now chrony
# 3.1 Network parameters (host only, not router)
cat >> /etc/sysctl.d/99-cis.conf << 'EOF'
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.default.log_martians = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.tcp_syncookies = 1
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
EOF
sysctl --system
# 3.4 Configure firewall (UFW or firewalld)
ufw enable
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
Step 3: Access Control (Sections 4-5)
# 5.2 SSH Server Configuration (/etc/ssh/sshd_config)
sed -i 's/#Protocol 2/Protocol 2/' /etc/ssh/sshd_config
cat >> /etc/ssh/sshd_config << 'EOF'
LogLevel VERBOSE
MaxAuthTries 4
PermitRootLogin no
PermitEmptyPasswords no
PasswordAuthentication no
X11Forwarding no
MaxStartups 10:30:60
LoginGraceTime 60
AllowTcpForwarding no
ClientAliveInterval 300
ClientAliveCountMax 3
EOF
systemctl restart sshd
# 5.3 Password policy (PAM)
# /etc/security/pwquality.conf
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
# 5.4 User account settings
# /etc/login.defs
PASS_MAX_DAYS 365
PASS_MIN_DAYS 1
PASS_WARN_AGE 7
# Lock inactive accounts
useradd -D -f 30
Step 4: Audit and Logging (Section 4)
# Install and configure auditd
apt install auditd audispd-plugins -y
systemctl enable --now auditd
# /etc/audit/rules.d/cis.rules
cat > /etc/audit/rules.d/cis.rules << 'EOF'
-w /etc/sudoers -p wa -k scope
-w /etc/sudoers.d/ -p wa -k scope
-w /var/log/sudo.log -p wa -k actions
-a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change
-a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale
-w /etc/group -p wa -k identity
-w /etc/passwd -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /var/log/faillog -p wa -k logins
-w /var/log/lastlog -p wa -k logins
-a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -k perm_mod
-a always,exit -F arch=b64 -S unlink -S rmdir -S rename -k delete
-w /sbin/insmod -p x -k modules
-w /sbin/modprobe -p x -k modules
-e 2
EOF
augenrules --load
# Configure rsyslog for remote logging
echo "*.* @@syslog-server.corp.com:514" >> /etc/rsyslog.d/50-remote.conf
systemctl restart rsyslog
Step 5: Assess with OpenSCAP
# Install OpenSCAP
apt install openscap-scanner scap-security-guide -y
# Run CIS benchmark assessment
oscap xccdf eval \
--profile xccdf_org.ssgproject.content_profile_cis_level1_server \
--results /tmp/cis_results.xml \
--report /tmp/cis_report.html \
/usr/share/xml/scap/ssg/content/ssg-ubuntu2204-ds.xml
# View HTML report in browser for detailed results
Key Concepts
| Term | Definition |
|---|---|
| OpenSCAP | Open-source SCAP (Security Content Automation Protocol) scanner for automated compliance |
| auditd | Linux audit framework for monitoring system calls and file access |
| PAM | Pluggable Authentication Modules; configurable authentication framework for Linux |
| sysctl | Linux kernel parameter configuration for network and system security tuning |
| AIDE | Advanced Intrusion Detection Environment; file integrity checker for Linux |
Tools & Systems
- OpenSCAP: Automated CIS benchmark assessment for Linux
- Ansible Lockdown: Ansible roles for automated CIS benchmark remediation
- Lynis: Open-source security auditing tool for Linux/Unix systems
- AIDE: File integrity monitoring for Linux endpoints
- auditd: Linux audit framework for system call monitoring
Common Pitfalls
- Applying server benchmarks to workstations: CIS provides separate benchmarks for server and workstation profiles. Server benchmarks disable desktop services.
- Breaking SSH access: Misconfiguring sshd_config (especially PermitRootLogin, PasswordAuthentication) can lock out administrators. Always test SSH configuration changes from a second session.
- Not testing firewall rules: Enabling UFW without allowing SSH first will disconnect remote sessions permanently.
- Kernel parameter changes without testing: Some sysctl settings can break application networking. Test in staging first.
How to use hardening-linux-endpoint-with-cis-benchmark on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add hardening-linux-endpoint-with-cis-benchmark
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches hardening-linux-endpoint-with-cis-benchmark from GitHub repository mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate hardening-linux-endpoint-with-cis-benchmark. Access the skill through slash commands (e.g., /hardening-linux-endpoint-with-cis-benchmark) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.8★★★★★69 reviews- ★★★★★Dhruvi Jain· Dec 28, 2024
hardening-linux-endpoint-with-cis-benchmark has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Advait Mensah· Dec 28, 2024
Keeps context tight: hardening-linux-endpoint-with-cis-benchmark is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Pratham Ware· Dec 24, 2024
hardening-linux-endpoint-with-cis-benchmark is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Anika Johnson· Dec 24, 2024
We added hardening-linux-endpoint-with-cis-benchmark from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Kofi Patel· Dec 24, 2024
Registry listing for hardening-linux-endpoint-with-cis-benchmark matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Chinedu Brown· Dec 12, 2024
hardening-linux-endpoint-with-cis-benchmark fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Oshnikdeep· Nov 19, 2024
Solid pick for teams standardizing on skills: hardening-linux-endpoint-with-cis-benchmark is focused, and the summary matches what you get after install.
- ★★★★★Kofi Gill· Nov 19, 2024
hardening-linux-endpoint-with-cis-benchmark is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Chen Singh· Nov 19, 2024
hardening-linux-endpoint-with-cis-benchmark fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Kofi Rao· Nov 15, 2024
Useful defaults in hardening-linux-endpoint-with-cis-benchmark — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 69