Skip to content

DevSecOps Engineer interview questions

100 real questions with model answers and explanations for Junior candidates.

See a DevSecOps Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

In a common operating model, a DevSecOps engineer maintains shared security controls in the delivery path, but exact ownership depends on the organization.

  • The role often integrates and enforces agreed controls for CI/CD workflows, runner access, secrets use, dependency checks, and artifact integrity.
  • Product developers remain responsible for code fixes, while AppSec or another security team may own scanner rules and risk decisions.
  • A junior usually maintains a bounded workflow or scanner integration under review rather than setting company-wide policy.

Why interviewers ask this: The interviewer checks whether you can describe a common role boundary without presenting one ownership model as universal.

generics

DevOps focuses on reliable delivery, while DevSecOps adds explicit ownership of security controls within that delivery path.

  • A DevOps task might make a GitLab CI deployment faster and repeatable.
  • A DevSecOps task limits the job token, scans the artifact, and verifies approval before that deployment.
  • The two roles overlap in pipeline mechanics, but security risk reduction is a required outcome for DevSecOps.

Why interviewers ask this: The interviewer is evaluating whether you distinguish secure delivery ownership from general automation and reliability work.

DevSecOps often focuses on shared delivery controls, while application security focuses more directly on risks in product design and code.

  • AppSec may own threat models, code guidance, scanner platforms, or the rules those scanners apply.
  • DevSecOps may integrate scanner results into GitHub Actions or GitLab CI, keep the checks reliable, and enforce controls agreed with AppSec and delivery teams.
  • Product developers fix the affected code, and each organization should document where tool, policy, and remediation ownership sits.

Why interviewers ask this: The interviewer checks whether you distinguish the disciplines without claiming that either team always owns every scanner or delivery control.

cloud-security

DevSecOps centers on the software delivery path, while cloud security engineering centers on protecting cloud accounts, services, and configurations.

  • A cloud security engineer may define network boundaries or organization-wide cloud access controls.
  • A DevSecOps engineer restricts pipeline credentials and verifies the container before a cloud deployment.
  • DevSecOps needs enough cloud knowledge to integrate safely, but routine cloud IAM administration is not the whole role.

Why interviewers ask this: The interviewer wants a clear boundary between delivery-platform security and broad cloud administration.

secure-sdlc

A secure SDLC places appropriate security checks and evidence throughout planning, building, testing, and release.

  • Source changes pass review and automated checks before they can reach a protected branch.
  • Builds scan dependencies and secrets, then preserve results alongside the exact artifact.
  • Release controls verify approvals and artifact identity instead of trusting that an earlier stage probably passed.

Why interviewers ask this: The interviewer checks whether you understand secure delivery as a sequence of controls rather than one final scan.

shift-left

Shift-left means giving developers useful security feedback earlier, not moving every security responsibility onto them.

  • A pull-request SCA check can flag a vulnerable dependency before it enters the default branch.
  • Early checks should be fast and actionable, while slower DAST can still run against a deployed test environment.
  • Runtime controls and release verification remain necessary because source-time checks cannot prove production safety.

Why interviewers ask this: The interviewer is testing whether you understand both the benefit and the limits of early security checks.

guardrailssecurity-guardrails

A guardrail changes the delivery path automatically, while a report only informs someone that a risk exists.

  • A GitHub Actions rule that rejects an unpinned third-party action prevents a risky change from merging.
  • OpenSSF Scorecard can identify risky repository practices, but its output becomes a guardrail only when a clear rule consumes it.
  • Good guardrails explain the failure and the fix so teams do not bypass them out of confusion.

Why interviewers ask this: The interviewer checks whether you connect security findings to enforceable and usable platform behavior.

A junior DevSecOps engineer should safely operate and improve a bounded control with clear escalation paths.

  • Typical work includes updating a Trivy job, reviewing scan output, or reducing permissions in one CI template.
  • Changes should be tested on a sample repository and reviewed before becoming a required gate.
  • Ambiguous suppressions, broken releases, and requests for broader credentials should be escalated rather than guessed through.

