security-automation — Claude Code skill: automate security work
A skill that automates security checks and remediation: pipelines, auto-fixes, SOAR playbooks, compliance as code.
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill security-automation -a claude-codeWhat security-automation does
The skill pulls together what usually lives in separate repos: secret scanning, SAST, dependency and container checks, compliance scans. Inside are ready-made configs and scripts the agent drops into your project.
The pipeline runs on GitHub Actions. trufflehog scans for leaked secrets, semgrep does static analysis, npm audit checks dependencies, trivy scans the filesystem, and checkov runs Terraform against policies. Auto-remediation is written in Python with boto3 — one script blocks public access on an S3 bucket. There is also a YAML SOAR playbook: respond to a suspicious login, enrich the IP via threat intel, block it, disable the user, open a ticket.
Compliance as code shows up as a custom Checkov check in Python. The guidance says to start with the highest-impact automations, test in staging, and keep manual review gates. That last point matters: without a review gate, an auto-remediation script can lock down a bucket you actually meant to keep public.
What it helps with
- add secret scanning to CI
- wire SAST and dependency checks into a pipeline
- block public access on an S3 bucket with a script
- write a SOAR playbook for suspicious logins
- build a custom Checkov check for Terraform
Example prompts for the agent
- add a security pipeline with trufflehog, semgrep and trivy to this repo
- write an auto-remediation script for a public S3 bucket
- build a SOAR playbook for suspicious_login alerts
How to install security-automation
1Skills CLI (Vercel)
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill security-automation -a claude-code2Manually: put the files in place
~/.claude/skills/security-automation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/security-automation/
1Skills CLI (Vercel)
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill security-automation -a codex2Manually: put the files in place
.agents/skills/security-automation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill security-automation -a cursor2Manually: put the files in place
.cursor/skills/security-automation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install BagelHole/DevOps-Security-Agent-Skills security-automation2Manually: put the files in place
.github/skills/security-automation/SKILL.md1Skills CLI (Vercel)
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill security-automation -a gemini-cli2Platform CLI
gemini skills install https://github.com/BagelHole/DevOps-Security-Agent-Skills --path security/operations/security-automationManually: put the files in place
.devin/skills/security-automation/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill security-automation -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about security-automation
How do I install security-automation in Claude?
Run npx skills add BagelHole/DevOps-Security-Agent-Skills --skill security-automation -a claude-code. The skill lands in ~/.claude/skills/security-automation/SKILL.md.
What does security-automation do?
It helps the agent build security pipelines, write auto-remediation scripts, set up SOAR playbooks, and define compliance checks as code.
Which tools does the skill use?
The examples use GitHub Actions, trufflehog, semgrep, npm audit, trivy, checkov, Python with boto3, and YAML for playbooks.
Source text
SKILL.md · MIT
---
name: security-automation
description: Automate security workflows and remediation. Build security pipelines, automate compliance checks, and implement SOAR capabilities. Use when scaling security operations or implementing DevSecOps.
license: MIT
metadata:
author: devops-skills
version: "1.0"
---
# Security Automation
Automate security operations for scale and efficiency.
## Security Pipeline
```yaml
# .github/workflows/security.yml
name: Security Pipeline
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Secret Scanning
uses: trufflesecurity/trufflehog@main
- name: SAST
uses: returntocorp/semgrep-action@v1
- name: Dependency Scan
run: npm audit --audit-level=high
- name: Container Scan
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
- name: Compliance Check
run: |
checkov -d . --framework terraform
```
## Automated Remediation
```python
# Auto-remediation script
def remediate_public_s3(bucket_name):
"""Remove public access from S3 bucket."""
s3 = boto3.client('s3')
s3.put_public_access_block(
Bucket=bucket_name,
PublicAccessBlockConfiguration={
'BlockPublicAcls': True,
'IgnorePublicAcls': True,
'BlockPublicPolicy': True,
'RestrictPublicBuckets': True
}
)
```
## SOAR Integration
```yaml
playbook:
name: Suspicious Login Response
trigger: alert.type == "suspicious_login"
actions:
- enrich_ip:
source: threat_intel
- if_condition: ip.is_malicious
then:
- block_ip:
firewall: cloudflare
- disable_user:
duration: 1h
- notify:
channel: security
- create_ticket:
priority: high
```
## Compliance as Code
```python
# Checkov custom check
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
class S3Encryption(BaseResourceCheck):
def __init__(self):
name = "Ensure S3 bucket has encryption enabled"
id = "CUSTOM_S3_1"
supported_resources = ['aws_s3_bucket']
super().__init__(name=name, id=id, ...)
def scan_resource_conf(self, conf):
if 'server_side_encryption_configuration' in conf:
return CheckResult.PASSED
return CheckResult.FAILED
```
## Best Practices
- Start with high-impact automations
- Test in staging first
- Include manual review gates
- Monitor automation effectiveness
- Regular rule updates
## Related Skills
- [github-actions](../../../devops/ci-cd/github-actions/) - CI/CD automation
- [policy-as-code](../../../compliance/governance/policy-as-code/) - Policy enforcement
© devops-skills · MIT · BagelHole/DevOps-Security-Agent-Skills