Works with the AI Agents you already use
Ansible Playbook Security Audit
by CashonlyTian
Manual Ansible security reviews are slow and prone to human error, leaving infrastructure vulnerable to privilege escalation and leaked credentials.
$7
Ansible Playbook Security Audit
Example session with this skill installed
Audit the Ansible repository in ./deploy-scripts for project 'Phoenix' with accent color #00FF00.
- Read your context and instructions
- Compiled the ansible playbook security
- Generated the document
I have completed the security audit for project
Phoenix. The scanner analyzed your playbooks, roles, and inventory files for configuration risks.
Score: 4/100
Grade: F
Risk Level: CRITICAL
Findings: 39 (15 Critical, 19 High, 5 Medium)
Audit Results
| Category | Score | Status |
|---|---|---|
| Privilege Escalation | 5/15 | ⚠️ Blanket 'become' detected |
| Shell Execution | 15/15 | ✅ Secure |
| Secrets in Playbooks | 0/15 | 🚨 Hardcoded keys found |
| Downloads | 10/10 | ✅ Verified |
| Package Install | 5/10 | ⚠️ State: latest used |
| File Permissions | 8/10 | ⚠️ Loose modes found |
| Exposure | 5/5 | ✅ Secure |
| Error Handling | 5/5 | ✅ Secure |
| User/Key Management | 10/10 | ✅ Secure |
| Scope and Trust | 5/5 | ✅ Secure |
Top 3 Prioritized Fixes
Remove Hardcoded Secrets: Detected literal tokens in group_vars/all.yml. Move these to Ansible Vault or use lookup() plugins.
2.
Restrict Privilege Escalation: Playbook site.yml uses become: yes at the play level. Move become to specific tasks requiring root access.
3.
Pin Package Versions: Multiple tasks in roles/web/tasks/main.yml use state: latest. Change to state: present with specific version strings.
Files Generated:
- Score-card:
scan-2024-05-20.png - Full Report:
scan-report.md
Next steps
- Review
scan-report.mdfor the exact line numbers of hardcoded secrets. - Encrypt sensitive variables using
ansible-vault. - Re-run the audit after applying fixes to update your score.
Clean demo (demo-project-clean)
Score: 100/100
Grade: A
Risk Level: LOW
Findings: 0
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 Ansible security reviews are slow and prone to human error, leaving infrastructure vulnerable to privilege escalation and leaked credentials. This skill automates the audit of Ansible repositories to detect misconfigurations before they reach production. It scans playbooks, roles, inventory files, and variables for high-risk patterns like blanket root access, hardcoded secrets, and unverified downloads.
What it does
- Privilege escalation audit identifies blanket
become: yesusage,become_user: rootdefaults, and manualsudocalls inside shell tasks. - Secret detection scans playbooks, vars, and inventory files for hardcoded passwords or tokens, ensuring sensitive values are masked.
- Secure transport validation flags unverified downloads, missing checksums in
get_url, and disabled certificate validation inurimodules. - Package & file security detects unpinned versions, disabled GPG checks, and unsafe file permissions like
0777or exposed private keys. - Execution safety checks for dangerous shell commands like
curl|sh, swallowed errors viaignore_errors, and over-broad host scopes.
How it works
- Target selection involves specifying the local path to the Ansible repository or role directory.
- Static analysis runs a local script to parse YAML and INI files for 10 specific security categories.
- Report generation produces a markdown report and a visual score-card image with a 0-100 grade.
- Remediation provides a prioritized list of fixes, starting with the most critical security gaps.
Frameworks & tools
This skill works with Ansible playbooks, roles, and inventory files (YAML/INI). The audit engine is a local Python-based static analysis tool that requires no network access.
Why this beats prompting it yourself
Prompting a standard LLM often misses nested misconfigurations in complex roles or overlooks hardcoded secrets in inventory files. This skill uses a specialized scoring system and consistent 10-point check methodology to ensure no critical configuration category is skipped.
Use cases
- CI/CD gating to prevent merging playbooks that use blanket root privileges.
- Code reviews for inherited Ansible codebases to quickly identify technical debt.
- Security compliance for generating shareable audit score-cards for clients.
- Pre-deployment checks to ensure automation won't pipe untrusted scripts into a shell.
Known limitations
Does not perform live infrastructure probing or CVE scanning for packages. It only scans local files under 2MB and cannot evaluate if a specific CIDR or permission is business-justified.
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.
Scans local files only. Skips files over 2MB. Cannot determine if a specific 'become: yes' is functionally required. Does not perform live network probing.
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