secure-development-policy
๐ก๏ธ Secure Development Policy Skill
๐ฏ Purpose Statement
Apply Hack23 AB's Secure Development Policy to demonstrate how security-by-design creates competitive advantages through systematic DevSecOps implementation.
Reference: Hack23 Secure Development Policy
This skill provides comprehensive guidance for implementing all phases of the secure development lifecycle with clear, actionable requirements following STYLE_GUIDE.md icon standards.
๐ Secure Development Lifecycle (SDLC) - All Phases
๐ Phase 1: Planning & Design
Clear Requirements:
- โ Complete project classification per Classification Framework
- โ Document CIA triad levels (Confidentiality, Integrity, Availability)
- โ Define RTO/RPO aligned with business impact
- โ Create SECURITY_ARCHITECTURE.md with Mermaid C4 diagrams
- โ Perform STRIDE threat modeling documented in THREAT_MODEL.md
- โ Complete risk assessment integrated with Risk Register
- โ Calculate security investment ROI based on classification
Deliverables Checklist:
- README.md includes "Project Classification" section
- SECURITY_ARCHITECTURE.md created with current state
- FUTURE_SECURITY_ARCHITECTURE.md created with roadmap
- THREAT_MODEL.md includes STRIDE analysis
- Risk assessment documented and registered
- Cost-benefit analysis approved by CEO
๐ป Phase 2: Development
Clear Requirements:
- โ Follow OWASP Top 10 secure coding standards
- โ Implement language-specific security best practices
- โ Require security-focused code review for all changes
- โ Apply data classification to all code assets
- โ Use GitHub secrets, never hardcode credentials
- โ Implement secret rotation procedures
- โ Use parameterized queries (no SQL injection)
- โ Validate and sanitize all inputs
- โ Encode outputs appropriately for context
- โ Implement proper error handling (no information disclosure)
Code Review Security Checklist:
- No hardcoded secrets or credentials
- Input validation on all external data
- Output encoding prevents XSS
- Parameterized queries prevent injection
- Authentication/authorization properly implemented
- Error messages don't leak sensitive info
- Logging captures security events
- Dependencies are approved and scanned
- Code follows least privilege principle
- Sensitive data encrypted at rest and in transit
๐งช Phase 3: Security Testing
Clear Requirements:
๐ฌ SAST (Static Application Security Testing)
- โ SonarCloud integration on every commit
- โ Quality gate must pass (no Critical/High vulnerabilities)
- โ Security hotspots reviewed and resolved
- โ Code coverage โฅ80% lines, โฅ70% branches
๐ฆ SCA (Software Composition Analysis)
- โ Automated dependency scanning (Dependabot/Renovate)
- โ SBOM generation (CycloneDX or SPDX format)
- โ License compliance via FOSSA scanning
- โ
Vulnerability remediation per classification SLAs:
- Critical: 24 hours
- High: 7 days
- Medium: 30 days
- Low: 90 days
โก DAST (Dynamic Application Security Testing)
- โ OWASP ZAP scanning in staging environment
- โ API security testing (authentication, authorization, input validation)
- โ Annual penetration testing for High/Critical projects
๐ Secret Scanning
- โ GitHub secret scanning enabled
- โ Pre-commit hooks prevent secret commits
- โ Immediate rotation for any exposed secrets
๐ Test Data Protection
- โ NEVER use production data in test environments
- โ Anonymize/pseudonymize/mask all test data
- โ Securely delete test data after use
- โ Restrict test environment access (least privilege)
๐ Phase 4: Deployment
Clear Requirements:
- โ Automated CI/CD with security gates
- โ All GitHub Actions pinned to SHA commits
- โ Harden-runner enabled with egress auditing
- โ Least privilege permissions in workflows
- โ Manual approval required for production
- โ Deployment checklist completed
- โ Security metrics and monitoring configured
- โ Rollback plan documented and tested
GitHub Actions Security Pattern:
permissions:
contents: read # Least privilege default
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@<SHA>
with:
egress-policy: audit
- uses: actions/checkout@<SHA>
# Pin ALL actions to SHA, not tags
๐ง Phase 5: Maintenance & Operations
Clear Requirements:
- โ Active vulnerability management per Vulnerability Management
- โ Security metrics tracked per Security Metrics
- โ Regular dependency updates (automated via Dependabot)
- โ Security patches applied per classification SLAs
- โ Incident response integration per Incident Response Plan
- โ Annual security review and threat model update
- โ Quarterly dependency and license audits
- โ Continuous monitoring and alerting
Monitoring Requirements:
- Security event logging enabled
- SIEM integration configured
- Vulnerability alerts routed to security team
- Performance metrics track security impact
- Compliance dashboards updated real-time
๐ค AI-Augmented Development Controls
Clear Requirements for ALL AI-assisted development:
๐ AI as Proposal Generator Only
- โ All AI outputs require human review and approval
- โ AI cannot bypass CI/CD, security gates, or approvals
- โ Human developer retains accountability for all changes
- โ AI cannot weaken security controls
- โ AI cannot autonomously deploy to production
๐ Mandatory PR Review Process
- โ All AI-assisted code goes through standard PR workflow
- โ PR description documents AI assistance used
- โ Security gates enforced (no exceptions for AI)
- โ Human reviewer verifies security controls intact
- โ Testing requirements unchanged (80%+ coverage)
๐ง Curator-Agent Governance
- โ
Changes to
.github/agents/*.mdrequire CEO approval - โ
Changes to
.github/copilot-mcp*.jsonrequire CEO approval - โ
Changes to
.github/workflows/copilot-setup-steps.ymlrequire CEO approval - โ Treat as Normal Changes per Change Management
- โ Document risk assessment for capability expansion
- โ All new integrations require security review
๐ก๏ธ Security & Audit Requirements
- โ Agents operate with least-privilege tool access
- โ MCP configurations under change control
- โ All agent activities logged and auditable
- โ Capability expansion requires security review
- โ Quarterly agent ecosystem security audit
๐ฏ Unit Test Coverage Requirements
Clear Requirements:
- โ Minimum 80% line coverage
- โ Minimum 70% branch coverage
- โ Tests run on every commit and PR
- โ UnitTestPlan.md documented in repository
- โ Public coverage reports via badges
- โ Historical coverage tracking (no regression)
- โ Coverage reports published to public URL
Reference Implementations:
- ๐๏ธ CIA: Unit Tests โข Coverage โข Plan
- ๐ฎ Black Trigram: Tests โข Coverage โข Plan
- ๐ CIA Compliance Manager: Tests โข Coverage โข Plan
๐ End-to-End Testing Requirements
Clear Requirements:
- โ All critical user journeys covered
- โ E2ETestPlan.md documented in repository
- โ Public Mochawesome/Cypress reports
- โ Cross-browser testing (Chrome, Firefox, Safari)
- โ Performance assertions within tests
- โ Authentication/authorization flows tested
- โ Error handling and edge cases covered
Reference Implementations:
- ๐๏ธ CIA: E2E Plan
- ๐ฎ Black Trigram: E2E Tests โข Plan
- ๐ CIA Compliance Manager: E2E Tests โข Plan
๐ท๏ธ Threat Modeling Requirements
Clear Requirements per Threat Modeling Policy:
๐ Required Documentation
- โ THREAT_MODEL.md in repository root
- โ STRIDE framework application (all 6 categories)
- โ MITRE ATT&CK technique mapping
- โ Attack tree analysis with probability/impact
- โ Threat agent classification (external/internal/supply chain)
- โ Quantitative risk assessment with business impact
- โ Security control mapping with effectiveness validation
๐ Maintenance Requirements
- โ Threat model created during design phase
- โ Updated for all architectural changes
- โ Annual comprehensive review
- โ Quarterly update cycle
- โ Incident-driven updates after security events
Reference Implementations:
- ๐๏ธ CIA: Threat Model โข STRIDE โข Attack Trees
- ๐ฎ Black Trigram: Threat Model โข Gaming Security
- ๐ CIA Compliance Manager: Threat Model โข Risk Assessment
๐๏ธ Public Evidence Requirements
Clear Requirements per STYLE_GUIDE.md:
Required Badges in README.md
- โ OpenSSF Scorecard (target: โฅ7.0)
- โ CII Best Practices (minimum: Passing)
- โ SLSA Level 3 attestation
- โ SonarCloud Quality Gate (must be "Passed")
- โ Code Coverage badge (โฅ80%)
- โ License badge (OSI-approved)
- โ Threat Model link badge
Example Badge Configuration:
[](https://scorecard.dev/viewer/?uri=github.com/ORG/REPO)
[](https://bestpractices.coreinfrastructure.org/projects/ID)
[](https://sonarcloud.io/summary/new_code?id=ORG_REPO)
[](https://sonarcloud.io/summary/new_code?id=ORG_REPO)
[](https://github.com/ORG/REPO/blob/main/THREAT_MODEL.md)
๐ Master Verification Checklist
Use this comprehensive checklist before ANY deployment:
Phase 1: Planning & Design โ
- Project classification complete (CIA + RTO/RPO + Business Impact)
- SECURITY_ARCHITECTURE.md created with C4 diagrams
- FUTURE_SECURITY_ARCHITECTURE.md created with roadmap
- THREAT_MODEL.md includes STRIDE + MITRE ATT&CK
- Attack trees documented with probability/impact
- Risk assessment registered
- Cost-benefit analysis approved
Phase 2: Development โ
- OWASP Top 10 mitigations implemented
- Language-specific security standards followed
- Code review completed with security focus
- Asset classification applied
- No hardcoded secrets (verified with secret scanning)
- Input validation implemented
- Output encoding implemented
- Error handling doesn't leak sensitive info
- Logging captures security events
Phase 3: Testing โ
- SAST passed (SonarCloud quality gate green)
- SCA clean (all vulnerabilities remediated per SLA)
- DAST completed (OWASP ZAP scan clean)
- Secret scanning clean
- Test data properly anonymized
- Unit test coverage โฅ80% lines, โฅ70% branches
- E2E tests cover all critical paths
- UnitTestPlan.md documented
- E2ETestPlan.md documented
Phase 4: Deployment โ
- CI/CD security gates passed
- All GitHub Actions pinned to SHA
- Harden-runner enabled
- Least privilege permissions
- Manual approval obtained for production
- Deployment checklist complete
- Security metrics configured
- Rollback plan tested
Phase 5: Operations โ
- Vulnerability management active
- Security metrics monitored
- Dependency updates automated
- Incident response integrated
- Annual review scheduled
- Quarterly audits scheduled
AI Controls โ
- Human review for all AI outputs
- No autonomous deployments
- PR documentation complete
- Agent permissions least-privilege
- MCP config under change control
- Audit trail enabled
Documentation โ
- SECURITY_ARCHITECTURE.md
- FUTURE_SECURITY_ARCHITECTURE.md
- THREAT_MODEL.md
- SECURITY.md (vulnerability disclosure)
- WORKFLOWS.md (CI/CD documentation)
- UnitTestPlan.md
- E2ETestPlan.md
- CRA-ASSESSMENT.md (if applicable)
- README includes classification section
- All required badges displayed
Public Evidence โ
- OpenSSF Scorecard โฅ7.0
- CII Best Practices (Passing+)
- SLSA Level 3 attestation
- Quality Gate passed
- Coverage โฅ80%
- License compliance (FOSSA clean)
๐ Authoritative References
- Primary Policy: Secure Development Policy
- Related Policies:
- Standards: STYLE_GUIDE.md
๐ก Key Takeaways
- ๐ก๏ธ Security by Design: Build security in from the start, not bolt on later
- ๐ Transparency: Public evidence through badges and documentation
- ๐ท๏ธ Classification-Driven: All decisions aligned with project classification
- ๐ Continuous Improvement: Regular reviews, updates, and learning from incidents
- ๐ค Human Accountability: AI assists, humans decide and approve
- ๐ Evidence-Based: Every security claim backed by public, verifiable proof
- โ Comprehensive Coverage: ALL 5 SDLC phases with clear, actionable requirements