Why interviewers ask this: The interviewer evaluates practical junior ownership, testing discipline, and awareness of escalation boundaries.

ci-cdpipelinestrust-boundaries

A trust boundary is a point where code or data moves between components with different levels of control.

  • A pull request from a fork is less trusted than code already reviewed on a protected branch.
  • A runner receiving a deployment token crosses from build logic into privileged infrastructure access.
  • Each crossing should have explicit authentication, minimal permissions, and validation of the input or artifact.

Why interviewers ask this: The interviewer checks whether you can identify where pipeline assumptions must become explicit controls.

ci-cdgithub-actions

GitLab CI has explicit stages, while GitHub Actions has jobs ordered through needs and no stage primitive.

  • GitLab jobs are assigned to stages, later stages normally wait for earlier ones, and jobs in one stage can run in parallel.
  • In GitHub Actions, jobs without dependencies can run in parallel, while needs declares which successful jobs a later job depends on.
  • In either system, separate scan, build, and deploy jobs make credentials, outputs, and failure conditions easier to review.

Why interviewers ask this: The interviewer evaluates whether you can model pipeline ordering without inventing GitHub Actions stages.

ci-cdpipelines

Separate jobs reduce how much untrusted code and sensitive data share the same execution context.

  • A pull-request test job should not inherit the production deployment secret.
  • A signing job can accept a digest rather than rebuild or execute repository code again.
  • Job-level permissions make it clear which step may write packages, request OIDC tokens, or deploy.

Why interviewers ask this: The interviewer checks whether you use job boundaries to reduce credential exposure and unintended coupling.

artifacts

CI artifacts cross job and time boundaries, so their producer, contents, and retention must be controlled.

  • A later job must not trust an artifact uploaded by an untrusted workflow without checking its source and integrity.
  • Logs, test reports, and archives can accidentally contain tokens or private source files.
  • Short retention, restricted download access, and a digest tied to the build reduce exposure and substitution risk.

Why interviewers ask this: The interviewer evaluates whether you see artifacts as security-sensitive inputs rather than harmless files.

ci-runners

Hosted runners are usually ephemeral and provider-managed, while self-hosted runners give more control but retain more risk.

  • A fresh GitHub-hosted runner limits persistence between jobs and reduces cleanup work.
  • A self-hosted runner may expose internal networks, cached credentials, or files left by a previous job.
  • Untrusted pull requests should not run on a privileged self-hosted runner unless strong isolation is in place.

Why interviewers ask this: The interviewer checks whether you understand runner persistence and network access as parts of the trust model.

code-review

Fork pull requests contain contributor-controlled code that may try to read secrets or alter the workflow.

  • Standard pull-request jobs should run with read-only permissions and no deployment credentials.
  • A trigger that uses trusted base-branch context must not execute the fork's code with elevated access.
  • Privileged packaging or deployment should wait for review and run from a protected branch or environment.

Why interviewers ask this: The interviewer is testing whether you recognize untrusted code execution before credentials are exposed.

least-privilegeaccess-control

Set the GITHUB_TOKEN to read-only by default and grant each job only the permissions it needs.

  • A test job usually needs repository contents read access but no package or deployment write access.
  • A publishing job may receive packages write access only after tests pass on a trusted branch.
  • Request id-token write only in the job that actually performs an OIDC exchange.

Why interviewers ask this: The interviewer checks whether you can translate least privilege into concrete GitHub Actions permissions.

tokens

A GitLab CI job token is a temporary credential whose project access should be restricted to the current job's purpose.

  • Prefer the job token over a personal access token when the target service supports it.
  • Limit which projects may use or accept the token instead of assuming all internal repositories are trusted.
  • Do not save the token in artifacts, caches, command output, or files that survive the job.

Why interviewers ask this: The interviewer evaluates whether you understand that temporary credentials still require scope and handling controls.

