Glenn Lum Software Engineering

3.2 Security (DevSecOps)

The traditional model of software security treated it as a final gate: you built the software, you shipped it, and then a security team audited it before (or unfortunately, after) production. This model is too slow, too late, and too disconnected from the development process to be effective. DevSecOps is the philosophy of integrating security practices directly into the development lifecycle, making security a continuous responsibility rather than a periodic event.

The “shift left” principle describes moving security checks earlier in the development process. The cost of remediating a security vulnerability increases dramatically the later it is found. A vulnerability found by a developer in their IDE costs minutes to fix. The same vulnerability found in a security audit after deployment costs days of engineer time, stakeholder communication, and potentially customer trust. The practical implementation of shifting left includes integrating software composition analysis (SCA) tools into your CI pipeline (automatically scanning your dependencies for known vulnerabilities every time you build), integrating static application security testing (SAST) tools that analyze your code for common vulnerability patterns (SQL injection risks, insecure deserialization, hardcoded credentials) without running the code, and educating developers on secure coding practices so that vulnerabilities are less likely to be introduced in the first place.

Supply chain security has become a critical concern in the current era. The attack surface of your application is not limited to the code you write; it extends to every dependency you import, every tool you use in your build process, and every artifact you pull from an external registry. Supply chain attacks work by compromising a widely-used library or build tool, inserting malicious code into it, and waiting for everyone who depends on that library to pull the update and execute the malicious code as part of their own application. Defenses include dependency pinning and lock files (preventing silent updates to newer, potentially compromised versions), cryptographic signature verification of dependencies (verifying that the artifact you downloaded matches a signature created by the author), and Software Bill of Materials (SBOM) generation (producing a machine-readable manifest of every component in your deployed artifact so that if a new vulnerability is discovered, you can immediately determine whether you are affected).

Secret management is the practice of handling credentials, API keys, passwords, and certificates securely. The most common failure mode is hardcoding secrets in application code or configuration files that are stored in version control. Once a secret is committed to a Git repository, it is there forever (in the history), even if you delete it from the current branch. The correct practice is to never allow secrets to touch your codebase at all. Instead, secrets are stored in a dedicated secret management service, injected into your application at runtime (as environment variables or mounted files), and rotated regularly. Access to secrets is controlled and audited: your application can only access the specific secrets it needs (least-privilege access), and every access is logged.

The least-privilege principle applies broadly to your operational architecture. Every service, every user, every automation job should have exactly the permissions it needs to do its job and no more. A service that needs to read from one database should not have write permissions, should not have access to other databases, and should not have administrative permissions of any kind. This principle limits the blast radius of a security breach: if an attacker compromises a service, they gain only the permissions that service held, not administrative access to your entire infrastructure.

Runtime security is the security layer that operates after deployment, when the code is running. Network policies define which services are allowed to communicate with which other services, preventing lateral movement in the event of a compromise (if an attacker compromises your web server, a network policy can prevent them from using it to attack your database directly). Runtime anomaly detection watches for behavior that is unusual for a given service (a web server suddenly making outbound SSH connections, a batch processing job suddenly reading files it has never accessed before) and raises alerts. Compliance as code is the practice of encoding regulatory or organizational security requirements as automated policy checks that run in your CI/CD pipeline and on your running infrastructure, turning security compliance from a periodic manual audit into a continuous automated verification.

← Back to Home