Security¶
Design security in from the start rather than adding it at the end. Handling personal data lawfully, from collection to deletion, is in Privacy and personal data, and sign-in in Authentication and sessions.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
- 10 OWASP Application Security Verification Standard (ASVS): our security requirements checklist for applications.
- 9 OWASP Top 10: the most critical web application risks. Use it for awareness, not as a complete checklist.
- 9 OWASP Cheat Sheet Series: concise, practical guidance per topic.
- 8 NIST Secure Software Development Framework (SP 800-218): practices for a secure development lifecycle.
- 7 OWASP Secure Product Design Cheat Sheet: secure design principles at the architecture level.
- 7 CISA Secure by Design: principles for shipping products that are secure by default.
- 7 NCSC secure design principles (UK National Cyber Security Centre).
Key rules¶
- 10
SEC-1Deny by default, enforce least privilege, and check authorisation server-side on every request. (OWASP Authorization Cheat Sheet) - 10
SEC-2Keep secrets out of code and repositories. Store them in a secrets manager, scope access tightly, and rotate them. (OWASP Secrets Management Cheat Sheet) - 9
SEC-3Threat model early and revisit it as the design changes. Ask: what are we working on, what can go wrong, what are we going to do about it, and did we do a good enough job? (Threat Modeling Manifesto, OWASP Threat Modeling Cheat Sheet) - 9
SEC-10Validate all input that crosses a trust boundary on the server, against a schema or an allowlist, before using it, and never deserialize untrusted data with a mechanism that can create arbitrary objects or run code. Client-side checks can be bypassed and only give users quick feedback. Platform examples:NODE-3,PY-7,PY-14,TS-8,NEXTJS-1,SVELTE-11andGODOT-13. (OWASP Input Validation Cheat Sheet, OWASP Deserialization Cheat Sheet) - 9
SEC-11Treat everything you ship to a client as public, including browser bundles, page payloads, mobile apps and game builds, and never build secrets into it. Front-end frameworks mark which values reach the browser: seeNEXTJS-2,VUE-14,SVELTE-12andASTRO-7. (OWASP ASVS 5.0, V13 Configuration, OWASP Mobile Top 10, M1 Improper Credential Usage) - 9
SEC-19On users' devices, keep tokens, passwords and keys only in the operating system's secure storage, such as the Keychain on Apple platforms or the Android Keystore, or encrypted with a key kept there or derived from a passphrase the user enters, never in plain files, preferences or other unencrypted app storage. Unencrypted data can leak through file permissions, backups or a vulnerability in the app or device, and a key stored next to the data it encrypts doesn't protect it; browser apps followAUTH-1instead. Platform examples:IOS-6,RN-5andDESKTOP-12. (OWASP MASWE-0001, Sensitive Data Stored Unencrypted in Private Storage, OWASP Cryptographic Storage Cheat Sheet, Key storage, Encrypting stored keys) - 9
SEC-12Never keep one user's or one request's data in state that a server process shares between requests, such as module-level variables or singletons: scope it to the request, or keep it in a backing service. Otherwise data leaks between users, for example in server-side rendering (SVELTE-5,VUE-6) or in reused serverless instances (HOST-4). (MITRE, CWE-488: Exposure of Data Element to Wrong Session, Twelve-Factor App, VI Processes) - 9
SEC-18Never build SQL by concatenating or formatting values into the statement: define the statement's structure in code, bind every value as a query parameter, and map choices of table, column or sort direction to a fixed allowlist of values in code. Parameters can stand only for values, not for identifiers or keywords, and escaping input by hand is error-prone. Platform examples:GO-13,LARAVEL-6andSQLITE-6; for query operators in MongoDB filters, seeMONGO-12. (OWASP SQL Injection Prevention Cheat Sheet, Primary defenses) - 9
SEC-20Never expose databases, caches, message brokers or telemetry collectors to the internet: bind them to private interfaces or networks, let only the hosts that need them through a firewall or security group, and require authentication even inside the network. Apps on users' devices must reach them through an API, never directly, and encrypting the connections isSEC-13. Platform examples:REDIS-10,MONGO-11,AZURE-8,OTEL-10andSUPABASE-13. (OWASP Database Security Cheat Sheet, Protecting the backend database, Configuring secure authentication, OWASP NoSQL Security Cheat Sheet, Network and transport security) - 8
SEC-4Log security-relevant events, and keep secrets and sensitive personal data out of logs by removing, masking, hashing or encrypting them. (OWASP Logging Cheat Sheet) - 8
SEC-5Give each application and service its own identity, with only the permissions it needs, on every system it connects to, and never let it use a shared, default or administrator account. The platform files name each system's mechanism, for examplePG-13,KAFKA-14,RABBITMQ-11,REDIS-11,K8S-8andGCP-5. (OWASP Microservices Security Cheat Sheet, OWASP ASVS 5.0, V13 Configuration) - 8
SEC-6Ship secure defaults so customers don't have to harden the product themselves. (CISA Secure by Design) - 8
SEC-13Encrypt every network connection with TLS, including internal connections to databases, caches, message brokers and telemetry collectors, and make clients verify the server's certificate. Being inside your network isn't a reason to trust a connection (SEC-7). Platform examples:PG-14,RABBITMQ-12,REDIS-11,KAFKA-14andOTEL-10. (OWASP ASVS 5.0, V12 Secure Communication, NIST SP 800-207, Zero Trust Architecture) - 8
SEC-14Authenticate workloads and pipelines with short-lived credentials issued for their identity, such as cloud managed identities or OpenID Connect workload identity federation, instead of long-lived keys or stored secrets. Platform examples:AWS-1,AZURE-5,GCP-4,GHA-5,GITLAB-3andTF-2. (OWASP Top 10 CI/CD Security Risks, CICD-SEC-6, OWASP ASVS 5.0, V13 Configuration) - 8
SEC-15Pin every dependency, including packages, base images, CI actions and infrastructure modules, to an immutable version, such as a lock file with hashes, an image digest or a commit SHA, install exactly what is pinned, and let a bot propose updates. Version tags can be moved to point to different code. Platform examples:NODE-4,PY-2,DOCKER-3,K8S-5,GHA-2,GITLAB-1andTF-10. (OWASP Software Supply Chain Security Cheat Sheet, OpenSSF Scorecard, Pinned-Dependencies) - 8
SEC-16Separate production from non-production, and workloads from each other, with their own accounts or projects, credentials and data stores. Platform examples:AWS-2,AZURE-1,GCP-1,HOST-9andTF-5. (NIST SP 800-218, Secure Software Development Framework, OWASP Top 10 CI/CD Security Risks, CICD-SEC-6) - 8
SEC-17Run only releases of runtimes, frameworks, databases and other platform software that still receive security fixes, apply their patch releases promptly, and plan each upgrade before the end-of-life date. Platform examples:NODE-5,PY-1,PG-16,RABBITMQ-14andMOBGAME-5. (OWASP Top 10:2025, A03 Software Supply Chain Failures, NCSC, Obsolete products) - 7
SEC-7Don't grant implicit trust based on network location. Authenticate and authorise every access (zero trust). (NIST SP 800-207, Zero Trust Architecture) - 7
SEC-8Protect the software supply chain with build provenance and continuous dependency health checks. (SLSA, OpenSSF Scorecard) - 6
SEC-9Use STRIDE to enumerate threats per component, data flow and trust boundary. (Microsoft, Threat Modeling Tool threats (STRIDE), OWASP Threat Modeling Cheat Sheet)
How to enforce¶
Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.
- 7 GitHub secret scanning push protection: blocks pushes that contain hardcoded credentials before they reach the repository. Checks
SEC-2. - 6 Gitleaks: detects passwords, API keys and tokens in git repositories and files, as a pre-commit hook or GitHub Action. Checks
SEC-2. - 6 OpenSSF Scorecard checks: run as a GitHub Action; they score dependency-update tooling, known vulnerabilities, and signed releases with SLSA provenance. Partly checks
SEC-8. - 6 Dependabot alerts and version updates: alert on vulnerable dependencies and keep them up to date. Partly checks
SEC-8. - 6 GitHub artifact attestations: signed build provenance for your artifacts, verifiable with
gh attestation verify. Partly checksSEC-8. - 6 CodeQL, clear-text logging of sensitive data (JavaScript): code-scanning queries that flag sensitive data written to logs. Partly checks
SEC-4.
Tutorials and further reading¶
- 9 OWASP Top 10 for LLM Applications: see also AI systems.