Protected branches make changes pass defined review and status checks before entering trusted release history.

  • Direct pushes can be blocked so one compromised developer credential cannot silently skip review.
  • Required CI checks can enforce tests and scans on the exact commit being merged.
  • Restricting force pushes preserves the reviewed commit history used by later build and provenance steps.

Why interviewers ask this: The interviewer checks whether you connect branch protection to the integrity of downstream builds.

Protected environments control when a trusted commit may receive deployment access to a sensitive target.

  • GitHub Actions environments can require reviewers before releasing environment secrets to a job.
  • GitLab protected environments can restrict which branches, tags, or users may deploy.
  • The deployment job should reference the reviewed artifact instead of rebuilding different content after approval.

Why interviewers ask this: The interviewer evaluates whether you separate source approval from authorization to deploy.

saststatic-analysis

Static application security testing analyzes source code or compiled representations without running the application.

  • It can trace suspicious data flow, unsafe API use, or language-specific coding patterns.
  • It fits pull-request or build jobs because it does not require a deployed target.
  • A SAST result is a lead to review, not proof that an issue is exploitable in the deployed system.

Why interviewers ask this: The interviewer checks whether you know SAST's input, pipeline position, and evidentiary limit.

saststatic-analysis

SAST should give early feedback on changed code and run a complete check before trusted code is released.

  • A fast pull-request scan keeps feedback close to the developer's change.
  • A default-branch scan can cover the full repository with the production build configuration.
  • SAST may miss runtime configuration, deployed authentication behavior, and paths it cannot model accurately.

Why interviewers ask this: The interviewer evaluates whether you can place SAST usefully without claiming complete coverage.

