Home »
Trending Technologies MCQs
DevSecOps MCQs (Multiple-Choice Questions)
Test your knowledge of DevSecOps with these multiple-choice questions. This collection covers DevSecOps principles, secure software development, continuous integration and continuous delivery, security automation, vulnerability assessment, infrastructure as code, container security, and continuous monitoring. Each question includes the correct answer and an explanation to help you understand how security can be integrated throughout the software development lifecycle.
DevSecOps MCQs
DevSecOps stands for Development, Security, and Operations. It extends DevOps practices by integrating security activities into every stage of software development and delivery. Instead of treating security as a final checkpoint, DevSecOps encourages development, security, and operations teams to collaborate continuously and identify risks early.
Organizations implement DevSecOps using automated security testing, secure coding practices, dependency scanning, infrastructure security checks, secrets management, container scanning, and continuous monitoring. These practices help identify vulnerabilities earlier, reduce remediation costs, and support the delivery of more secure software.
List of DevSecOps MCQs
The following questions cover DevSecOps fundamentals, the shift-left approach, CI/CD security, static and dynamic application security testing, software composition analysis, infrastructure as code, security automation, container protection, compliance, incident response, and practical DevSecOps scenarios.
1. What does DevSecOps stand for?
- Development, Security, and Operations
- Device Security and Operating Systems
- Development Services and Online Processing
- Deployment Standards and Operational Software
Answer: A) Development, Security, and Operations
Explanation:
DevSecOps integrates security into development and operations workflows. It promotes shared responsibility for security rather than leaving security testing until the end of the software development lifecycle.
2. What is the primary objective of DevSecOps?
- To eliminate all software testing
- To replace developers with automated tools
- To integrate security practices throughout the software development and delivery lifecycle
- To perform security testing only after production deployment
Answer: C) To integrate security practices throughout the software development and delivery lifecycle
Explanation:
DevSecOps incorporates security into planning, coding, building, testing, deployment, and operations. This enables teams to identify and address security issues earlier and maintain protection throughout the application's lifecycle.
3. Which principle is central to DevSecOps?
- Security is exclusively the responsibility of the security team
- Security is a shared responsibility across development, security, and operations teams
- Security testing should always be postponed until release
- Only production systems require security controls
Answer: B) Security is a shared responsibility across development, security, and operations teams
Explanation:
DevSecOps encourages collaboration between teams so that security requirements are considered throughout development and deployment. Shared responsibility helps reduce gaps between software creation, security assessment, and operational protection.
4. What does the shift-left approach mean in DevSecOps?
- Moving all security controls to production
- Removing security checks from the development process
- Performing security assessments only after a breach
- Introducing security activities earlier in the software development lifecycle
Answer: D) Introducing security activities earlier in the software development lifecycle
Explanation:
The shift-left approach moves security testing and risk assessment toward planning, design, and coding. Finding defects early can make them easier and less expensive to fix than discovering them after deployment.
5. How does DevSecOps differ from a traditional security approach?
- It integrates security into continuous development and delivery rather than relying mainly on a late-stage security review
- It eliminates the need for secure coding
- It prohibits automation in software delivery
- It removes security responsibilities from developers
Answer: A) It integrates security into continuous development and delivery rather than relying mainly on a late-stage security review
Explanation:
Traditional approaches may concentrate security testing near release time. DevSecOps incorporates security checks throughout the workflow, enabling continuous feedback and faster remediation.
6. What is the role of automation in DevSecOps?
- To replace all security policies
- To guarantee that software contains no vulnerabilities
- To run repeatable security checks and enforce policies within development and delivery workflows
- To prevent developers from reviewing code
Answer: C) To run repeatable security checks and enforce policies within development and delivery workflows
Explanation:
Automation allows teams to run scans, validate configurations, detect secrets, and check dependencies as part of CI/CD pipelines. Automated results provide rapid feedback, although human review and risk assessment remain important.
7. What is a CI/CD pipeline?
- A database used only for storing security reports
- An automated workflow for integrating, building, testing, and delivering software
- A hardware device for encrypting source code
- A process used exclusively for managing employee accounts
Answer: B) An automated workflow for integrating, building, testing, and delivering software
Explanation:
Continuous integration and continuous delivery or deployment pipelines automate stages of software delivery. DevSecOps integrates security checks into these workflows to detect risks before vulnerable changes reach production.
8. Which activity is commonly performed during the coding stage of a DevSecOps workflow?
- Deleting all source code after every commit
- Disabling code review
- Publishing untested software directly to production
- Applying secure coding practices and reviewing code changes for security issues
Answer: D) Applying secure coding practices and reviewing code changes for security issues
Explanation:
Developers can prevent common vulnerabilities by following secure coding guidelines, reviewing changes, validating inputs, and handling errors safely. Automated code analysis can supplement these practices.
9. What does SAST stand for?
- Static Application Security Testing
- Secure Automated System Tracking
- Software Access and Storage Technology
- Systematic Application Software Transfer
Answer: A) Static Application Security Testing
Explanation:
Static Application Security Testing (SAST) analyzes source code, bytecode, or other representations without executing the application. It can identify patterns associated with vulnerabilities, such as unsafe input handling or insecure function usage.
10. What is the primary purpose of DAST?
- To inspect only source code comments
- To manage employee access badges
- To test a running application for security weaknesses from its exposed interfaces
- To create software documentation automatically
Answer: C) To test a running application for security weaknesses from its exposed interfaces
Explanation:
Dynamic Application Security Testing (DAST) interacts with a running application to identify issues such as injection vulnerabilities, authentication weaknesses, and security misconfigurations. It complements static analysis by examining application behavior at runtime.
11. What is Interactive Application Security Testing (IAST)?
- A method for managing source code licenses only
- A testing approach that observes application behavior during execution, often using instrumentation
- A technique for replacing all unit tests
- A method for encrypting backup files
Answer: B) A testing approach that observes application behavior during execution, often using instrumentation
Explanation:
IAST combines aspects of runtime testing and application instrumentation to identify vulnerabilities while an application executes under test. It can provide contextual information about the code paths associated with findings.
12. What is Software Composition Analysis (SCA)?
- A technique for designing application logos
- A method for testing network cables
- A process for replacing all open-source libraries
- An analysis of software dependencies to identify vulnerabilities, licenses, and component-related risks
Answer: D) An analysis of software dependencies to identify vulnerabilities, licenses, and component-related risks
Explanation:
SCA tools identify third-party and open-source components used by an application. They can compare component versions against vulnerability information and help teams understand license obligations and dependency risks.
13. Which tool category can detect hardcoded passwords and API keys in source code?
- Secrets scanning tools
- Image compression tools
- Database visualization tools
- Performance benchmarking tools only
Answer: A) Secrets scanning tools
Explanation:
Secrets scanners search repositories and other files for exposed credentials, tokens, private keys, and similar sensitive values. When a secret is exposed, teams should revoke or rotate it and investigate potential misuse rather than simply deleting the text.
14. What is Infrastructure as Code (IaC)?
- A method for writing application user manuals
- A practice of managing infrastructure exclusively through physical switches
- A practice of defining and managing infrastructure using machine-readable configuration files or code
- A technique for storing passwords in application source code
Answer: C) A practice of defining and managing infrastructure using machine-readable configuration files or code
Explanation:
Infrastructure as Code allows teams to provision and manage resources through declarative configuration or scripts. Security checks can inspect these definitions for risky settings before infrastructure is deployed.
15. What is IaC security scanning intended to identify?
- Only spelling mistakes in documentation
- Misconfigurations such as publicly exposed storage, overly broad permissions, and insecure network rules
- Only slow database queries
- Only unused comments in source code
Answer: B) Misconfigurations such as publicly exposed storage, overly broad permissions, and insecure network rules
Explanation:
IaC scanning checks infrastructure definitions against security rules and best practices. It can identify risky configurations before deployment, allowing teams to correct problems before they affect live environments.
16. What is the purpose of threat modeling in DevSecOps?
- To estimate only the time needed to complete a project
- To eliminate all testing requirements
- To make every system accessible to anonymous users
- To identify potential threats, attack paths, assets, and suitable security controls
Answer: D) To identify potential threats, attack paths, assets, and suitable security controls
Explanation:
Threat modeling helps teams understand how attackers might misuse an application or exploit its architecture. It supports informed decisions about authentication, authorization, data protection, trust boundaries, and other controls.
17. What does the term "security as code" mean in DevSecOps?
- Expressing security policies, controls, or checks in machine-readable forms that can be version-controlled and automated
- Writing every security policy only on paper
- Replacing all security tools with manual checklists
- Embedding confidential passwords directly into source code
Answer: A) Expressing security policies, controls, or checks in machine-readable forms that can be version-controlled and automated
Explanation:
Security as code allows teams to define and enforce controls through scripts, configuration, and policy rules. These controls can be reviewed, tested, and integrated into development and deployment pipelines.
18. Why is least privilege important in a DevSecOps pipeline?
- It ensures that every developer has unrestricted production access
- It removes the need for authentication
- It limits users, services, and pipeline jobs to the permissions required for their tasks
- It prevents teams from applying security updates
Answer: C) It limits users, services, and pipeline jobs to the permissions required for their tasks
Explanation:
Least privilege reduces the potential impact of compromised accounts or build jobs. By restricting access to repositories, secrets, cloud resources, and deployment environments, organizations can limit unauthorized activity.
19. What is the purpose of a secrets management system?
- To publish passwords in public repositories
- To securely store, access, rotate, and manage sensitive credentials
- To replace application authentication with anonymous access
- To disable all encryption mechanisms
Answer: B) To securely store, access, rotate, and manage sensitive credentials
Explanation:
Secrets management systems provide controlled access to API keys, passwords, certificates, and tokens. They reduce the need to hardcode secrets and can support rotation, access auditing, and short-lived credentials.
20. Why should production credentials be kept out of source code?
- Because source code cannot contain text values
- Because credentials are always public by design
- Because credentials cannot be used by applications
- Because repository access, logs, or code leaks could expose credentials to unauthorized users
Answer: D) Because repository access, logs, or code leaks could expose credentials to unauthorized users
Explanation:
Credentials embedded in source code may remain in version history even after removal. Using a secrets manager or another secure credential-delivery mechanism helps reduce exposure and supports controlled rotation.
21. What is the purpose of a security gate in a CI/CD pipeline?
- To evaluate whether a build meets defined security requirements before proceeding
- To prevent every developer from submitting code
- To guarantee that no future vulnerabilities can appear
- To remove all automated testing stages
Answer: A) To evaluate whether a build meets defined security requirements before proceeding
Explanation:
A security gate can block a build or deployment when specified conditions are not met, such as the presence of critical vulnerabilities or prohibited configurations. Gate rules should be risk-based and include processes for handling justified exceptions.
22. Which is an example of a DevSecOps security gate?
- Automatically approving every change without checks
- Disabling dependency scanning before release
- Preventing a production release when a policy-defined critical security finding remains unresolved
- Allowing every pipeline to publish unsigned artifacts
Answer: C) Preventing a production release when a policy-defined critical security finding remains unresolved
Explanation:
A security gate enforces defined acceptance criteria. For example, a pipeline may stop deployment when a critical vulnerability is detected, unless an authorized exception process permits a documented alternative.
23. What is Continuous Security Monitoring?
- A process performed only once before software development begins
- Ongoing observation of systems, applications, configurations, and security events to identify risks and suspicious activity
- A method for disabling security alerts
- A technique for replacing all software updates
Answer: B) Ongoing observation of systems, applications, configurations, and security events to identify risks and suspicious activity
Explanation:
Continuous security monitoring helps teams detect emerging threats, configuration drift, suspicious access, and vulnerabilities. It supports incident response and allows security controls to be evaluated after deployment.
24. What is configuration drift?
- A planned change that always improves security
- A technique for compressing configuration files
- A method for encrypting source code
- A difference between the intended configuration and the actual state of a system over time
Answer: D) A difference between the intended configuration and the actual state of a system over time
Explanation:
Configuration drift occurs when systems change from their approved baseline because of manual modifications, updates, or unexpected actions. Monitoring and automated reconciliation can help detect and correct insecure deviations.
25. How does container scanning contribute to DevSecOps?
- It identifies known vulnerabilities and risky configurations in container images and their components
- It guarantees that containers cannot be compromised
- It eliminates the need to update base images
- It prevents containers from running on any operating system
Answer: A) It identifies known vulnerabilities and risky configurations in container images and their components
Explanation:
Container scanning can identify vulnerable operating system packages, application dependencies, and configuration problems. Teams should use scan results to prioritize remediation and rebuild images using trusted, updated components.
26. What is the purpose of Kubernetes security policies and controls?
- To allow every workload to access every secret
- To eliminate all identity management
- To restrict workload permissions, enforce deployment requirements, and reduce cluster attack surfaces
- To disable logging in production environments
Answer: C) To restrict workload permissions, enforce deployment requirements, and reduce cluster attack surfaces
Explanation:
Kubernetes security controls include role-based access control, network policies, workload security settings, secret protection, and admission policies. Proper configuration helps limit unauthorized access and reduce the impact of compromised workloads.
27. Why should teams scan third-party dependencies during development?
- To guarantee that every external library is maintained forever
- To identify known vulnerabilities and other risks in external components before they reach production
- To prevent all dependency updates
- To replace code review entirely
Answer: B) To identify known vulnerabilities and other risks in external components before they reach production
Explanation:
Dependency scanning helps teams discover vulnerable libraries and prioritize upgrades or mitigations. It should be repeated as new vulnerabilities are disclosed and dependency versions change.
28. What is the purpose of secure code review?
- To assess only the formatting of source files
- To eliminate all automated testing
- To ensure that no developer can modify code
- To examine code changes for security flaws, unsafe assumptions, and violations of coding standards
Answer: D) To examine code changes for security flaws, unsafe assumptions, and violations of coding standards
Explanation:
Secure code review helps identify issues that automated tools may miss, such as authorization mistakes, insecure business logic, and unsafe handling of sensitive data. It works best alongside automated analysis and testing.
29. What is fuzz testing in application security?
- Providing many unexpected, malformed, or generated inputs to software to discover crashes and other defects
- Checking only whether code follows naming conventions
- Encrypting every application request
- Creating backups of every source file
Answer: A) Providing many unexpected, malformed, or generated inputs to software to discover crashes and other defects
Explanation:
Fuzz testing explores application behavior using generated or mutated inputs. It can reveal crashes, memory errors, parsing flaws, and security vulnerabilities that might not be found by ordinary test cases.
30. What is the purpose of security unit tests?
- To test only the application's visual design
- To guarantee that the entire infrastructure is secure
- To verify that specific security-related functions or rules behave as intended
- To replace integration and penetration testing completely
Answer: C) To verify that specific security-related functions or rules behave as intended
Explanation:
Security unit tests can validate input handling, authorization decisions, access restrictions, and error handling at the component level. They provide rapid feedback but do not replace broader security testing.
31. What is policy as code in DevSecOps?
- A method for writing all policies as unstructured text files only
- Defining security or compliance rules in machine-readable form so they can be tested and enforced automatically
- A technique for removing all approval workflows
- A method for publishing private keys to a repository
Answer: B) Defining security or compliance rules in machine-readable form so they can be tested and enforced automatically
Explanation:
Policy as code makes rules testable, reviewable, and repeatable. Teams can apply policies to infrastructure, deployment configurations, access permissions, and software releases as part of automated workflows.
32. How can DevSecOps help with regulatory compliance?
- By removing the need to understand applicable regulations
- By guaranteeing compliance without evidence
- By disabling audit logs to protect privacy
- By automating relevant checks, preserving evidence, and integrating compliance requirements into development and deployment workflows
Answer: D) By automating relevant checks, preserving evidence, and integrating compliance requirements into development and deployment workflows
Explanation:
DevSecOps can support compliance by applying defined controls consistently and retaining records of scans, approvals, configurations, and releases. Automation helps with evidence collection, but organizations must still interpret and satisfy the applicable requirements.
33. What is the purpose of security logging in a DevSecOps environment?
- To record relevant events for monitoring, auditing, troubleshooting, and incident investigation
- To store all passwords in plaintext
- To prevent all system events from being detected
- To replace authentication and authorization controls
Answer: A) To record relevant events for monitoring, auditing, troubleshooting, and incident investigation
Explanation:
Security logs help teams detect suspicious activity and reconstruct incidents. Logs should be protected against unauthorized access or alteration and should avoid exposing sensitive data unnecessarily.
34. Why is threat intelligence useful in DevSecOps?
- It automatically fixes every vulnerability in source code
- It removes the need for incident response
- It provides information about threats, attacker techniques, indicators, and vulnerabilities that can inform security decisions
- It guarantees that external dependencies are trustworthy
Answer: C) It provides information about threats, attacker techniques, indicators, and vulnerabilities that can inform security decisions
Explanation:
Threat intelligence helps teams understand relevant attacker behavior and emerging risks. It can inform detection rules, vulnerability prioritization, defensive testing, and incident response planning.
35. What is the main benefit of integrating security testing into pull requests?
- It allows changes to bypass code review
- It provides early feedback about potential security issues before changes are merged
- It guarantees that no vulnerabilities will exist after release
- It removes the need to test the application at runtime
Answer: B) It provides early feedback about potential security issues before changes are merged
Explanation:
Security checks on pull requests can detect risky changes before they become part of the main codebase. Developers can address findings while the changes are still fresh and the context is easy to understand.
36. What is the purpose of a software bill of materials in DevSecOps?
- To document employee working hours
- To replace source code repositories
- To guarantee that every listed component is free of vulnerabilities
- To provide an inventory of software components and support dependency risk management
Answer: D) To provide an inventory of software components and support dependency risk management
Explanation:
An SBOM helps organizations understand which components are included in an application. When a new vulnerability is announced, the inventory can help identify affected applications and support response planning.
37. Which practice helps secure software release artifacts?
- Signing artifacts, verifying signatures, and controlling who can publish releases
- Allowing anyone to overwrite production artifacts
- Disabling integrity checks before deployment
- Storing signing keys in public source repositories
Answer: A) Signing artifacts, verifying signatures, and controlling who can publish releases
Explanation:
Artifact signing and verification help detect tampering and establish trust in release packages. Strong access controls and secure key management reduce the risk of unauthorized artifacts being distributed as legitimate releases.
38. What is the role of incident response in DevSecOps?
- To ensure that security findings are never reported
- To delay investigation until the next software release
- To detect, contain, investigate, remediate, and learn from security incidents
- To remove all monitoring from production
Answer: C) To detect, contain, investigate, remediate, and learn from security incidents
Explanation:
Incident response helps teams limit the damage caused by compromised systems or vulnerable releases. Findings from incidents should also inform improvements to code, pipeline controls, monitoring, and security policies.
39. What is a common challenge when implementing DevSecOps?
- Security can only be performed on physical hardware
- Balancing security requirements with delivery speed, team workflows, and available resources
- Automated tools can never be used in development
- Every organization uses exactly the same technology stack
Answer: B) Balancing security requirements with delivery speed, team workflows, and available resources
Explanation:
Organizations may face tool integration issues, skill gaps, excessive false positives, and concerns about pipeline delays. Risk-based controls, developer training, and carefully tuned automation help address these challenges.
40. Why is developer security training important in DevSecOps?
- It removes the need for secure coding guidelines
- It guarantees that every developer will avoid every mistake
- It prevents teams from using security automation
- It helps developers recognize common vulnerabilities and apply secure development practices
Answer: D) It helps developers recognize common vulnerabilities and apply secure development practices
Explanation:
Training helps developers understand risks such as injection, broken access control, insecure secrets handling, and unsafe dependencies. Practical examples and feedback from security tools help reinforce secure coding habits.
41. What does Mean Time to Remediate (MTTR) commonly measure in vulnerability management?
- The average time taken to address a reported issue, according to the organization's defined measurement
- The total number of developers in a team
- The number of releases published in a year
- The size of a source code repository
Answer: A) The average time taken to address a reported issue, according to the organization's defined measurement
Explanation:
Mean Time to Remediate measures how long it takes to resolve identified issues. Organizations should define the start and end points consistently and analyze the metric alongside severity, exposure, and remediation quality.
42. Which metric can help evaluate the effectiveness of DevSecOps security testing?
- The number of colors used in application screens
- The number of meetings held by developers
- The rate of security findings resolved within defined remediation targets
- The number of source code comments deleted
Answer: C) The rate of security findings resolved within defined remediation targets
Explanation:
Tracking remediation performance helps teams understand whether security findings are being addressed within expected timeframes. Other useful measures include vulnerability recurrence, escaped defects, false-positive rates, and coverage of security checks.
43. What is a false positive in automated security testing?
- A confirmed security vulnerability that attackers have exploited
- A finding reported by a tool that does not represent an actual issue under the relevant conditions
- A security patch that fixes a vulnerability
- A successful authentication event
Answer: B) A finding reported by a tool that does not represent an actual issue under the relevant conditions
Explanation:
A false positive occurs when a tool reports a potential vulnerability that is not actually present or exploitable in the assessed context. Reviewing and tuning findings helps reduce unnecessary work while preserving coverage for real issues.
44. What is the purpose of continuous compliance in DevSecOps?
- To perform a single compliance check and ignore all future changes
- To remove all audit evidence
- To guarantee compliance without checking actual system behavior
- To repeatedly evaluate whether systems and delivery processes meet defined security and compliance requirements
Answer: D) To repeatedly evaluate whether systems and delivery processes meet defined security and compliance requirements
Explanation:
Continuous compliance uses repeatable checks and monitoring to identify deviations from required controls. It can improve visibility and evidence collection, but organizations still need to interpret requirements and investigate failures.
45. How does DevSecOps support cloud security?
- By integrating configuration checks, identity controls, vulnerability scanning, and monitoring into cloud delivery workflows
- By making all cloud resources publicly accessible
- By eliminating the need to manage cloud permissions
- By disabling security alerts during deployment
Answer: A) By integrating configuration checks, identity controls, vulnerability scanning, and monitoring into cloud delivery workflows
Explanation:
DevSecOps can detect insecure cloud configurations before deployment and monitor running environments for changes or suspicious behavior. Strong identity management, least privilege, and secure secrets handling are also essential.
46. What is the purpose of a secure software development lifecycle (SSDLC) within DevSecOps?
- To perform security checks only after the application is retired
- To eliminate requirements analysis and design
- To integrate security requirements and controls into each stage of software development
- To replace all development processes with manual audits
Answer: C) To integrate security requirements and controls into each stage of software development
Explanation:
An SSDLC incorporates security into planning, design, implementation, testing, release, and maintenance. DevSecOps reinforces this approach through collaboration, automation, continuous feedback, and operational monitoring.
47. Why should DevSecOps pipelines use isolated and temporary build environments where practical?
- To ensure that every build shares the same unrestricted credentials
- To reduce persistence between jobs and limit the impact of a compromised build environment
- To eliminate all testing requirements
- To allow untrusted code to access production secrets
Answer: B) To reduce persistence between jobs and limit the impact of a compromised build environment
Explanation:
Ephemeral, isolated build environments reduce the opportunity for an attacker to persist across jobs or access unrelated workloads. Their effectiveness depends on proper isolation, credential handling, and restrictions on external access.
48. Which approach is best for handling a newly discovered critical vulnerability in a production dependency?
- Ignore the finding until the next annual audit
- Disable all vulnerability reporting permanently
- Publish the affected dependency to more projects without investigation
- Assess exposure and impact, prioritize remediation, and deploy a verified fix or appropriate mitigation
Answer: D) Assess exposure and impact, prioritize remediation, and deploy a verified fix or appropriate mitigation
Explanation:
Teams should determine which services use the affected dependency and whether the vulnerable functionality is exposed. They should then prioritize an upgrade or other validated mitigation, test the change, and monitor for signs of exploitation.
49. A DevSecOps pipeline runs 200 automated security checks. Of these, 30 checks report findings that require investigation. What percentage of the checks reported findings?
- 10%
- 15%
- 20%
- 30%
Answer: B) 15%
Explanation:
The percentage is calculated by dividing the number of checks that reported findings by the total number of checks and multiplying by 100: (30 / 200) × 100 = 15%. This represents the proportion of checks reporting findings, not necessarily the percentage of vulnerabilities in the application.
50. A development team discovers that a CI/CD pipeline exposes a production API key in its build logs. What is the most appropriate immediate response?
- Leave the key active and remove the log from view without further action
- Publish the key in the repository so the team can find it easily
- Revoke or rotate the exposed key, investigate potential misuse, remove the exposure, and strengthen secret handling in the pipeline
- Disable all security monitoring to prevent further alerts
Answer: C) Revoke or rotate the exposed key, investigate potential misuse, remove the exposure, and strengthen secret handling in the pipeline
Explanation:
An exposed production credential should be treated as potentially compromised. The team should revoke or rotate it promptly, review logs and access records for suspicious activity, remove the secret from accessible locations where possible, and implement secure secret storage and masking to prevent recurrence.