security-toolkit

Security scanning toolkit for BFF boundaries and CI/CD. Use when setting up or running gitleaks, semgrep, bandit, trivy, checkov, or hadolint.

$ 安裝

git clone https://github.com/bout3fiddy/agents /tmp/agents && cp -r /tmp/agents/skills/security-toolkit ~/.claude/skills/agents

// tip: Run this command in your terminal to install the skill


name: security-toolkit description: Security scanning toolkit for BFF boundaries and CI/CD. Use when setting up or running gitleaks, semgrep, bandit, trivy, checkov, or hadolint. metadata: version: "1.0.0"

Security Toolkit Skill

"Assume Breach" security tooling for Python/TypeScript on GCP Cloud Run.

This skill provides ready-to-use configurations for enforcing BFF security boundaries in CI/CD and local scans.

Philosophy: Assume Breach Containment

Vulnerabilities happen. The goal is blast radius reduction, not just prevention.

When RCE occurs in the frontend:

  1. No database credentials to steal - credentials only in backend
  2. No lateral movement - network policies block everything except BFF API
  3. No persistence - read-only filesystem, distroless images
  4. Immediate detection - runtime monitoring catches anomalies

Quick Start

1. Copy Configs to Project Root

# From project root
cp ~/.codex/skills/security-toolkit/config/.gitleaks.toml .
cp ~/.codex/skills/security-toolkit/config/.pre-commit-config.yaml .
cp -r ~/.codex/skills/security-toolkit/config/.semgrep .
cp ~/.codex/skills/security-toolkit/config/.checkov.yaml .
cp ~/.codex/skills/security-toolkit/config/.hadolint.yaml .
cp ~/.codex/skills/security-toolkit/workflows/security-scan.yml .github/workflows/

2. Install Pre-commit Hooks

poetry add --group dev pre-commit
poetry run pre-commit install

3. Run Initial Scan

# Run all security checks
poetry run pre-commit run --all-files

# Or run specific tools
gitleaks detect --source . --verbose
poetry run semgrep --config .semgrep/ .
poetry run bandit -r apps/ -c pyproject.toml
trivy fs . --scanners vuln,secret,misconfig

What's Included

FilePurpose
.gitleaks.tomlSecret detection with GCP/Supabase custom rules
.pre-commit-config.yamlMulti-tool security hooks (gitleaks + bandit + semgrep + hadolint + checkov)
.semgrep/bff-security.yamlBFF boundary enforcement rules
.checkov.yamlIaC security policies for Terraform/Docker/K8s
.hadolint.yamlDockerfile security linting
security-scan.ymlGitHub Actions workflow with SARIF integration

Tool Stack (100% Free & Open Source)

CategoryToolLicense
Secret DetectionGitleaksMIT
Python SASTBanditApache 2.0
Multi-lang SASTSemgrepLGPL 2.1
Container ScanningTrivyApache 2.0
IaC SecurityCheckovApache 2.0
Dockerfile LintingHadolintGPL 3.0
Dependency Scanningpip-audit, npm auditApache 2.0, Built-in

Rule ↔ Tool Mapping

Security RequirementEnforcing Tool
No direct DB access in frontendSemgrep bff-no-frontend-database
No service credentials in frontendSemgrep + Gitleaks
No child_process in frontendSemgrep bff-no-frontend-child-process
No eval/Function in frontendSemgrep bff-no-frontend-eval
Distroless base imagesHadolint + Trivy
Read-only filesystemCheckov
Non-root container userHadolint DL3002
Network policy default-denyCheckov

Files in This Skill

  • README.md - This file
  • installation.md - Detailed setup instructions
  • commands.md - Quick reference for all tools
  • assume-breach-checklist.md - Threat → Tool → Response mapping
  • incident-response.md - Runbook template
  • config/ - Ready-to-use configuration files
  • workflows/ - GitHub Actions workflows

When to Use This Skill

  • Setting up security scanning for a new project
  • Adding security checks to CI/CD pipeline
  • Enforcing BFF security boundaries
  • Responding to security incidents
  • Auditing existing security posture

Related

  • GCP Operations: ~/.codex/skills/gcp-operations/ - Deployment and secrets management