Locked questions

  • 21

    What is DAST and what does it test?

    dastdynamic-analysis
  • 22

    Why is DAST usually not the first pull-request check?

    dastdynamic-analysis
  • 23

    What is software composition analysis?

    scaoop
  • 24

    What does a secrets scanner look for?

    secretssecret-scanning
  • 25

    Why run secrets scanning both before commit and in CI?

    secrets
  • 26

    What can Trivy scan in a junior DevSecOps workflow?

    trivy
  • 27

    How do Grype and OSV-Scanner differ in a basic pipeline?

    ci-cdpipelinesosv-scanner
  • 28

    Why does passing several security scanners not prove a release is secure?

  • 29

    What is the difference between a direct and a transitive dependency?

    dependencies
  • 30

    Why are lockfiles important for dependency vulnerability scanning?

    dependenciespackagingdependency-locking
  • 31

    What does a CVSS score tell you about a dependency vulnerability?

    vulnerabilitiesvuln-managementdependencies
  • 32

    How does exploitability differ from vulnerability severity?

    vulnerabilitiesattacksexploitability
  • 33

    What does reachability mean for a vulnerable dependency?

    vulnerabilitiesdependencies
  • 34

    What makes a safe allowlist entry for a dependency finding?

    dependencies
  • 35

    What is the preferred remediation for a vulnerable dependency?

    vulnerabilitiesdependencies
  • 36

    What evidence shows that a dependency vulnerability was remediated?

    vulnerabilitiesdependencies
  • 37

    What counts as a secret in a CI/CD system?

    ci-cdsecretssystem-design
  • 38

    What are the basic HashiCorp Vault concepts a junior should know?

    secrets
  • 39

    What is a dynamic secret in Vault?

    secretsdynamic-secrets
  • 40

    Why prefer OIDC federation over long-lived CI credentials?

    identity-accessworkload-identity
  • 41

    How should a secret be delivered to a CI job?

    secrets
  • 42

    What does rotating a CI secret require?

    secrets
  • 43

    Why is CI log masking not sufficient protection for secrets?

    secrets
  • 44

    What is an SBOM?

    supply-chainsoftware-inventory
  • 45

    How is an SBOM different from a vulnerability scan?

    vulnerabilitiessupply-chainsoftware-inventory
  • 46

    What does a cosign signature prove about a container image?

    containerscontainer-images
  • 47

    How is build provenance different from a signature?

    provenance
  • 48

    Why deploy a container image by digest instead of by tag?

    containersdeploymentcontainer-images
  • 49

    Why should a container run as a non-root user?

    containers
  • 50

    What basic image and layer hygiene improves container security?

    containers
  • 51

    You find 18 third-party actions referenced by tags across 6 GitHub repositories. How would you harden them?

    dependencies
  • 52

    A 9-job GitHub Actions workflow grants contents: write and packages: write to every job, although only 1 job publishes. What would you change?

    ci-cdgithub-actions
  • 53

    A fork pull request needs tests in a 14-minute workflow, but the tests currently read 2 cloud secrets. How would you run it safely?

    secretscloud-securitycode-review
  • 54

    A pull_request_target workflow checks out the contributor's head commit and runs npm test with a write token in 3 repositories. What is the risk and fix?

    tokensrisk-managementnpm
  • 55

    Four repositories deploy to production immediately after merge, using 1 shared deployment secret. How would protected environments reduce the risk?

    secretsrisk-managementdeployment
  • 56

    A self-hosted runner processes 30 builds per day and leaves Docker containers, workspaces, and cloud files behind. What would you change first?

    dockercontainersci-cd
  • 57

    A GitLab test job uploads a 120 MB artifact containing logs, .env, and test reports for 30 days. How would you harden artifact handling?

    ab-testingartifacts
  • 58

    6 GitLab projects expose a protected registry variable to a merge request pipeline that can run contributor scripts. What would you change?

    ci-cdregistriespipelines
  • 59

    Dependabot proposes changing 7 pinned action SHAs in one pull request. What checks would you perform before merging it?

    code-review
  • 60

    A workflow passes a pull request title directly into a Bash command, and 2 fork tests behave unexpectedly. How would you fix it?

    code-reviewtesting
  • 61

    You need to add Semgrep SAST to 6 repositories without making every 12-minute pull request wait on a full scan. Where would you place it?

    code-reviewsaststatic-analysis
  • 62

    A small API has 12 staging endpoints and deploys in 18 minutes. How would you add a basic OWASP ZAP DAST check?

    owaspdastendpoints
  • 63

    OSV-Scanner finds 4 vulnerable packages in a 2-service repository during dependency installation. How would you make the result actionable?

    dependenciesosv-scannervulnerabilities
  • 64

    Three repositories have each leaked 1 test token in recent commits. How would you wire secret scanning into their workflow?

    secretstokens
  • 65

    The first SAST run reports 12 existing findings in a 9,000-line service, but the team needs a required gate this week. How would you baseline it?

    saststatic-analysis
  • 66

    A 5-developer team maintains 2 services and receives 20 scanner alerts on its first week. What small-repository gate would you propose?

    alerting
  • 67

    A secret scanner sometimes hangs for 8 minutes and pushes a 20-minute pipeline past its timeout. How would you handle it?

    ci-cdpipelinessecrets
  • 68

    Semgrep flags 7 uses of a safe internal wrapper as SQL injection in one repository. How would you handle the false positives?

    injectionweb-attacksdetection-tuning
  • 69

    A pipeline finds 5 high-severity issues, but its evidence disappears after the job and developers cannot reproduce them. What would you upload?

    debuggingseverity-priorityci-cd
  • 70

    A nightly scan opens 9 duplicate findings across 3 repositories with no assignees. How would you create useful tickets?

  • 71

    A CI job printed 1 production API token into a public log 6 minutes ago. What are your first actions?

    tokensapi
  • 72

    A developer deletes an AWS key from the latest commit after it was visible for 2 hours. Is that enough, and what would you do?

  • 73

    One leaked registry password appears in 3 job logs, 2 artifacts, and a shared runner cache. How would you scrub the copies?

    artifactsregistriespasswords
  • 74

    A leaked package token is configured in 6 repositories, but only 2 should publish. How would you reduce its scope during rotation?

    tokensconfig
  • 75

    A GitHub Actions job in 4 repositories stores a long-lived Vault token with a 30-day lifetime. What basic replacement would you implement?

    tokenssecretsci-cd
  • 76

    A 12-minute deployment needs 1 database password from Vault, but the current script writes it to workspace/db.env. How would you inject it?

    passwordssecretsdatabase
  • 77

    A Vault token with a 10-minute TTL expires during a 20-minute image build. Would you make it a 24-hour token?

    tokenssecrets
  • 78

    After rotating 1 leaked CI secret used by 3 services, how would you verify containment before closing the incident?

    secretsincident-responseincidents
  • 79

    Trivy flags that a 180 MB application image runs as root. What Dockerfile changes would you make?

    dockertrivy
  • 80

    Trivy reports 12 OS vulnerabilities in an image built 45 days ago, including 3 with fixes. What would you do?

    vulnerabilitiestrivy
  • 81

    Grype finds 5 vulnerable Node.js packages inside a container, but only 1 is a direct dependency. How would you trace and fix them?

    containersdependenciestracing
  • 82

    Six Kubernetes deployments use image: api:latest, and one rollout pulled different bytes on 2 nodes. What would you change?

    kubernetesdeploymentapi
  • 83

    A scan reports Dockerfile EXPOSE 22 and a Compose file publishes 0.0.0.0:22:22 for 3 test containers. What is the practical fix?

    dockercontainersnetworking
  • 84

    Trivy flags 1 Kubernetes pod with privileged: true, hostPID: true, and 2 hostPath mounts. How would you harden it?

    kubernetestrivy
  • 85

    A Kubernetes Secret with a base64-encoded database password is committed across 4 overlays. How would you contain it and prevent a repeat?

    secretspasswordsdatabase
  • 86

    A Terraform scan finds 1 S3 bucket with public ACLs and no public-access block in a 3-bucket module. What would you change?

    terraformawsiac-scanning
  • 87

    A deployment has 4 images, and the existing approved cosign command and policy pass 3 but report 1 unsigned digest. What would you do?

    deployment
  • 88

    Cosign verification fails for 1 of 6 release images, and someone says retagging invalidated its signature. What would you do?

  • 89

    You need an SBOM for a 230-package container and the team expects it to list only vulnerabilities. How would you correct and implement this?

    vulnerabilitiessupply-chaincontainers
  • 90

    An SBOM check shows 2 runtime packages missing from the release record for an image with 85 packages. How would you investigate?

    supply-chainincident-responsesoftware-inventory
  • 91

    Source SCA is clean, but a registry scan finds 3 vulnerable OS packages in the release image. How would you investigate and fix the discrepancy?

    vulnerabilitiesincident-responseregistries
  • 92

    A provenance attestation names 1 unexpected GitHub workflow for a production image. Which basic fields would you verify?

  • 93

    Two of 5 release images have signatures but no attached SBOM. Should the deployment treat them as verified?

    supply-chaindeploymentsoftware-inventory
  • 94

    A Trivy gate fails in CI with 6 findings, but a developer gets 0 locally. How would you reproduce the difference?

    debuggingtrivy
  • 95

    A developer asks why a pull request is blocked by 3 high findings in a transitive package. How would you explain the gate?

    code-review
  • 96

    Six repositories discover a malformed Rego policy used by OPA and Conftest only at deployment. What shift-left change would you make with developers?

    pytestshift-leftdeployment
  • 97

    Your lead asks for 3 simple metrics after adding scans to 8 repositories. Which would you report after 30 days?

    monitoring
  • 98

    A team requests a 14-day exception for 1 unfixed high vulnerability blocking release. What would you record and enforce?

    vulnerabilitieserror-handling
  • 99

    A scanner update introduces 12 new findings and adds 4 minutes to pipelines across 6 repositories. How would you roll it out?

    ci-cdpipelines
  • 100

    A 20-minute pipeline gains 8 more minutes after SCA, SAST, and DAST are added, and 5 developers want all gates removed. What practical response would you make?

    ci-cdpipelinesstatic-analysis