Works with the AI Agents you already use
Systemd Service Security Audit
by CashonlyTian
Manual systemd hardening is tedious and error-prone.
$7
Systemd Service Security Audit
Example session with this skill installed
Run a security audit on the units in the 'deploy/services' folder for project 'api-gateway'. Use the default accent color.
- Read your context and instructions
- Compiled the systemd service security
- Generated the document
I have completed the security audit for the api-gateway project. The scanner analyzed the service units and drop-in configurations found in the specified directory.
Summary:
- Score: 42/100
- Grade: D
- Risk Level: HIGH
- Findings: 24 total (4 critical, 8 high, 12 medium)
Audit Results
| Category | Score | Status |
|---|---|---|
| User/Group | 0/10 | CRITICAL (Running as root) |
| Privileges | 2/10 | HIGH (NoNewPrivileges missing) |
| Filesystem | 5/15 | MEDIUM (ProtectSystem not strict) |
| Kernel | 10/10 | PASS |
| Namespaces | 0/10 | HIGH (PrivateDevices=no) |
| Network | 10/10 | PASS |
| Exec/Binary | 5/10 | MEDIUM (Uses shell wrapper) |
| Secrets | 5/5 | PASS (Secrets masked) |
| Restart | 5/10 | LOW (No Watchdog) |
| Hardening Profile | 0/10 | FAIL (<7 core directives) |
Top 3 Prioritized Fixes
- Define a dedicated User: Add
User=api-serviceto the[Service]section to drop root privileges.
Enable Process Sandboxing: Add NoNewPrivileges=true and ProtectSystem=strict to prevent the service from escalating or modifying the OS.
3. Isolate Devices: Set PrivateDevices=true to ensure the service cannot access raw system devices.
Files Generated:
- Score Card:
scan-2024-05-20.png - Detailed Report:
scan-report.md
Next steps
- Open
scan-report.mdto see the specific file lines triggering the critical findings. - Apply the top 3 fixes to your
.servicefiles. - Run the audit again to verify the score improvement.
scan-2024-05-20.png
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual systemd hardening is tedious and error-prone. This skill audits unit files before you enable them, ensuring your background services aren't just root shells with a timer.
What it does
- Security Scoring calculates a 0-100 score, grade, and risk level based on 10 specific hardening categories.
- Sandboxing Analysis checks for filesystem lockdowns, kernel shielding, and namespace isolation.
- Privilege Audit verifies the service drops root privileges and restricts capabilities.
- Network Fencing reviews socket modes and address family restrictions to prevent unauthorized exposure.
- Automated Reporting generates a prioritized fix list and a shareable PNG score-card.
How it works
- Fetch Units using
scripts/units_fetch.pyto copy service, socket, and timer files from system directories to a local folder. - Execute Scan by running
scripts/run.pyon the target directory to analyze directives and drop-in overrides. - Review Findings via the generated Markdown report which masks any literal secrets found in
Environment=strings. - Iterate by applying suggested fixes to the unit files and re-scanning until the risk level is acceptable.
Frameworks & tools
This tool interfaces with systemd unit files (*.service, *.socket, *.timer) and requires Python 3 for the analysis scripts.
Why this beats prompting it yourself
Generic prompts often miss the nuances of systemd's last-value-wins override logic and recursive drop-in directories. This skill uses a structured scanner to verify 10 distinct hardening categories, providing a repeatable, objective score instead of subjective advice.
Use cases
- Audit services generated by coding agents before running
systemctl enable. - Perform a security baseline of inherited servers or legacy repositories.
- Generate visual security score-cards for client reports or compliance audits.
- Identify services running with unnecessary root privileges or open network sockets.
Known limitations
The scanner only reads static unit files and cannot verify if the running kernel actually supports or enforces the directives. It does not resolve systemd specifiers like %i or %n.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Static analysis only. Does not verify live kernel enforcement or resolve systemd specifiers. Scans local files; ignores units not in the provided path.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
- Software
Python 3Pillow