UNPKG

aiwg

Version:

Cognitive architecture for AI-augmented software development with structured memory, ensemble validation, and closed-loop correction. FAIR-aligned artifacts, 84% cost reduction via human-in-the-loop, standards adopted by 100+ organizations.

526 lines (421 loc) 26.3 kB
# Security Requirements Template ## Document Control | Field | Value | |-------|-------| | Document Type | Security Requirements Specification | | Version | `[e.g., 1.0]` | | Date | `[YYYY-MM-DD]` | | Author | `[Security Architect, Requirements Analyst]` | | Reviewers | `[Product Owner, Development Lead, Compliance Officer]` | | Status | `[Draft/Approved/Updated]` | | Related Documents | Threat Model, Architecture Document, Compliance Matrix | ## Executive Summary ### Purpose Define comprehensive security requirements to protect `[system name]` against identified threats while ensuring compliance with applicable regulations and standards. ### Scope - **In Scope**: `[List components, services, and data types covered]` - **Out of Scope**: `[Explicitly list what is NOT covered]` - **Assumptions**: `[Key assumptions about environment, users, threats]` ### Security Objectives 1. **Confidentiality**: Protect sensitive data from unauthorized disclosure 2. **Integrity**: Ensure data and system integrity against tampering 3. **Availability**: Maintain agreed service levels and uptime 4. **Accountability**: Track and audit all security-relevant actions 5. **Compliance**: Meet regulatory and contractual obligations ## Authentication Requirements ### User Authentication #### Password-Based Authentication | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | AUTH-001 | Minimum password length of 12 characters | MUST | Unit test, config review | | AUTH-002 | Password complexity: uppercase, lowercase, numbers, special characters | MUST | Unit test | | AUTH-003 | Password history: prevent reuse of last 12 passwords | SHOULD | Integration test | | AUTH-004 | Password expiration: 90 days for privileged, 180 for standard users | SHOULD | Policy review | | AUTH-005 | Secure password storage using bcrypt/scrypt/Argon2 (min cost factor 12) | MUST | Code review, pen test | | AUTH-006 | Password strength meter on registration/change | SHOULD | UI test | | AUTH-007 | Breach password checking against known compromised passwords | SHOULD | Integration test | #### Multi-Factor Authentication (MFA) | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | AUTH-008 | MFA required for all administrative access | MUST | Access review | | AUTH-009 | MFA required for sensitive operations (transfers, deletions) | MUST | Functional test | | AUTH-010 | Support TOTP (RFC 6238) authenticator apps | MUST | Integration test | | AUTH-011 | Support FIDO2/WebAuthn for passwordless | SHOULD | Integration test | | AUTH-012 | Backup codes generation and secure storage | MUST | Functional test | | AUTH-013 | MFA device registration requires existing MFA or admin approval | MUST | Security test | #### Session Management | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | AUTH-014 | Session timeout: 15 min idle, 8 hours absolute | MUST | Functional test | | AUTH-015 | Session tokens: cryptographically random, minimum 128 bits | MUST | Code review | | AUTH-016 | Session invalidation on logout | MUST | Functional test | | AUTH-017 | Concurrent session limits per user | SHOULD | Load test | | AUTH-018 | Session token rotation on privilege elevation | MUST | Security test | | AUTH-019 | Secure session storage (no sensitive data client-side) | MUST | Code review | ### Service Authentication #### API Authentication | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | AUTH-020 | OAuth 2.0 for third-party API access | MUST | Integration test | | AUTH-021 | API key rotation capability (max 90 days) | MUST | Functional test | | AUTH-022 | mTLS for service-to-service communication | SHOULD | Config review | | AUTH-023 | JWT tokens with signature verification (RS256/ES256) | MUST | Unit test | | AUTH-024 | API rate limiting per key/user | MUST | Load test | | AUTH-025 | API key scoping to specific resources/operations | MUST | Authorization test | ## Authorization Requirements ### Access Control Model #### Role-Based Access Control (RBAC) | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | AUTHZ-001 | Define minimum 4 roles: Admin, User, ReadOnly, Service | MUST | Design review | | AUTHZ-002 | Principle of least privilege enforced | MUST | Access review | | AUTHZ-003 | Role assignment requires approval workflow | SHOULD | Functional test | | AUTHZ-004 | Regular access reviews (quarterly for privileged) | MUST | Audit report | | AUTHZ-005 | Segregation of duties for critical operations | MUST | Process review | | AUTHZ-006 | Emergency access ("break glass") procedures | SHOULD | Runbook test | #### Attribute-Based Access Control (ABAC) | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | AUTHZ-007 | Context-aware access (time, location, device) | SHOULD | Functional test | | AUTHZ-008 | Dynamic permissions based on data classification | SHOULD | Integration test | | AUTHZ-009 | Delegation capabilities with constraints | COULD | Functional test | | AUTHZ-010 | Policy decision point (PDP) centralization | SHOULD | Architecture review | ### Authorization Checks | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | AUTHZ-011 | Authorization checks on every request | MUST | Pen test, code review | | AUTHZ-012 | Default deny for undefined permissions | MUST | Security test | | AUTHZ-013 | Horizontal privilege escalation prevention | MUST | Security test | | AUTHZ-014 | Vertical privilege escalation prevention | MUST | Security test | | AUTHZ-015 | Authorization caching with TTL and invalidation | SHOULD | Performance test | ## Data Protection Requirements ### Data Classification and Handling | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | DATA-001 | Data classification at creation/ingestion | MUST | Process review | | DATA-002 | Classification labels in metadata | MUST | Data audit | | DATA-003 | Handling requirements per classification level | MUST | Policy review | | DATA-004 | Automated classification for known patterns (SSN, CC#) | SHOULD | Scanning tool | ### Encryption at Rest | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | DATA-005 | AES-256 encryption for Restricted/Confidential data | MUST | Config review | | DATA-006 | Encrypted database for sensitive data | MUST | Infrastructure audit | | DATA-007 | Encrypted file storage (object storage) | MUST | Infrastructure audit | | DATA-008 | Encrypted backups with separate key management | MUST | Backup test | | DATA-009 | Full disk encryption for all servers | MUST | Compliance scan | | DATA-010 | Application-level encryption for highly sensitive fields | SHOULD | Code review | ### Encryption in Transit | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | DATA-011 | TLS 1.2+ for all external communications | MUST | SSL scan | | DATA-012 | TLS 1.3 preferred where supported | SHOULD | SSL scan | | DATA-013 | Strong cipher suites only (no NULL, RC4, DES) | MUST | SSL scan | | DATA-014 | Perfect forward secrecy (PFS) enabled | SHOULD | SSL scan | | DATA-015 | Certificate pinning for mobile applications | SHOULD | Mobile app test | | DATA-016 | HSTS headers with preload | MUST | Header scan | ### Key Management | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | DATA-017 | Hardware security module (HSM) or KMS for key storage | MUST | Architecture review | | DATA-018 | Key rotation schedule (annual minimum) | MUST | Audit log review | | DATA-019 | Split knowledge/dual control for master keys | MUST | Process review | | DATA-020 | Key escrow and recovery procedures | MUST | DR test | | DATA-021 | Cryptographic key strength (RSA 2048+, ECC P-256+) | MUST | Key audit | | DATA-022 | Secure key destruction procedures | MUST | Process review | ### Data Loss Prevention | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | DATA-023 | DLP scanning for outbound communications | SHOULD | DLP reports | | DATA-024 | Watermarking for confidential documents | COULD | Document review | | DATA-025 | USB/removable media controls | SHOULD | Endpoint audit | | DATA-026 | Print controls for sensitive data | COULD | Policy review | ## Input Validation Requirements ### General Validation | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | INPUT-001 | Input validation on all external inputs | MUST | SAST, DAST | | INPUT-002 | Positive validation (allowlist) preferred | MUST | Code review | | INPUT-003 | Canonicalization before validation | MUST | Security test | | INPUT-004 | Length limits on all input fields | MUST | Fuzz testing | | INPUT-005 | Reject suspicious patterns early | SHOULD | WAF logs | ### Specific Validation Rules | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | INPUT-006 | Email validation (RFC 5322 compliant) | MUST | Unit test | | INPUT-007 | URL validation and scheme restrictions | MUST | Unit test | | INPUT-008 | File upload type validation (magic bytes) | MUST | Security test | | INPUT-009 | File size limits enforced | MUST | Functional test | | INPUT-010 | SQL injection prevention (parameterized queries) | MUST | DAST, pen test | | INPUT-011 | NoSQL injection prevention | MUST | Security test | | INPUT-012 | LDAP injection prevention | MUST | Security test | | INPUT-013 | XML/XXE attack prevention | MUST | Security test | | INPUT-014 | Command injection prevention | MUST | SAST, pen test | | INPUT-015 | Path traversal prevention | MUST | Security test | ### Output Encoding | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | INPUT-016 | Context-aware output encoding | MUST | XSS testing | | INPUT-017 | HTML entity encoding for HTML context | MUST | DAST | | INPUT-018 | JavaScript encoding for JS context | MUST | DAST | | INPUT-019 | URL encoding for URL context | MUST | DAST | | INPUT-020 | SQL escaping (if parameterization not possible) | MUST | Code review | ## Security Logging and Monitoring ### Logging Requirements | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | LOG-001 | Log all authentication attempts (success/failure) | MUST | Log review | | LOG-002 | Log all authorization failures | MUST | Log review | | LOG-003 | Log all privilege changes | MUST | Audit trail | | LOG-004 | Log all data access to Restricted classification | MUST | Audit trail | | LOG-005 | Log all configuration changes | MUST | Change log | | LOG-006 | Log all security exceptions/errors | MUST | Error monitoring | | LOG-007 | Include user, timestamp, source IP, action, result | MUST | Log format review | | LOG-008 | No sensitive data in logs (passwords, tokens, PII) | MUST | Log scan | ### Log Management | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | LOG-009 | Centralized log aggregation | MUST | Architecture review | | LOG-010 | Log retention: 90 days online, 1 year archive | MUST | Retention test | | LOG-011 | Log integrity protection (tamper-proof) | MUST | Integrity check | | LOG-012 | Log encryption in transit and at rest | MUST | Config review | | LOG-013 | Time synchronization (NTP) across all systems | MUST | Time audit | | LOG-014 | Log rotation and archival procedures | MUST | Operational test | ### Monitoring and Alerting | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | LOG-015 | Real-time security event monitoring | MUST | SOC review | | LOG-016 | Alerts for critical security events | MUST | Alert test | | LOG-017 | Alert thresholds for anomalous behavior | SHOULD | Baseline review | | LOG-018 | Security information event management (SIEM) | SHOULD | Tool review | | LOG-019 | Correlation rules for attack patterns | SHOULD | Rule test | | LOG-020 | Dashboard for security metrics | SHOULD | Dashboard review | ## Vulnerability Management ### Vulnerability Scanning | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | VULN-001 | Static application security testing (SAST) in CI/CD | MUST | Pipeline review | | VULN-002 | Dynamic application security testing (DAST) pre-release | MUST | Test report | | VULN-003 | Software composition analysis (SCA) for dependencies | MUST | Dependency scan | | VULN-004 | Container image scanning | MUST | Registry scan | | VULN-005 | Infrastructure vulnerability scanning (weekly) | MUST | Scan schedule | | VULN-006 | Penetration testing (annual minimum) | MUST | Pentest report | ### Vulnerability Response | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | VULN-007 | Critical vulnerabilities: 24-hour SLA | MUST | Incident records | | VULN-008 | High vulnerabilities: 7-day SLA | MUST | Ticket metrics | | VULN-009 | Medium vulnerabilities: 30-day SLA | MUST | Ticket metrics | | VULN-010 | Low vulnerabilities: 90-day SLA | SHOULD | Ticket metrics | | VULN-011 | Vulnerability disclosure process | MUST | Published process | | VULN-012 | Security patch management process | MUST | Patch records | ## Secure Development Lifecycle ### Secure Coding Practices | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | SDLC-001 | Secure coding standards documented | MUST | Standards document | | SDLC-002 | Security training for all developers | MUST | Training records | | SDLC-003 | Security champions in each team | SHOULD | Org chart | | SDLC-004 | Threat modeling for all major features | MUST | Threat models | | SDLC-005 | Security design review for architecture changes | MUST | Review records | | SDLC-006 | Security code review for critical components | MUST | Review logs | ### Security Testing | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | SDLC-007 | Security unit tests for auth/authz code | MUST | Test coverage | | SDLC-008 | Security integration tests | MUST | Test suite | | SDLC-009 | Security regression tests | MUST | Test automation | | SDLC-010 | Abuse case testing | SHOULD | Test cases | | SDLC-011 | Fuzz testing for input handlers | SHOULD | Fuzzing reports | ### Third-Party Security | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | SDLC-012 | Security assessment for third-party components | MUST | Assessment report | | SDLC-013 | License compliance checking | MUST | License scan | | SDLC-014 | Supply chain security (SBOM) | MUST | SBOM generation | | SDLC-015 | Vendor security questionnaires | SHOULD | Completed forms | ## Compliance Requirements ### Regulatory Compliance #### GDPR Requirements (if applicable) | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | COMP-001 | Privacy by design implementation | MUST | Design review | | COMP-002 | Data minimization principle | MUST | Data audit | | COMP-003 | Consent management system | MUST | Functional test | | COMP-004 | Right to access implementation | MUST | Functional test | | COMP-005 | Right to erasure ("forget") implementation | MUST | Functional test | | COMP-006 | Data portability capability | MUST | Export test | | COMP-007 | Breach notification within 72 hours | MUST | Process test | #### PCI DSS Requirements (if applicable) | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | COMP-008 | Network segmentation for CDE | MUST | Network scan | | COMP-009 | No storage of sensitive authentication data | MUST | Data scan | | COMP-010 | Strong cryptography for cardholder data | MUST | Crypto audit | | COMP-011 | Quarterly vulnerability scans | MUST | ASV scans | | COMP-012 | Annual penetration testing | MUST | Pentest report | #### HIPAA Requirements (if applicable) | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | COMP-013 | PHI encryption at rest and in transit | MUST | Encryption audit | | COMP-014 | Access controls for PHI | MUST | Access review | | COMP-015 | Audit controls for PHI access | MUST | Audit logs | | COMP-016 | Business Associate Agreements (BAAs) | MUST | Contract review | | COMP-017 | Contingency planning for PHI systems | MUST | DR test | ### Industry Standards | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | COMP-018 | OWASP Top 10 coverage | MUST | Security testing | | COMP-019 | OWASP ASVS Level 2 minimum | SHOULD | ASVS assessment | | COMP-020 | CIS Controls implementation | SHOULD | Control audit | | COMP-021 | ISO 27001 alignment | COULD | Gap analysis | | COMP-022 | NIST Cybersecurity Framework | SHOULD | Framework assessment | ## Incident Response Requirements ### Incident Preparation | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | IR-001 | Incident response plan documented | MUST | Plan review | | IR-002 | Incident response team identified | MUST | Contact list | | IR-003 | Classification and severity definitions | MUST | Playbook review | | IR-004 | Communication templates prepared | MUST | Template review | | IR-005 | Forensic tools and procedures ready | SHOULD | Tool inventory | ### Incident Handling | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | IR-006 | Incident detection within 1 hour | MUST | Detection metrics | | IR-007 | Incident triage within 15 minutes | MUST | Response metrics | | IR-008 | Containment decision within 1 hour | MUST | Decision log | | IR-009 | Evidence preservation procedures | MUST | Chain of custody | | IR-010 | Root cause analysis for all incidents | MUST | RCA reports | ### Post-Incident | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | IR-011 | Post-incident review within 5 days | MUST | Review meetings | | IR-012 | Lessons learned documentation | MUST | Knowledge base | | IR-013 | Control improvements from incidents | MUST | Change tracking | | IR-014 | Incident metrics and trending | SHOULD | Metrics dashboard | ## Privacy Requirements ### Data Minimization | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | PRIV-001 | Collect only necessary data | MUST | Data audit | | PRIV-002 | Purpose limitation enforcement | MUST | Process review | | PRIV-003 | Data retention limits defined | MUST | Retention policy | | PRIV-004 | Automatic data expiration | SHOULD | Deletion jobs | | PRIV-005 | Anonymization/pseudonymization where possible | SHOULD | Data review | ### User Rights | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | PRIV-006 | Transparent privacy notice | MUST | Legal review | | PRIV-007 | Opt-in consent mechanisms | MUST | Consent audit | | PRIV-008 | Consent withdrawal capability | MUST | Functional test | | PRIV-009 | Data access request handling | MUST | Request test | | PRIV-010 | Data deletion request handling | MUST | Deletion test | | PRIV-011 | Data correction capability | MUST | Update test | | PRIV-012 | Marketing preference management | SHOULD | Preference test | ## Security Architecture Requirements ### Defense in Depth | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | ARCH-001 | Multiple security layers (perimeter, network, host, application, data) | MUST | Architecture review | | ARCH-002 | Network segmentation and isolation | MUST | Network diagram | | ARCH-003 | DMZ for internet-facing services | MUST | Network scan | | ARCH-004 | Zero trust architecture principles | SHOULD | Design review | | ARCH-005 | Microsegmentation for critical assets | SHOULD | Network config | ### Security Zones | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | ARCH-006 | Separate development, test, production environments | MUST | Environment audit | | ARCH-007 | No production data in non-production | MUST | Data scan | | ARCH-008 | Restricted administrative access zones | MUST | Access audit | | ARCH-009 | Air-gapped backup environment | SHOULD | Backup test | ### Infrastructure Security | Requirement ID | Description | Priority | Verification Method | |----------------|-------------|----------|-------------------| | ARCH-010 | Hardened OS configurations (CIS benchmarks) | MUST | Compliance scan | | ARCH-011 | Container security scanning and policies | MUST | Container audit | | ARCH-012 | Immutable infrastructure where possible | SHOULD | Deploy review | | ARCH-013 | Infrastructure as Code security | MUST | IaC scan | | ARCH-014 | Cloud security posture management | MUST | CSPM tool | ## Acceptance Criteria ### Security Story Definition of Done A security requirement is considered complete when: 1. **Implementation** - [ ] Code implemented according to requirement - [ ] Security controls integrated and configured - [ ] Error handling includes security considerations - [ ] Logging added for security events 2. **Testing** - [ ] Unit tests verify security controls - [ ] Integration tests confirm end-to-end security - [ ] Negative testing for abuse cases - [ ] Security test cases pass 3. **Validation** - [ ] Code review includes security review - [ ] SAST scan shows no high/critical issues - [ ] Manual security testing completed - [ ] Requirement traceability documented 4. **Documentation** - [ ] Security configuration documented - [ ] Operational runbooks updated - [ ] User documentation includes security guidance - [ ] Threat model updated if needed ## Verification Methods ### Testing Approaches | Method | Description | When Used | Tool Examples | |--------|-------------|-----------|---------------| | Unit Test | Automated tests for individual functions | Every build | JUnit, pytest, Jest | | Integration Test | End-to-end security flow testing | Daily builds | Selenium, Postman | | SAST | Static code analysis | Pre-commit/PR | SonarQube, Checkmarx | | DAST | Dynamic application testing | Pre-release | OWASP ZAP, Burp | | Penetration Test | Manual expert testing | Quarterly/Annually | Manual tools | | Code Review | Peer review with security focus | Every PR | GitHub, GitLab | | Configuration Review | Infrastructure/platform settings | Monthly | Scripts, CSPM | | Compliance Scan | Regulatory requirement validation | Quarterly | Various scanners | ### Evidence Collection All security requirements must maintain evidence of implementation: - Test results and reports - Scan results and remediation records - Review logs and approvals - Configuration screenshots or exports - Audit logs demonstrating controls - Signed attestations where applicable ## Appendices ### A. Security Requirement Priorities - **MUST**: Mandatory requirement, release blocker if not met - **SHOULD**: Important requirement, exception needs approval - **COULD**: Desirable requirement, implement if time permits - **WON'T**: Out of scope for this release (document for future) ### B. Regulatory Applicability Matrix | Regulation | Applicable | Data Types | Geographic Scope | |------------|------------|------------|------------------| | GDPR | `[Yes/No]` | Personal data of EU residents | European Union | | CCPA | `[Yes/No]` | Personal information of CA residents | California, USA | | PCI DSS | `[Yes/No]` | Payment card data | Global | | HIPAA | `[Yes/No]` | Protected health information | United States | | SOC 2 | `[Yes/No]` | Customer data | Global | ### C. Security Tools and Technologies | Category | Tool/Technology | Purpose | Status | |----------|----------------|---------|--------| | Authentication | `[OAuth 2.0, SAML]` | SSO/Federation | Implemented | | Secrets Management | `[HashiCorp Vault]` | Key/Secret storage | Planned | | SAST | `[SonarQube]` | Code analysis | Implemented | | DAST | `[OWASP ZAP]` | Dynamic testing | Planned | | Monitoring | `[Splunk]` | SIEM/Logging | Implemented | ### D. References - OWASP Application Security Verification Standard (ASVS) 4.0 - OWASP Top 10 2021 - NIST SP 800-53 Security Controls - ISO/IEC 27001:2013 Information Security Management - CIS Controls v8 - PCI DSS v4.0 - GDPR Articles and Recitals - NIST Cybersecurity Framework ## Document Sign-Off | Role | Name | Signature | Date | |------|------|-----------|------| | Security Architect | `[Name]` | `[Signature]` | `[Date]` | | Product Owner | `[Name]` | `[Signature]` | `[Date]` | | Development Lead | `[Name]` | `[Signature]` | `[Date]` | | Compliance Officer | `[Name]` | `[Signature]` | `[Date]` | | Risk Manager | `[Name]` | `[Signature]` | `[Date]` |