Security programmes that pour their budget into shift-left tooling end up with clean pull requests and no idea what is happening in production, while programmes that lean on runtime detection keep catching the same preventable flaw every release. Shift-left security means finding and fixing problems before software ships: threat modelling, code and dependency scanning, secret scanning, infrastructure as code checks and pipeline gates. Runtime security means watching and protecting what is actually running: workload sensors, cloud threat detection, posture scanning of live resources, web application firewalls and incident response. This guide compares the two at programme level across the whole lifecycle: which classes of issue each one finds, how runtime evidence should drive what developers fix first, developer friction, how to split budget and ownership, and an operating model that joins both. It is for heads of application security, platform and cloud security leads, and CISOs deciding where the next pound goes. For the narrower container question, see Container Image Scanning vs Runtime Threat Detection; this page does not repeat it. Where cloud provider services are named as examples, they are listed alphabetically; order is not a ranking.
Key takeaways
- The short answer is prevention cost versus ground truth. Shift-left is the cheapest place to fix a defect you can see in code; runtime is the only place you can see what attackers actually do, what is reachable and what changed outside the pipeline.
- Each one is structurally blind to part of the problem. Shift-left cannot see console changes, zero-days in shipped code, stolen credentials in use or behaviour; runtime cannot fix anything durably, because the source of most findings is a repository.
- Runtime evidence should set the shift-left backlog. Whether a vulnerable package is loaded, exposed to the internet and listed in the CISA KEV catalogue matters more than its CVSS score, and only runtime telemetry tells you the first two.
- Developer friction is the hidden cost of shift-left. A gate that blocks on noisy findings teaches teams to bypass it; block only on high-confidence, high-impact rules and send the rest to the backlog with context.
- Fund and own them as one loop, not two silos. Every runtime incident should produce a preventive control, and every preventive control should be measured against what runtime still sees.
What each approach covers
- Shift-left (build time): security requirements and threat modelling at design, static analysis (SAST), software composition analysis, secret scanning and push protection, infrastructure as code scanning, container image scanning, build provenance and signing, and pipeline policy gates. NIST SP 800-218, the Secure Software Development Framework (SSDF) v1.1, is the reference practice set: Prepare the Organization (PO), Protect the Software (PS), Produce Well-Secured Software (PW) and Respond to Vulnerabilities (RV).
- Deploy time (the hinge): admission control and policy enforcement at the moment of creation, such as Kubernetes Pod Security Admission with its Privileged, Baseline and Restricted standards in enforce, audit or warn mode, cloud policy deny effects and signature verification. This is shift-left logic applied at the last point before something runs.
- Runtime (shield right): workload and host sensors that watch processes, files and network connections, cloud threat detection on control plane logs, posture scanning of deployed resources, web application firewalls and RASP, identity threat detection on machine credentials, and the incident response that follows. OWASP SAMM v2.0 calls this the Operations function: Incident Management, Environment Management and Operational Management.
Side-by-side comparison
| Dimension | Shift-left security | Runtime security |
|---|---|---|
| Object inspected | Designs, source code, dependencies, manifests, images, pipeline config | Running processes, network flows, API calls, live cloud configuration, identity use |
| Question answered | Could this be exploited if shipped? | Is this being exploited, reachable or changed right now? |
| Cost per fix | Lowest: the author is still in context | Highest: incident handling, hotfix, possible notification |
| Typical owner | Development teams with AppSec and platform engineering | Security operations, cloud security, SRE |
| Main failure mode | Noise, bypassed gates, false sense of coverage | Alert fatigue, recurring findings, fixes that the next deploy reverts |
| Coverage limit | Only what is in scanned repositories and pipelines | Only where sensors and log sources are deployed |
| Evidence produced | Findings, SBOMs, provenance attestations | Detections, telemetry, incident timelines, exploitation proof |
| Framework anchor | NIST SSDF (SP 800-218), SP 800-53 SA-11 and SA-15 | NIST CSF 2.0 DE.CM-09, SP 800-53 SI-4 |
Classes of issue: who finds what
The useful comparison is not tool against tool but issue class against detection point. Some classes are only visible on one side.
| Issue class | Shift-left | Runtime | Who should own the fix |
|---|---|---|---|
| Hardcoded secrets in code or IaC (T1552.001) | Strong: secret scanning and push protection block before commit lands | Partial: sees the credential being used, often from an unexpected place | Developer removes it; credential owner rotates it |
| Known vulnerable dependency | Strong: SCA and image scanning list it | Adds whether the package is loaded, exposed and exploited | Service team, prioritised by runtime context |
| Insecure code pattern (injection, broken access control) | Moderate: SAST and code review, with false positives | Sees exploitation attempts (T1190), WAF and RASP can block | Service team; runtime control is a stopgap |
| Cloud and cluster misconfiguration | Strong for resources defined in code | Only source for console changes, defaults and unmanaged resources | Fix in code if code-origin; otherwise resource owner |
| Configuration drift | Blind | Strong: compares live state with declared intent | Platform team reconciles to code |
| Zero-day in shipped code or a dependency | Blind until a CVE exists | Behavioural detection may catch exploitation | SOC contains, service team patches |
| Supply chain tampering in build (T1195.002) | Moderate: provenance, signing, pinned dependencies | Sees anomalous behaviour of the tampered component | Platform and release engineering |
| Stolen machine credentials in use (T1078.004) | Blind | Strong: anomalous API calls, new source locations | Identity owner revokes; SOC investigates |
| Container escape and cryptomining (T1611, T1496) | Reduces likelihood via hardening rules | Detects the behaviour | SOC contains; platform hardens baseline |
| Design flaw (missing authorisation model) | Only threat modelling finds it cheaply | Visible only once abused | Architecture and product owner |
The pattern is clear: shift-left owns what is written down, runtime owns what happens. The Capital One case is a useful reminder of the runtime half: a misconfigured firewall exposed the temporary credentials of a cloud role that could read far more data than it needed, and the bulk reads went unalerted until an outside report months later. See the Capital One Breach 2019. The Toyota T-Connect case shows the other half: a data server access key sat in a public repository for almost five years, exactly the class of issue that push protection and repository secret scanning exist to stop. See the Toyota T-Connect Key Exposure 2022.
Threat model and architecture in words
Shift-left
- Threat model: defects introduced by your own teams and your dependencies: vulnerable code, unsafe defaults in templates, leaked secrets, unpinned or malicious packages, and pipeline abuse such as poisoned pipeline execution (OWASP CICD-SEC-4) and insufficient credential hygiene (CICD-SEC-6).
- Architecture: scanners run in the IDE, on pull requests and in the pipeline; results flow into the code host and a findings platform (often ASPM); policy decides which findings block a merge or deploy; provenance and SBOMs are attached to artefacts; admission control verifies them before scheduling.
- Failure modes: scanners not attached to every repository; gates in warn mode forever; bypasses accepted without review; scanning source but not the rendered plan or final image; findings with no owner.
Runtime
- Threat model: active attackers exploiting whatever reached production, stolen credentials, insiders, changes made outside the pipeline and zero-days nobody could scan for.
- Architecture: sensors on hosts and nodes (for example eBPF or kernel-level collection), cloud audit and flow logs, posture scanners reading provider APIs, WAF and RASP in the request path, all feeding a SIEM or XDR with response playbooks. Native examples, alphabetically: Amazon GuardDuty Runtime Monitoring uses a security agent observing file access, process execution, command-line arguments and network connections on Amazon EKS, Amazon ECS on AWS Fargate and Amazon EC2; Google Cloud Container Threat Detection watches Container-Optimized OS nodes on GKE and writes findings to Security Command Center; Microsoft Defender for Containers combines a sensor with agentless coverage based on Kubernetes audit logs. Falco, a graduated CNCF project, does similar syscall-based detection with YAML rules.
- Failure modes: sensors missing from part of the estate; default rules never tuned; alerts with no route back to the owning team; console fixes that the next deploy overwrites; no telemetry retained long enough to investigate.
Runtime evidence for prioritisation
The most valuable link between the two is using runtime facts to rank build-time findings. A typical service carries hundreds of open dependency findings; most are in packages never loaded or on services that are not reachable. Rank them with signals that only production can supply:
- Is the vulnerable component actually loaded? Runtime sensors and agentless scanners of running containers can show which packages execute. Unloaded findings drop down the queue, not off it.
- Is the workload exposed? Internet-facing ingress, a public load balancer or a public bucket raises priority sharply.
- Is it being exploited anywhere? Check the CISA KEV Catalogue for confirmed exploitation and FIRST's EPSS for the probability, from 0 to 1, that a CVE will be exploited in the next 30 days. See the EPSS Guide.
- What identity does the workload hold? A vulnerable service with a broad cloud role is a far bigger risk than the same flaw with no credentials. This is where non-human identity scope becomes a prioritisation input.
- Is there runtime evidence of attack? WAF hits, detections or anomalous calls against that service move its findings to the top.
Feed these signals back into the findings platform so the developer sees one ranked list. The method is covered in depth in the Vulnerability Prioritisation Guide; the programme point is that runtime tooling earns part of its budget by shrinking the shift-left backlog.
Developer friction and how to manage it
Shift-left only works if developers accept it. Friction comes from noise, latency and unclear ownership, and each has a specific remedy.
- Block narrowly: fail builds only on high-confidence, high-impact rules: verified live secrets, critical KEV-listed vulnerabilities in reachable code, public storage, privileged containers. Everything else is reported, not blocked.
- Make bypass visible, not impossible: GitHub push protection, for example, lets a writer bypass a block with a reason; each bypass creates an alert, an audit log entry and a notification, and delegated bypass can restrict who may approve. Review bypass reasons monthly.
- Keep scans fast: incremental pull request scans with full scans on a schedule keep feedback within the review cycle.
- Use audit before enforce: start admission policies in audit and warn mode, measure violations, fix the paved path, then enforce. Pod Security Admission supports all three modes per namespace for this reason.
- Fix the template, not the instance: secure base images, hardened modules and pipeline templates remove whole classes of findings at once.
- Close the loop with champions: a security champions programme gives each team a named person who triages and tunes.
Budget split and ownership model
There is no correct percentage split; it depends on how much of your estate is built by you and how much is bought, inherited or changed by hand. Use these drivers to decide where the next investment goes.
| Situation | Weight towards | Why |
|---|---|---|
| Most production is built in-house through pipelines and IaC | Shift-left, with runtime for detection and drift | Most issues have a code origin you control |
| Large share of bought software, legacy or console-managed cloud | Runtime first | There is little code to scan; behaviour and configuration are what you can see |
| No runtime visibility at all | Runtime baseline before more scanners | You cannot detect exploitation, stolen credentials or zero-days |
| Runtime alerts keep recurring on the same root cause | Shift-left for that class | Prevention is now cheaper than repeated response |
| Small team, few services | Platform-native controls on both sides | Code host secret scanning and provider runtime detection give broad coverage with little operational load |
| Regulated or high-impact services | Both, with evidence retention | Auditors expect secure development records and monitoring evidence |
Ownership works best as a split of accountability, not of tools:
- Product and service teams own fixing findings in their code and IaC, within agreed service levels.
- Platform engineering owns paved paths: base images, modules, pipeline templates, admission policies.
- Application security owns policy, rule tuning, threat modelling and the prioritisation model.
- Security operations and cloud security own runtime detection, response and the handover of root causes to the owning team.
- The CISO owns one combined budget line and one set of metrics, so neither side is funded by starving the other.
A programme model that combines both
- Inventory first: list services, repositories, pipelines, clusters and cloud accounts, each with an owner. Every later control depends on mapping a finding to a team.
- Baseline runtime visibility: turn on provider threat detection and posture scanning in every account and cluster; deploy workload sensors to production first. This gives you ground truth before you decide what to prevent.
- Stop the cheapest high-impact leaks: enable secret scanning and push protection across all repositories, and SCA on every build.
- Add deploy-time guardrails in audit mode: admission control and cloud policy for privileged workloads, public exposure and unsigned images. Measure, fix templates, then enforce. Roll back by switching the policy back to audit.
- Wire runtime context into the backlog: loaded, exposed, exploited and identity scope become ranking fields in the findings platform.
- Run the feedback loop: each confirmed runtime incident or recurring finding gets a root cause label (code, template, drift, unmanaged, rule gap) and, where code or template, a new preventive rule.
- Extend to design: threat model new services and major changes, using runtime incident history to choose which threats to model.
- Review quarterly: compare where issues were found against where they could have been found, and move budget accordingly.
The same loop applies to AI systems, where pre-release evaluation and production monitoring play the two roles; see Pre-Deployment AI Testing vs Runtime Monitoring. For cloud configuration specifically, see IaC Scanning vs Runtime Cloud Scanning, and for build-time scanning scope, Container Image Scanning vs SCA.
Worked scenario
A mid-sized software company runs 120 services on Kubernetes across two clouds. It has SAST and SCA on every pull request, with 9,000 open findings, and no runtime sensors. Developers ignore the scanner output. An internet-facing service is compromised through a deserialisation flaw in a dependency that had been flagged for months among thousands of others; the attacker uses the pod's cloud role to list storage. The company learns of it from its cloud provider's threat detection, enabled only weeks earlier.
The remediation programme: deploy workload sensors to production clusters; join runtime data to the findings platform so each finding shows loaded, exposed, KEV or EPSS, and the workload's role; the backlog that needs action this quarter falls from thousands to a short ranked list. The build gate changes to block only verified secrets and critical, exploited, reachable vulnerabilities, so bypass requests drop. Pod roles are narrowed, and an admission policy blocks pods that request broad roles without an exception. Six months later, the root cause review shows most runtime findings now trace to unmanaged resources rather than code, so the next budget increment goes to drift detection, not another scanner.
Where identity fits
Both halves meet on machine credentials. Shift-left finds secrets written into code, pipelines and images; runtime sees credentials being used, including ones that were never in code. The pipeline itself is an identity problem: CI runners hold tokens that can push to production, and the OWASP Top 10 CI/CD Security Risks list Inadequate Identity and Access Management (CICD-SEC-2) and Insufficient Credential Hygiene (CICD-SEC-6). Replace long-lived pipeline secrets with workload identity federation, scope each workload's role to its job, and alert at runtime on credential use from new locations. See the CI/CD Pipeline Identity Security Guide and Secrets Scanning vs Secrets Management.
Detection and measurement
- Escape rate: share of production incidents and runtime findings whose root cause was detectable by an existing shift-left control. Rising means gates or coverage are failing.
- Preventable recurrence: runtime findings of a class that already has a preventive rule. Should trend to zero.
- Prioritised backlog age: median age of findings that are loaded, exposed and exploited, against the age of the whole backlog.
- Gate bypass rate: bypasses per hundred blocks, and share with a reviewed reason.
- Runtime coverage: percentage of production clusters, hosts and accounts with sensors or threat detection enabled.
- Loop closure time: days from a runtime root cause to a merged preventive rule or template change.
Common failure patterns
- Calling shift-left a complete programme: no runtime detection means stolen credentials, zero-days and console changes go unseen, as in the Capital One case.
- Blocking on everything: noisy gates create bypass culture; teams learn to click through or disable scanners.
- Fixing runtime findings in place: a console fix to a code-defined resource is reverted at the next deploy and the finding returns.
- Two separate backlogs: developers receive build findings and SOC tickets from different systems with different priorities, and work neither.
- Unowned assets: findings with no mapped team age indefinitely on both sides.
- Treating a leaked secret as a code fix: deleting the line does not revoke the credential; rotation must follow.
Framework mapping
| Framework | Shift-left | Runtime |
|---|---|---|
| NIST CSF 2.0 | PR.PS-06 secure software development practices integrated and monitored | DE.CM-09 runtime environments monitored; ID.RA-01 vulnerabilities identified |
| NIST SP 800-53 Rev 5 | SA-8, SA-11, SA-15, CM-3 | SI-4, RA-5, CM-6 |
| NIST SP 800-218 (SSDF) | PO, PS, PW practice groups | RV practice group (respond to vulnerabilities) |
| OWASP SAMM v2.0 | Design, Implementation and Verification functions | Operations function |
| MITRE ATT&CK | Reduces T1552.001, T1195.002 | Detects T1190, T1078.004, T1611, T1496 |
Practitioner checklist
- Map every service, repository, cluster and cloud account to an owning team.
- Enable provider threat detection and posture scanning in all production accounts and clusters.
- Turn on secret scanning and push protection everywhere; rotate every confirmed leaked credential.
- Block builds only on high-confidence, high-impact rules; report the rest with context.
- Run admission and cloud policies in audit mode first, then enforce, with a documented rollback.
- Rank findings by loaded, exposed, KEV or EPSS, and workload identity scope.
- Label every runtime root cause and turn code and template causes into preventive rules.
- Hold one combined budget and one metric set for both halves.
- Review bypasses, escape rate and coverage each quarter.
Standards and references
- NIST: SP 800-218 Secure Software Development Framework (SSDF) Version 1.1
- NIST: SP 800-204D Strategies for the Integration of Software Supply Chain Security in DevSecOps CI/CD Pipelines
- CISA: Secure by Design
- OWASP: Software Assurance Maturity Model (SAMM) v2.0
- OWASP: Top 10 CI/CD Security Risks
- FIRST: Exploit Prediction Scoring System (EPSS)
- Falco: Documentation
- GitHub Docs: About push protection
Related NHI Mgmt Group resources: DevSecOps Guide, Container Runtime Security Guide, ASPM vs CNAPP, Kubernetes Admission Control Guide, Application Security Guide.