Skip to main content

secure-development-policy

Comprehensive secure development lifecycle covering all SDLC phases, AI controls, testing, and security requirements per Hack23 ISMS

Source facts

Repository
Hack23/riksdagsmonitor
Last source activity
April 17, 2026 at 13:20
Detected SKILL.md language
English
Stars
13
Forks
3

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions ยท Read-only preview
name
secure-development-policy
description
Comprehensive secure development lifecycle covering all SDLC phases, AI controls, testing, and security requirements per Hack23 ISMS
license
Apache-2.0
# ๐Ÿ›ก๏ธ Secure Development Policy Skill ## ๐Ÿ”ด AI FIRST Quality Principle > **Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.** ## ๐ŸŽฏ 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](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) This skill provides comprehensive guidance for implementing all phases of the secure development lifecycle with clear, actionable requirements following [STYLE_GUIDE.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/STYLE_GUIDE.md) icon standards. --- ## ๐Ÿ”„ Secure Development Lifecycle (SDLC) - All Phases ### ๐Ÿ“‹ Phase 1: Planning & Design **Clear Requirements:** - โœ… Complete project classification per [Classification Framework](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) - โœ… 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:** ```yaml 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](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Vulnerability_Management.md) - โœ… Security metrics tracked per [Security Metrics](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Security_Metrics.md) - โœ… Regular dependency updates (automated via Dependabot) - โœ… Security patches applied per classification SLAs - โœ… Incident response integration per [Incident Response Plan](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Incident_Response_Plan.md) - โœ… 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/*.md` require CEO approval - โœ… Changes to `.github/copilot-mcp*.json` require CEO approval - โœ… Changes to `.github/workflows/copilot-setup-steps.yml` require CEO approval - โœ… Treat as Normal Changes per [Change Management](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Change_Management.md) - โœ… 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](https://hack23.github.io/cia/surefire.html) โ€ข [Coverage](https://hack23.github.io/cia/jacoco/) โ€ข [Plan](https://github.com/Hack23/cia/blob/master/UnitTestPlan.md) - ๐ŸŽฎ **Black Trigram:** [Tests](https://blacktrigram.com/test-results/) โ€ข [Coverage](https://blacktrigram.com/coverage/) โ€ข [Plan](https://github.com/Hack23/blacktrigram/blob/main/UnitTestPlan.md) - ๐Ÿ“Š **CIA Compliance Manager:** [Tests](https://ciacompliancemanager.com/test-results/) โ€ข [Coverage](https://ciacompliancemanager.com/coverage/) โ€ข [Plan](https://github.com/Hack23/cia-compliance-manager/blob/main/docs/UnitTestPlan.md) --- ## ๐ŸŒ 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](https://github.com/Hack23/cia/blob/master/E2ETestPlan.md) - ๐ŸŽฎ **Black Trigram:** [E2E Tests](https://blacktrigram.com/cypress/mochawesome/) โ€ข [Plan](https://github.com/Hack23/blacktrigram/blob/main/E2ETestPlan.md) - ๐Ÿ“Š **CIA Compliance Manager:** [E2E Tests](https://ciacompliancemanager.com/cypress/mochawesome/) โ€ข [Plan](https://github.com/Hack23/cia-compliance-manager/blob/main/docs/E2ETestPlan.md) --- ## ๐Ÿ•ท๏ธ Threat Modeling Requirements **Clear Requirements per [Threat Modeling Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Threat_Modeling.md):** ### ๐Ÿ“‹ 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](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md) โ€ข [STRIDE](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md#stride-threat-analysis) โ€ข [Attack Trees](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md#attack-tree-analysis) - ๐ŸŽฎ **Black Trigram:** [Threat Model](https://github.com/Hack23/blacktrigram/blob/main/THREAT_MODEL.md) โ€ข [Gaming Security](https://github.com/Hack23/blacktrigram/blob/main/THREAT_MODEL.md#gaming-specific-threats) - ๐Ÿ“Š **CIA Compliance Manager:** [Threat Model](https://github.com/Hack23/cia-compliance-manager/blob/main/docs/architecture/THREAT_MODEL.md) โ€ข [Risk Assessment](https://github.com/Hack23/cia-compliance-manager/blob/main/docs/architecture/THREAT_MODEL.md#quantitative-risk-assessment) --- ## ๐ŸŽ–๏ธ Public Evidence Requirements **Clear Requirements per [STYLE_GUIDE.md](https://github.com/Hack23/ISMS-PUBLIC/blob/main/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:** ```markdown [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/ORG/REPO/badge)](https://scorecard.dev/viewer/?uri=github.com/ORG/REPO) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/ID/badge)](https://bestpractices.coreinfrastructure.org/projects/ID) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=ORG_REPO&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ORG_REPO) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ORG_REPO&metric=coverage)](https://sonarcloud.io/summary/new_code?id=ORG_REPO) [![Threat Model](https://img.shields.io/badge/Threat_Model-Documentation-blue)](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](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) - **Governance umbrella:** [Information Security Policy](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Information_Security_Policy.md) โ€” sets scope, roles, risk management and accountability for everything below - **Related Policies:**
View on GitHub
This SKILL.md is very large, so SkillsMP previews the first section here. View on GitHub