Secure Software Delivery: DevSecOps, Pipeline, and Supply Chain Security Questions
Embedding security into how software is built, assembled from dependencies, and shipped. Covers shift-left and secure-SDLC practices, infrastructure-as-code security, CI/CD pipeline and secrets management, integrating security scanning into build and deploy, and configuration and secret management across environments, together with software supply chain security: software composition analysis (SCA), dependency and open-source vulnerability management, build-provenance and artifact integrity, and mitigating supply-chain attack vectors. The 'secure the delivery pipeline and everything it pulls in' discipline, distinct from vendor-risk governance.
Soon after joining you discover security and compliance gaps such as insecure secrets handling and missing RBAC. Define a set of immediate actions you would take in the first 30 days and a 6 month roadmap to remediate issues across code, CI/CD, and infrastructure, prioritized by risk.
Sample Answer
Discovering real security and compliance gaps (insecure secrets handling, missing RBAC (role-based access control)) shortly after joining a team means the response needs two different time horizons: what stops the bleeding in the next thirty days, and what actually fixes the underlying structure over the next six months, since trying to fix everything at once in week one usually accomplishes neither. The remediation itself spans three distinct surfaces, code, CI/CD, and infrastructure, and a plan that only touches one or two of these will leave a real gap open even after six months of visible progress elsewhere.
First 30 days
Inventory the actual scope of the gap across all three surfaces: which REPOSITORIES have secrets hardcoded directly in source or committed to Git history (the code surface), which PIPELINES have insecure secrets handling (plaintext env vars, secrets injected via unprotected CI variables, the CI/CD surface), and which PRODUCTION systems lack any meaningful RBAC (broad, shared credentials rather than scoped, individual access, the infrastructure surface). Fix the highest-blast-radius items immediately: rotate any secret discovered to be genuinely exposed (in a public repo, in Git history, in a widely-readable log), and add at minimum a basic secret-scanning gate at BOTH the code layer (a pre-commit or pre-merge scan that blocks a new secret from ever being committed) and the pipeline layer (scanning build artifacts and logs), so the same class of leak can't recur on either surface while the deeper fix is still in progress. Establish, even informally, who currently has production access and why, as a first pass at an access inventory, without yet building the full RBAC model.
6-month roadmap, prioritized by risk
Months 1 to 2: migrate the highest-risk secrets (production database credentials, any credential granting broad or irreversible access) to a proper secrets manager, following the staged-migration pattern discussed elsewhere in this topic (advisory rollout, then blocking, low-risk pipelines first); in parallel, add source-code secret-scanning to the standard code-review gate so a new hardcoded secret can no longer merge at all, closing the code-surface gap alongside the pipeline-surface one. Months 2 to 4: design and roll out a genuine RBAC model for production access, replacing shared or overly broad credentials with individually-scoped, role-based access, starting with the systems handling the most sensitive data, the infrastructure-surface fix. Months 4 to 6: extend secrets management and RBAC discipline to the remaining lower-risk systems and repositories, and formalize the practices (documented policy, onboarding process for new services AND new code repositories) so the fix doesn't quietly regress on any of the three surfaces once the initial push loses momentum.
Prioritization principle
Every item in this roadmap is ordered by actual risk (what's exposed, how broadly, and how bad the consequence would be if exploited) rather than by ease of implementation or by which surface, code, CI/CD, or infrastructure, happens to be easiest to fix first, since an easy-but-low-risk fix completed first can create a false sense of progress while the genuinely dangerous gaps, on any surface, remain open.
Trade-offs
Spending the first 30 days on inventory and the highest-blast-radius fixes only, rather than attempting a comprehensive fix immediately across all three surfaces at once, means some real, lower-priority risk stays open longer; that's the deliberate trade of triaging by actual severity, which is the same discipline applied to vulnerability and finding triage discussed throughout this topic, just applied here to a newly-discovered structural gap spanning code, CI/CD, and infrastructure rather than a single scanner finding.
How would you implement an automated process to identify vulnerable container images in your registry, rebuild images with updated dependencies, run tests, and promote safe images to production with minimal human intervention? Describe triggers, pipeline components, safety checks (canaries/tests), signing, and rollback strategies.
Sample Answer
Automating the full loop from 'a vulnerable image is discovered in the registry' to 'a safe image is running in production' means the pipeline itself becomes the remediation mechanism, not just the detection mechanism, with safety checks at every automated step.
Triggers
A scheduled or event-driven rescan of images already sitting in the registry (not just newly-built ones) is what surfaces this scenario in the first place, since the underlying vulnerability may have been disclosed after the image was originally built and passed its build-time scan cleanly.
Pipeline components
flowchart LR
Rescan[Scheduled registry rescan] -->|CRITICAL finding| Rebuild[Trigger rebuild from same source + updated deps]
Rebuild --> Test[Run existing test suite]
Test -->|pass| Canary[Deploy as canary]
Canary -->|healthy| Promote[Promote to full production]
Canary -->|unhealthy| Rollback[Automatic rollback]
Test -->|fail| Manual[Route to manual review]
The rebuild step re-runs the ORIGINAL build from the same source commit but with the vulnerable dependency bumped to a patched version, rather than attempting to patch the already-built image in place, which keeps the provenance chain intact (the new image still has a clean, verifiable build record from source, not an ad hoc binary patch with no clear origin).
Safety checks
Running the existing test suite against the rebuilt image before it goes anywhere is the first safety gate, catching a case where the dependency bump itself introduces a regression. Deploying to a canary slice first, with automated health monitoring, before promoting to full production is the second gate, catching any regression the test suite's coverage might have missed. Signing the rebuilt image the same way any other build is signed keeps this automated path consistent with the rest of the pipeline's provenance guarantees, rather than creating a special, less-verified path for emergency patches.
Minimizing human intervention while keeping it safe
For a routine patch-level dependency bump with a clean test run and a healthy canary, this entire flow can run with zero human intervention, which is the point: at the scale of hundreds of images, waiting for a human to manually approve every routine patch doesn't scale. For anything that fails the test suite, or where the dependency bump is a major version with a real risk of breaking changes, the flow should route to a human review queue rather than forcing the automation to guess at a safe outcome; the earlier discussion of dependency-management-at-scale draws the same line between safe-to-automate and needs-review, and it applies identically here.
Rollback
If the canary shows a regression (elevated error rate, a failed health check), automatic rollback to the last known-good, previously-running image should trigger without waiting for human confirmation, since the whole point of the canary gate is to catch this class of problem fast and revert before it reaches the full production fleet.
Trade-offs
Fully automating this loop for the common case (patch-level bump, passing tests, healthy canary) is what makes remediation fast enough to matter at scale; the residual risk is that the automation could, in principle, promote a rebuilt image with a subtle regression the test suite and canary health checks both fail to catch, which is why the canary stage and its automated rollback exist as the last line of defense rather than treating a passing test suite alone as sufficient confidence to go straight to full production.
Design a policy-as-code enforcement architecture that runs at pre-merge time to evaluate SCA findings, SAST results, and secrets-scanning outputs. Describe how policies are authored, tested, versioned, and enforced (blocking vs advisory), and how you would handle emergency bypasses and audit trails.
Sample Answer
A policy-as-code architecture evaluating SCA, SAST, and secrets findings together, rather than as three independent gates, needs a clear model for how policies are authored, how they're tested before they affect anyone, and how an emergency bypass is possible without becoming a silent, unaudited backdoor.
Architecture
flowchart TB
PR[Pull request] --> Collect[Collect SCA + SAST + secrets findings]
Collect --> Eval[Policy evaluation engine]
Eval -->|blocking violation| Block[Block merge]
Eval -->|advisory violation| Ticket[Open ticket, allow merge]
Eval -->|no violation| Allow[Allow merge]
Block -->|documented exception| Bypass[Emergency bypass, logged + time-boxed]
Authoring, testing, and versioning policies
Policies live in their own version-controlled repository, authored as code and reviewed through the same pull-request process as any other change, with the security team as a required reviewer for changes to the policy logic itself. Every policy change needs its own test suite (does it correctly flag the violation it's meant to catch, and correctly pass the case it's meant to allow) run in CI before the policy change itself can merge, exactly the same discipline applied to the application code the policy governs.
Enforcement: blocking versus advisory
A finding's disposition (block the merge outright, versus allow the merge but open a tracked ticket) is itself a policy decision, not a blanket rule; CRITICAL secrets and CRITICAL, reachable SCA findings default to blocking, while lower-severity or lower-confidence findings across all three categories default to advisory, giving visibility without stopping delivery for findings that don't yet warrant it.
Emergency bypasses and audit trails
An emergency bypass (letting a genuinely time-critical fix merge despite a blocking policy violation) needs to require an explicit, logged action from an authorized approver, be automatically time-boxed (the bypass itself expires, and the underlying violation must still be resolved by a defined deadline), and generate its own audit entry distinct from a normal merge, so a security review can later see exactly which merges bypassed policy, when, why, and whether the underlying issue was subsequently fixed as promised.
Handling emergency bypasses becoming routine
Track the RATE of emergency bypasses as its own metric; a bypass mechanism that's used rarely, for genuine emergencies, is healthy, while one used routinely is a signal that either the policy thresholds are miscalibrated (too strict for real development velocity) or the team has started treating the bypass as a normal path around the gate rather than an exception, either of which needs to be addressed at the policy level, not by simply tightening the bypass approval process further.
Trade-offs
Requiring a full test suite for every policy change adds friction to updating the policy itself, which could tempt someone to skip testing 'just this once' for an urgent policy fix; that temptation is exactly why the same PR-and-CI discipline applied to application code should apply here without exception, since an untested policy change risks either blocking legitimate work with a bug in the policy logic, or, worse, silently failing to catch what it was supposed to catch.
A popular third-party CI plugin requests admin-level access to your GitHub organization to function. Describe how you would evaluate the risk, what alternatives you might propose to avoid granting admin rights, what compensating controls you could implement if approval is necessary, and how you would monitor and audit the plugin's behavior post-deployment.
Sample Answer
A third-party CI plugin requesting admin-level access to the GitHub organization is a materially higher-stakes request than a single Action requesting a specific secret, since admin access can reach far more than whatever the plugin's stated function needs, including the ability to modify branch protection, other integrations, and organization membership itself.
Evaluating the risk
Start from the assumption that 'requires admin to function' is often a convenience choice by the plugin vendor, not a genuine technical necessity; investigate specifically WHY the plugin needs admin rather than a narrower set of scoped permissions (repository-level access, or a specific fine-grained permission like 'read pull requests' rather than organization-wide admin), since many integrations request broad access simply because it's the path of least resistance for the vendor to build against, not because their actual function requires it.
Alternatives to avoid granting admin rights
Check whether the plugin supports GitHub's fine-grained personal access tokens or a GitHub App with narrowly-scoped permissions as an alternative to the broad, legacy organization-admin-level integration path; many modern integrations do support a scoped alternative even when their default documentation suggests the broader option. If a scoped alternative genuinely doesn't exist, consider whether the plugin's function could be achieved a different way (a first-party integration, or a narrower internally-built equivalent) before accepting the broad access as the only option.
Compensating controls if approval is necessary
If admin access genuinely can't be avoided, isolate the blast radius: install the plugin under a dedicated, closely-monitored service account rather than granting the access to a human's own account, so the access is auditable and can be revoked without affecting a real person's other access. Require the plugin's installation itself to go through the same change-review process as a production infrastructure change, given the scope of what it can affect. Set up specific alerting on the actions this plugin's service account takes (any unexpected repository or membership change originating from it), rather than relying on the organization's general audit log alone, which a security team may not review frequently enough to catch a subtle abuse in a timely way.
Ongoing monitoring
Review the plugin's actual usage and behavior periodically (not just at initial approval) against what it was approved for, and treat any deviation (the plugin starting to touch resources it previously didn't) as a trigger for re-review, since a legitimate plugin today doesn't guarantee the same trust tomorrow, particularly if it changes ownership or is later found to have been compromised upstream.
Trade-offs
Insisting on a scoped alternative, or building specific monitoring and change-review overhead around an unavoidable broad-access plugin, is more work than simply granting the requested admin access and moving on; that additional work is the direct, proportionate response to the fact that organization-admin access is one of the highest-blast-radius grants an organization can make to any third party, and the cost of that additional diligence is small relative to the cost of an abused or compromised admin-level integration.
A popular third-party GitHub Action used across your org requests 'secrets' access. Evaluate the security risks of allowing third-party actions access to organization secrets and propose at least five mitigations or alternatives to reduce risk while maintaining developer productivity.
Sample Answer
A popular third-party GitHub Action requesting secrets access is exactly the kind of dependency risk that's easy to underweight, because it doesn't look like a typical software dependency: it's a workflow-level integration, but it can read anything the workflow's permission scope exposes to it.
Evaluating the risk
The core question is: what could this Action's code (or a future, compromised version of it) do with the secrets it's requesting access to, given that once granted, the Action runs with the SAME access the rest of the workflow step has. Check the Action's maintenance history (is it actively maintained by a reputable source, or a single-maintainer project with irregular updates), and check exactly which secrets it's requesting versus which secrets it actually needs for its stated function, since an Action requesting broader access than its function requires is itself a signal worth investigating.
Mitigations
- Pin the Action to an immutable commit SHA, not a mutable version tag, so an upstream compromise (a malicious update pushed to the same tag you trust) can't silently affect your workflows without you explicitly updating the pin.
- Scope the secrets available to the specific workflow step running this Action as narrowly as possible, using a job-level or step-level permission scope rather than exposing every organization secret to every step in the workflow by default.
- Run the Action in a workflow with restricted network egress, if your CI platform supports it, so even if the Action's code is malicious or compromised, its ability to exfiltrate whatever it reads is constrained.
- Prefer a first-party or well-audited alternative if one exists that accomplishes the same function without needing broad secrets access at all.
- Monitor the Action's actual behavior post-adoption (what network destinations does it reach, does its resource usage or runtime pattern change unexpectedly after an update) rather than treating the initial adoption review as a one-time, permanent clearance.
Balancing risk against developer productivity
The honest tension here is that a popular Action is popular because it saves real engineering time; banning all third-party Actions outright trades away that productivity for a security posture stronger than most organizations actually need. The mitigations above (pinning, scoping, monitoring) aim to preserve most of the productivity benefit while closing the specific, well-documented attack surface (a compromised or malicious Action silently exfiltrating whatever secrets it can reach) rather than treating 'no third-party Actions' as the only safe answer.
Trade-offs
Pinning to a commit SHA specifically trades away the convenience of automatically picking up the Action's latest release, requiring a deliberate, periodic review to bump the pin; that overhead is the direct, proportionate cost of closing the exact vulnerability class (a moving tag silently repointing to malicious code) that this whole evaluation exists to guard against.
Unlock Full Question Bank
Get access to all Secure Software Delivery: DevSecOps, Pipeline, and Supply Chain Security interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.