security-scan-policy
Policy สำหรับ automated security scanning ใน CI/CD pipeline รวม dependency audit, SAST, และ secret detection
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Security Scan Policy
Overview
Policy สำหรับ automated security scanning - dependency vulnerabilities, code vulnerabilities, secrets - ต้องผ่านก่อน deploy
Why This Matters
- Prevent breaches: จับ vulnerabilities ก่อน production
- Compliance: Meet security requirements
- Automated: ไม่พลาด human error
- Fast feedback: รู้ทันทีถ้ามี issue
Security Checks
1. Dependency Audit
# Check for vulnerable dependencies
npm audit --audit-level=high
# Must have 0 high/critical vulnerabilities
✓ 0 vulnerabilities found
2. SAST (Static Analysis)
# Scan code for security issues
npm run security:scan
# Check for:
- SQL injection
- XSS vulnerabilities
- Insecure crypto
- Hardcoded secrets
3. Secret Detection
# Scan for leaked secrets
git-secrets --scan
# Check for:
- API keys
- Passwords
- Private keys
- Tokens
CI Pipeline
# .github/workflows/security.yml
name: Security Scan
on: [pull_request, push]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Dependency Audit
run: npm audit --audit-level=high
- name: SAST Scan
uses: github/codeql-action/analyze@v2
- name: Secret Scan
uses: trufflesecurity/trufflehog@main
- name: Container Scan
run: trivy image myapp:latest
Severity Levels
| Level | Action | Example |
|---|---|---|
| Critical | Block merge | RCE vulnerability |
| High | Block merge | SQL injection |
| Medium | Warning | Weak crypto |
| Low | Info only | Outdated dependency |
Tools
Dependency: npm audit, Snyk
SAST: CodeQL, SonarQube
Secrets: TruffleHog, git-secrets
Container: Trivy, Grype
Summary
Security Scan: Automated security checks
Checks:
- Dependency audit (npm audit)
- SAST (CodeQL)
- Secret detection (TruffleHog)
- Container scan (Trivy)
Policy:
- Critical/High: Block merge
- Medium: Warning
- Low: Info only
No exceptions for Critical/High
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!