jmservera/aithena/security-patterns
Claude Code and agent skill by jmservera/aithena
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
CI workflow security, secrets handling, security scanning, and logging security patterns
Install
npx vskill@latest install jmservera/aithena/security-patternsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as jmservera/aithena/security-patterns.
Context
Apply when writing/reviewing GitHub Actions workflows, handling secrets, configuring security scanners, or implementing error logging in production services. Defense-in-depth across CI/CD and application layers.
Pattern 1: Secrets Handling in GitHub Actions
Rule: Use with: Parameters, NOT Step env: Blocks
❌ Insecure — secret in env block:
✅ Secure — inline with parameter:
Additional Secret Rules
- Always use `${{ secrets.X }}` syntax — GitHub masking only works with this syntax
- Never pipe secrets:
${{ secrets.X }} | commandexposes in process list - Always quote expansions:
"${{ env.VAR }}"prevents word splitting - Use `::add-mask::` for sensitive output before passing to commands that might echo
- Token scope: least privilege — use
GITHUB_TOKENfor single-repo CI, fine-grained PATs for cross-repo
Token Scope Reference
| Token | Scope | Use Case | |
|---|---|---|---|
GITHUB_TOKEN | PR + repo context | CI/CD in same repo | |
| Fine-grained PAT | Specific repos + perms | Dependabot, external tools | |
| GitHub App token | App permissions only | Bot automation |
Pattern 2: Bot-Condition Guards
For auto-approving copilot PRs, use pull_request_target with author detection:
Critical: Never use actions/checkout on PR code in pull_request_target workflows. API-only operations, verified author check.
Pattern 3: Security Scanner Configuration
Bandit (Python SAST)
- Config:
.bandit(centralized) - Mode: blocking scan; findings should fail the job, then SARIF still uploads with
if: always() - Keep
.banditin Bandit's project-level INI format and runbandit -r .; treat "Unable to parse config file" and malformed# nosecwarnings as actionable - Baseline skips: B101 (pytest assert), B104 (0.0.0.0 in containers), B105/B106/B108 (test data), B603/B607 (subprocess in tests), plus documented low-risk test/runtime exceptions
- Always exclude:
.venv,site-packages,node_modules
Checkov (IaC)
- Config:
.checkov.yml - Scope: Dockerfiles + GitHub Actions workflows
- CKV_GHA_7: Document exceptions for
workflow_dispatchinputs (SLSA guideline) - CKV_GHA_5: Pin actions to SHAs, not floating tags
Zizmor (GitHub Actions Supply Chain)
- Config:
.zizmor.yml(baseline exceptions) - Focus:
template-injection,dangerous-triggers,secrets-outside-env - Pre-commit integration: run before committing workflow changes
Triage Workflow
- CRITICAL/HIGH: Must fix OR documented baseline exception with runtime mitigation
- MEDIUM/LOW: Baseline exception acceptable if low exploitability
- False positive: Dismiss with
noqa+ inline rationale comment (never suppress silently) - Real findings: Fix if trivial; otherwise document in
docs/security/baseline-exceptions.md - Green CI can hide risk: inspect scanner logs/SARIF for
soft-fail,continue-on-error, parse warnings, and note-level findings before declaring a security review clean
Pattern 4: Logging Security
Prevent information disclosure in production logs while preserving debugging.
Two-Tier Exception Logging
Rules
- Never use `logger.exception()` in production error paths — exposes stack traces
- Never use `str(exc)` at production log level — may leak internal paths; use
type(exc).__name__ - Never log raw user input at INFO/ERROR level — use document ID or hash only
- Never use `exc_info=True` at CRITICAL/ERROR level — reserve for DEBUG
API Error Response Pattern
CI Workflow Security Review Checklist
Before merging a workflow change:
- [ ] Run
zizmor .github/workflows/*.yml— no secrets-outside-env - [ ] All secrets use
with:parameters, not step-levelenv: - [ ] Template expansions use
${{ ... }}, not$SHELL_VAR - [ ] Bot-authored PRs use
pull_request_target+ author guard - [ ] All actions pinned to SHAs
- [ ] Token scopes match API operations
- [ ] No hardcoded credentials
- [ ] Logs don't expose secrets (test with dry-run)
Anti-Patterns
- ❌ Using CLI flags instead of config files for scanners — centralized config is auditable
- ❌ Suppressing scanner findings without rationale — bare
noqa: S404tells nothing - ❌ Scanning
.venvdirectories — generates hundreds of third-party false positives - ❌ Using
logger.exception()anywhere in auth/error paths - ❌ Relying on "we'll filter logs later" — logs are already shipped to monitoring
- ❌ Hardcoded secrets in workflow files
References
.bandit,.checkov.yml,.zizmor.yml.github/workflows/security-*.ymldocs/security/baseline-exceptions.md- PR #313 (secrets fix), Issue #294, PR #412 (Dependabot)
- Zizmor: https://github.com/woodruffw/zizmor
- SLSA Framework: https://slsa.dev/
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.squad/skills/security-patterns/SKILL.md
Popularity
- Repository stars
- 1
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jmservera/aithena/security-patterns)