Interview questions › Security & DevSecOps
Security & DevSecOps interview questions & answers
100 Security & DevSecOps interview questions. Each links to a full answer page with a concise spoken answer, a technical explanation, and a hands-on example.
Tip: paste the job description + your resume into our free resume checker to see which of these skills the role actually requires.
All questions
- What is DevSecOps, and how does it differ from traditional security gating at the end? [Basic]DevSecOps means security is engineered into the full software delivery lifecycle instead of being treated as a final approval gate.
- What does shift-left security mean, and why does it matter? [Basic]Shift-left security means finding and fixing security issues as early as possible, ideally while code is being written or reviewed.
- What is the difference between SAST, DAST, IAST, and SCA? [Basic]SAST analyzes source or bytecode without running the application, DAST tests a running application from the outside, IAST observes the application while tests…
- When in the pipeline does each of SAST, DAST, and SCA run? [Basic]SCA and SAST usually run early in pull request and build stages.
- What is the difference between SAST and DAST, and what does each catch and miss? [Basic]SAST looks inside the code without executing it, while DAST attacks or probes the running application from the outside.
- What is software composition analysis (SCA), and why does it matter for dependencies? [Basic]Software composition analysis identifies the third-party libraries, frameworks, transitive dependencies, and licenses in an application.
- What is SonarQube, and what does it analyse? [Basic]SonarQube is a static analysis and code quality platform.
- Is SonarQube primarily SAST, code quality, or both? [Basic]SonarQube is both a code quality platform and a SAST-style static analysis tool.
- What is a SonarQube quality gate, and how do you use it to fail a build? [Basic]A SonarQube quality gate is a set of pass/fail conditions applied to an analysis result.
- What is the difference between a quality gate and a quality profile in SonarQube? [Basic]A quality gate defines whether a project passes or fails based on metrics.
- What does 'clean as you code' mean in SonarQube, and why focus on new code? [Basic]Clean as you code means holding new or changed code to a high standard, even if the legacy codebase still has debt.
- What metrics does SonarQube track (coverage, duplication, code smells, bugs, vulnerabilities)? [Basic]SonarQube tracks metrics such as coverage, duplicated lines, bugs, vulnerabilities, security hotspots, code smells, maintainability rating, reliability rating,…
- What is the difference between a bug, a vulnerability, and a code smell in SonarQube? [Basic]In SonarQube, a bug is a likely correctness problem, a vulnerability is a security flaw with a concrete exploit risk, and a code smell is a maintainability issue that…
- What is technical debt in SonarQube, and how is it estimated? [Basic]Technical debt in SonarQube is an estimate of the remediation effort required to fix maintainability issues, usually expressed as time.
- How does SonarQube measure code coverage, and does it run your tests? [Basic]SonarQube measures code coverage by importing coverage reports generated by test tools.
- How do you integrate SonarQube into a Jenkins or GitHub pipeline? [Basic]I integrate SonarQube by adding a scanner step to CI, passing project metadata and coverage reports, then waiting for the quality gate result.
- What is a SonarQube hotspot, and how is it different from a vulnerability? [Basic]A SonarQube security hotspot is security-sensitive code that requires human review to decide whether it is safe.
- How do you handle false positives in SonarQube? [Basic]I handle false positives by validating the finding, documenting why it is not exploitable, marking it appropriately in SonarQube, and tuning rules only when the…
- How do you enforce that pull requests pass the quality gate before merge? [Basic]I enforce pull-request quality gates by making the SonarQube quality gate a required status check in the source control system.
- What is the difference between SonarQube and SonarCloud? [Basic]SonarQube is typically a self-managed or enterprise-managed server that an organization operates.
- How would you roll out SonarQube to many teams without blocking them on day one? [Basic]I would roll out SonarQube gradually: start with visibility, focus gates on new code, onboard pilot teams, create language-specific templates, then progressively…
- What is Wiz, and what category of tool is it (CSPM/CNAPP)? [Basic]Wiz is a cloud security platform in the CNAPP category, with strong CSPM, vulnerability, cloud workload, identity, data, Kubernetes, and exposure-risk capabilities.
- What is CSPM, and what does it protect against? [Basic]CSPM stands for Cloud Security Posture Management.
- What is CNAPP, and what capabilities does it combine? [Basic]CNAPP stands for Cloud-Native Application Protection Platform.
- What is the difference between agent-based and agentless cloud security scanning? [Basic]Agent-based scanning installs software on workloads to collect deep host or runtime telemetry.
- How does Wiz scan a cloud environment without agents? [Basic]At a high level, Wiz scans cloud environments agentlessly by connecting to cloud provider APIs with read-only permissions, inventorying resources, analyzing…
- What is the Wiz Security Graph, and why is context important for prioritisation? [Basic]The Wiz Security Graph is a contextual relationship model that connects cloud assets, identities, vulnerabilities, network exposure, secrets, Kubernetes objects, and…
- What is a toxic combination (attack path) in Wiz, and why prioritise it? [Basic]A toxic combination, or attack path, is a set of individually related weaknesses that together create a high-risk route to compromise.
- How does Wiz help prioritise which vulnerabilities to fix first? [Basic]Wiz helps prioritize vulnerabilities by adding cloud context such as internet exposure, workload criticality, exploitability signals, sensitive data access, privilege…
- Why is context (internet exposure, sensitive data, privileges) key to vulnerability prioritisation? [Basic]Context is key because vulnerability severity alone does not show whether an attacker can reach the asset or whether compromise would matter.
- How would you use Wiz findings to drive remediation across teams? [Basic]I would use Wiz findings to drive remediation by assigning clear ownership, prioritizing with context, creating tickets with actionable fix guidance, tracking SLAs,…
- How does your AI-assisted remediation tool relate to scanners like Wiz? [Basic]An AI-assisted remediation tool should complement scanners like Wiz, not replace them.
- What is the difference between a CVE, a CVSS score, and exploitability (EPSS/KEV)? [Basic]A CVE is an identifier for a publicly known vulnerability.
- What is CVSS, and what are its limitations for prioritisation? [Intermediate]CVSS is the Common Vulnerability Scoring System.
- What is EPSS, and how does it improve on raw CVSS? [Intermediate]EPSS is the Exploit Prediction Scoring System.
- What is the CISA KEV catalog, and how would you use it? [Intermediate]The CISA Known Exploited Vulnerabilities catalog is a list of vulnerabilities that CISA identifies as known to be exploited in the wild.
- How do you reduce the noise of thousands of vulnerability findings? [Intermediate]I reduce vulnerability noise by deduplicating findings, grouping by fix, adding ownership and environment context, prioritizing exploitability and exposure,…
- How do you decide whether to patch, mitigate, or accept the risk of a vulnerability? [Intermediate]I decide whether to patch, mitigate, or accept risk based on exploitability, exposure, business impact, patch availability, operational risk of the fix, compensating…
- What is vulnerability management as a lifecycle (discover, prioritise, remediate, verify)? [Intermediate]Vulnerability management is a lifecycle: discover assets and findings, normalize/deduplicate them, prioritize by risk, assign ownership, remediate or mitigate, verify…
- How would you remediate a critical CVE in a third-party Java dependency? [Intermediate]For a critical CVE in a third-party Java dependency, I would identify whether it is direct or transitive, confirm exploitability in our service, upgrade the…
- What is a transitive dependency, and why does it complicate patching? [Intermediate]A transitive dependency is a dependency pulled in by another dependency rather than declared directly by the application.
- What is the difference between patching the base image and patching the application dependency? [Intermediate]Patching the base image fixes vulnerabilities in the operating-system layer and common runtime packages.
- What is container image scanning, and what tools do it (Trivy, Grype, Wiz)? [Intermediate]Container image scanning analyzes image layers for vulnerable OS packages, application dependencies, secrets, malware indicators, and misconfigurations.
- How do you prevent vulnerable images from being deployed (admission control, registry policy)? [Intermediate]I prevent vulnerable images from being deployed by combining CI scan gates, registry policies, image signing, and Kubernetes admission control.
- What is an SBOM, and how do you generate and use one? [Intermediate]An SBOM, or Software Bill of Materials, is an inventory of the components inside software: packages, versions, suppliers, hashes, and relationships.
- What is the difference between SPDX and CycloneDX SBOM formats? [Intermediate]SPDX and CycloneDX are two common SBOM formats.
- What is supply-chain security, and what is SLSA? [Intermediate]Supply-chain security protects the integrity of software from source code through build, dependencies, artifacts, deployment, and runtime.
- What is artifact signing, and what is Sigstore/cosign? [Intermediate]Artifact signing cryptographically signs a build artifact or image digest so consumers can verify integrity and publisher identity.
- How do you verify the provenance of a build artifact? [Intermediate]To verify artifact provenance, I check the artifact digest, the signed provenance attestation, the builder identity, source repository, commit SHA, workflow identity,…
- What is secrets scanning, and how do you stop secrets being committed to Git? [Intermediate]Secrets scanning detects credentials accidentally committed to source code, images, logs, or configuration files.
- What do you do if a secret has already been committed and pushed? [Intermediate]If a secret has been committed and pushed, treat it as compromised.
- What is the principle of least privilege, and how do you apply it in CI/CD? [Intermediate]Least privilege means every user, workload, and pipeline gets only the permissions required for its job, for only the time needed.
- How do you secure pipeline credentials and avoid long-lived secrets? [Intermediate]I secure pipeline credentials by avoiding long-lived secrets, using OIDC or workload identity, scoping credentials to repository and environment, storing unavoidable…
- What is OIDC-based authentication from CI to a cloud provider, and why is it safer than keys? [Intermediate]OIDC-based authentication from CI to a cloud provider lets a CI job exchange a short-lived identity token for temporary cloud credentials.
- What is workload identity, and how does it remove static credentials? [Intermediate]Workload identity lets an application or workload authenticate to cloud services using its runtime identity rather than a stored static credential.
- What is policy-as-code, and what tools implement it (OPA, Sentinel, Kyverno)? [Intermediate]Policy-as-code means security, compliance, and operational rules are written as versioned, testable code and enforced automatically.
- What is OPA, and what is the Rego language used for? [Intermediate]OPA, the Open Policy Agent, is a general-purpose policy engine.
- How would you enforce a policy like 'no public S3 buckets' as code? [Intermediate]To enforce 'no public S3 buckets' as code, I would check Terraform or CloudFormation before deployment and also monitor deployed AWS resources continuously.
- What is admission control in Kubernetes, and how do OPA Gatekeeper or Kyverno use it? [Intermediate]Kubernetes admission control intercepts API requests before objects are persisted.
- What is the difference between a validating and a mutating admission webhook? [Intermediate]A validating admission webhook approves or denies an API request.
- What is 'secure by default', and give an example of a secure-by-default pattern? [Intermediate]Secure by default means the default path is safe without requiring every developer to be a security expert.
- What is Zero Trust, and how does it differ from perimeter-based security? [Intermediate]Zero Trust assumes no network location is automatically trusted.
- How do you apply least privilege to service-to-service communication (e.g., with Istio mTLS)? [Intermediate]For service-to-service least privilege, I authenticate workloads with strong identities, encrypt traffic with mTLS, authorize only required service pairs and methods,…
- What is secrets management, and how does HashiCorp Vault work at a high level? [Intermediate]Secrets management is the controlled storage, access, rotation, and audit of sensitive values such as passwords, API keys, certificates, and tokens.
- What is dynamic secrets generation in Vault, and why is it powerful? [Intermediate]Dynamic secrets in Vault are generated on demand and have leases, expiration, and automatic revocation.
- What is the difference between static and dynamic secrets? [Intermediate]A static secret is created in advance and remains valid until manually changed or rotated.
- How does secret rotation work, and why does it matter? [Advanced]Secret rotation replaces an old credential with a new one and ensures all consumers switch safely.
- What is encryption at rest versus in transit, and how do you ensure both? [Advanced]Encryption at rest protects stored data such as disks, databases, backups, and object storage.
- What is the difference between symmetric and asymmetric encryption? [Advanced]Symmetric encryption uses the same key to encrypt and decrypt data.
- What is TLS, and what happens during a TLS handshake at a high level? [Advanced]TLS secures network communication by authenticating the server, negotiating encryption parameters, deriving shared session keys, and encrypting application data.
- What is mutual TLS, and where would you use it? [Advanced]Mutual TLS means both client and server present certificates and authenticate each other.
- What is certificate management, and how do tools like cert-manager help? [Advanced]Certificate management covers issuing, renewing, rotating, revoking, and monitoring certificates.
- What is RBAC versus ABAC? [Advanced]RBAC grants permissions based on roles assigned to users or service accounts.
- How do you secure container runtime (seccomp, AppArmor, capabilities, read-only root)? [Advanced]I secure container runtime by reducing privileges and attack surface: run as non-root, drop Linux capabilities, use seccomp/AppArmor/SELinux profiles, set read-only…
- What are Linux capabilities, and why drop them in containers? [Advanced]Linux capabilities split root privileges into smaller permission units such as NET_ADMIN, SYS_ADMIN, CHOWN, and NET_BIND_SERVICE.
- Why should containers not run as root, and what does running rootless achieve? [Advanced]Containers should not run as root because a container breakout, writable host mount, or runtime bug can give an attacker more leverage.
- What are Kubernetes Pod Security Standards (privileged, baseline, restricted)? [Advanced]Kubernetes Pod Security Standards define three policy levels: privileged, baseline, and restricted.
- How do you prevent privilege escalation in a Kubernetes cluster? [Advanced]I prevent privilege escalation in Kubernetes with least-privilege RBAC, Pod Security Admission restricted mode, no privileged containers, no hostPath/hostNetwork…
- What is network segmentation, and how do NetworkPolicies enforce it? [Advanced]Network segmentation separates systems so compromise in one area does not automatically expose everything else.
- What is the difference between a vulnerability, a threat, and a risk? [Advanced]A vulnerability is a weakness, a threat is a potential actor or event that could exploit a weakness, and risk is the combination of likelihood and impact if that…
- What is threat modeling, and when would you do it? [Advanced]Threat modeling is a structured way to identify what can go wrong in a system, who might attack it, what assets need protection, and which controls reduce the risk.
- What is the OWASP Top 10, and name a few categories? [Advanced]The OWASP Top 10 is a widely used awareness list of critical web application security risks.
- What is an injection attack, and how do you prevent SQL injection? [Advanced]An injection attack occurs when untrusted input is interpreted as code or commands by an interpreter such as SQL, shell, LDAP, or NoSQL.
- What is the difference between encoding, encryption, and hashing? [Advanced]Encoding changes data representation, encryption protects confidentiality and can be reversed with a key, and hashing produces a one-way digest for integrity or…
- Why do you hash and salt passwords rather than encrypt them? [Advanced]Passwords are hashed and salted rather than encrypted because applications should not need to recover the original password.
- What is a security incident response process, and what are its phases? [Advanced]A security incident response process is a structured approach to handling suspected or confirmed security events.
- How would you respond to a suspected credential compromise in production? [Advanced]For suspected production credential compromise, I would treat the credential as exposed, contain access immediately, rotate or revoke it, investigate usage, assess…
- How do you audit who did what in your cloud and clusters (CloudTrail, audit logs)? [Advanced]I audit who did what using cloud audit logs such as AWS CloudTrail, Kubernetes audit logs, CI/CD logs, IAM access analyzer data, Git history, and service-specific logs.
- What is compliance-as-code, and how do you continuously prove compliance? [Advanced]Compliance-as-code means expressing compliance controls as automated policies, tests, evidence collection, and continuous monitoring instead of manual screenshots and…
- How do you balance security controls with developer velocity? [Advanced]I balance security controls with developer velocity by making secure paths easy, fast, and automated.
- How do you get developers to adopt secure practices without friction? [Advanced]Developers adopt secure practices when the secure option is the easiest option and feedback is actionable.
- How would you embed security scanning into a pipeline without making it slow? [Advanced]I embed security scanning without slowing the pipeline by using staged scanning, caching, incremental analysis, parallel jobs, risk-based blocking, and asynchronous…
- What is a break-glass procedure, and why have one? [Advanced]A break-glass procedure is a controlled emergency path for bypassing normal access or deployment restrictions during urgent incidents.
- How do you manage and rotate SSH and API keys at scale? [Advanced]At scale, I manage SSH and API keys by reducing static keys, centralizing issuance, enforcing short lifetimes, rotating automatically, inventorying ownership,…
- What is the difference between a WAF, an IDS, and an IPS? [Advanced]A WAF filters and protects web application traffic, usually at HTTP layer 7.
- How do you measure the effectiveness of your security program (MTTR for vulns, coverage)? [Advanced]I measure security program effectiveness with outcome and coverage metrics: vulnerability MTTR, SLA compliance, critical exposure count, KEV exposure time, scanning…
- What recent security tool or practice have you adopted, and what risk did it reduce? [Advanced]A recent practice I would highlight is keyless artifact signing with OIDC-based CI identity and admission verification.
- How would you design a secure-by-default CI/CD pipeline from scratch? [Advanced]A secure-by-default CI/CD pipeline should start with protected source control, strong identity, fast security feedback, trusted builds, signed artifacts, policy-gated…
- How do you prove to an auditor that security controls are enforced continuously, not just documented? [Advanced]To prove continuous enforcement to an auditor, I provide automated evidence from the systems that enforce controls: CI logs, policy-as-code results,…