All GitLab exams

Free GitLab Certified Security Associate practice test: 30 questions with answers

30 original questions for GitLab Certified Security Associate, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.

Free questions
30
Full bank
112 questions
Real exam
50 questions, 75 min
Passing score
75%

GitLab Certified Security Associate exam guide: topics, cost and format

All 30 GitLab Certified Security Associate questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

SAST (3 questions)

  1. Question 1

    A team wants GitLab SAST to skip a vendored third-party directory that contains code they do not maintain, without turning off SAST for the whole project. Which approach fits best?

    1. AAdd the vendored directory to the SAST excluded paths setting so the analyzers skip it
    2. BDisable the SAST template entirely and run a separate third-party scanner on the rest of the repository
    3. CDelete the vendored directory from the repository before each pipeline runs and restore it afterwards
    4. DDismiss every finding that originates from the vendored directory in the Vulnerability Report
    Show answer and explanation
    Correct answer: A

    The SAST excluded paths setting (SAST_EXCLUDED_PATHS) tells the analyzers to skip matching files while the rest of the project is still scanned. Disabling the template removes coverage for all code, deleting the directory on every run is fragile, and dismissing findings still runs the analysis on that code.

  2. Question 2

    A developer reviews a SAST finding in a merge request and confirms that the flagged code is not exploitable because a safe wrapper already handles the input. What should happen to the finding in the Vulnerability Report?

    1. AConfirmed, which marks it as a real vulnerability that must be fixed before the release ships
    2. BDismissed, with a reason recorded so the decision can be audited later by the security team
    3. CDetected, which leaves it waiting in the default state for a later triage decision by the team
    4. DResolved, which means a code change removed the flagged pattern from the default branch of the project
    Show answer and explanation
    Correct answer: B

    Dismissed is the state for findings the team has judged not to be real or not applicable, and a dismissal reason is recorded for audit. Confirmed is for real vulnerabilities, Detected is the initial state before triage, and Resolved means the finding has gone away after a fix.

  3. Question 3

    A security lead has a long list of open SAST findings before a release and only a few days to triage them. Which approach best prioritizes the remaining work?

    1. ASort by severity and confidence, then start with high-severity findings in code that reaches production
    2. BFix findings in the order the analyzers printed them in the pipeline job log
    3. CStart with the lowest-severity findings because they are the fastest to close
    4. DAssign all open findings to the developer who made the most recent commit to the default branch of the project
    Show answer and explanation
    Correct answer: A

    Severity and confidence show how serious a finding is likely to be, and production reachability shows where the risk matters most, so high-severity findings in live code come first. Log order, lowest-first, and blanket assignment do not reflect the actual risk.

Security Policies (3 questions)

  1. Question 4

    What does a scan execution policy do in GitLab?

    1. AIt runs container image scans on a fixed schedule outside of any pipeline in the project
    2. BIt blocks a merge request from merging until a named approver signs off on the proposed change in the review
    3. CIt stores scanner credentials in a protected variable that the scan jobs can read at runtime
    4. DIt requires specified security scans to run in in-scope project pipelines regardless of local CI settings
    Show answer and explanation
    Correct answer: D

    Scan execution policies enforce that defined security scans run in the pipelines of the projects they apply to, so project-level CI settings cannot simply switch them off. The other options describe approval rules, credential storage, and scheduled container scanning, which are not what scan execution policies do.

  2. Question 5

    A group wants secret detection and dependency scanning to run in every project it owns, and project maintainers should not be able to turn those scans off through their own pipeline settings. Which feature should the group use?

    1. AA protected CI/CD variable that is set to false in each project's settings page
    2. BA scan execution policy that is defined in a security policy project and applied to the group
    3. CA branch protection rule that requires a passing pipeline before any merge to the default branch
    4. DA merge request approval rule that asks for a security reviewer to approve each change
    Show answer and explanation
    Correct answer: B

    A scan execution policy defined in a security policy project and linked to the group enforces the required scans across its projects. A variable can be changed by maintainers, a pipeline requirement does not add the scans, and an approval rule does not run any scanner.

  3. Question 6

    What is the purpose of a security policy project in GitLab?

    1. AA project that replaces the default branch of another project with a hardened, security-reviewed copy of its source code
    2. BA project that holds the container images that Container Scanning checks during each pipeline run
    3. CA dedicated project where security policies are stored and then linked to the groups or projects they govern
    4. DA shared project where developers keep personal CI templates that teams can copy for reuse
    Show answer and explanation
    Correct answer: C

    A security policy project holds policy definitions that are then linked to groups or projects, which apply them. The other options describe container image storage, branch replacement, and template sharing, none of which is the role of this project type.

Container Scanning (3 questions)

  1. Question 7

    A team builds a Docker image in a pipeline and wants the image checked for operating system package vulnerabilities before it is pushed to production. Which approach fits?

    1. AInclude the Container Scanning template and point its scan at the image that the build job produced
    2. BEnable DAST so it sends requests to the running container and reports any vulnerable packages found
    3. CEnable Secret Detection, which inspects the operating system package versions in each image layer
    4. DRun License Compliance against the Dockerfile to list the packages that the base image installs
    Show answer and explanation
    Correct answer: A

    The Container Scanning template analyzes a container image for known operating system package vulnerabilities, and it can be pointed at the image the build produces. DAST tests running applications, Secret Detection looks for credentials, and License Compliance reports license information rather than package vulnerabilities.

  2. Question 8

    Which two statements about container scanning results are accurate? (Choose two.)

    1. AResults list known vulnerabilities in operating system packages that are installed in the scanned image
    2. BFindings appear in the vulnerability report, where a reviewer can dismiss one with a reason if it does not apply
    3. CThe analyzer rewrites the image to remove every vulnerable package before the image is pushed to the registry
    4. DScanning works only on a container that is already running and cannot inspect an image before deployment
    Show answer and explanation
    Correct answer: A, B

    The analyzer reports known vulnerabilities in the operating system packages of the image, and those findings can be reviewed and dismissed in the vulnerability report. The analyzer does not rewrite images, and container scanning inspects the image itself, so the container does not need to be deployed first.

  3. Question 9

    A pipeline scans a container image that is stored in a private registry that requires login. Which configuration lets the Container Scanning analyzer pull the image?

    1. AProvide registry credentials to the analyzer through the CS_REGISTRY_USER and CS_REGISTRY_PASSWORD variables
    2. BMake the registry public for the duration of each scan so that the analyzer needs no credentials
    3. CCopy the image into the repository as a tarball committed alongside the application source files
    4. DRun DAST against the registry host so the scanner can authenticate to it through the web interface
    Show answer and explanation
    Correct answer: A

    The Container Scanning analyzer authenticates to a private registry with the CS_REGISTRY_USER and CS_REGISTRY_PASSWORD variables, and CS_IMAGE selects which image is scanned. Making the registry public exposes images, committing tarballs bloats the repository, and DAST tests running web applications rather than registries.

DAST (3 questions)

  1. Question 10

    What is the main difference between passive and active DAST scanning?

    1. APassive scanning observes responses without sending attack payloads, while active scanning sends attack payloads to the target
    2. BPassive scanning runs only on merge requests, while active scanning runs only on the default branch of the project
    3. CPassive scanning requires credentials for the target, while active scanning never needs any form of authentication
    4. DActive scanning reads the application source code, while passive scanning only inspects running container images
    Show answer and explanation
    Correct answer: A

    Passive scanning inspects traffic and responses without sending attack payloads, so it is gentler on a target, while active scanning sends attack payloads and can change data. The other options invent run locations, authentication rules, or inputs that do not match how DAST works.

  2. Question 11

    A DAST scan of a web application reports only the public login page because the scanner cannot reach the pages behind the login. What should the team configure?

    1. AA Container Scanning template that installs the login library into the built image
    2. BA longer scanner timeout so the scanner waits more patiently on the public login page to load
    3. CAn authentication configuration so the scanner logs in before it crawls the protected pages
    4. DA dependency list that adds the authentication library to the lockfile of the project
    Show answer and explanation
    Correct answer: C

    Authenticated DAST scans need an authentication configuration that logs the scanner in so it can reach pages behind the login. A longer timeout still stops at the login page, and container and dependency settings do not affect what the scanner can crawl.

  3. Question 12

    A team wants to run DAST against a fragile staging site and needs the scan to send only non-intrusive requests. Which setting should they choose?

    1. AA secret detection rule set that scans the HTTP response headers returned by the staging site
    2. BA full active configuration with every check enabled and no limits on the request rate
    3. CA dependency scan that reads the package manifest from the staging site over an open connection
    4. DA passive-only configuration in the scanner profile, with active attack checks left turned off
    Show answer and explanation
    Correct answer: D

    A passive-only scanner profile observes responses without sending attack payloads, which suits a fragile environment. Enabling every active check is intrusive, and dependency or secret detection scans do not test a running site at all.

Dependency Scanning (3 questions)

  1. Question 13

    What is a software bill of materials (SBOM)?

    1. AA record of every merge request approval that was given during a single development sprint
    2. BA list of developers who are approved to merge changes into the protected branches of a project
    3. CAn inventory of the components and their versions that make up a software product or build
    4. DA set of firewall rules that restrict which outbound destinations build runners may contact
    Show answer and explanation
    Correct answer: C

    An SBOM lists the components, versions, and related metadata that a software product is built from, which helps teams find affected packages when a new advisory appears. The other options describe reviewer lists, approval records, and network rules rather than a component inventory.

  2. Question 14

    Which two statements about running dependency scanning without outbound internet access are accurate? (Choose two.)

    1. AThe scanner needs its vulnerability advisory data available locally, so the team must provide a mirrored copy of it
    2. BDependency manifests and lock files in the repository can still be analyzed locally with no outbound connection
    3. CThe scanner cannot read lock files, so a package list must be sent to the security team by email each time
    4. DResults are produced only when the runner can reach a public vulnerability website during every single run
    Show answer and explanation
    Correct answer: A, B

    Offline scanning depends on a local copy of the advisory data, while manifest and lock files in the repository are read locally. The other two options invent email-based input and a requirement for live internet access, which contradicts offline use.

  3. Question 15

    Why do dependency scanners work from lock files as well as top-level manifests?

    1. ALock files contain the source code of each dependency so the scanner can read it directly from the repository
    2. BManifests cannot name any packages, so lock files are the only place where package names appear in a project
    3. CLock files are encrypted by the package manager, so the scanner needs them to decrypt the top-level manifest
    4. DLock files record the exact resolved versions of direct and transitive dependencies, so matching is more precise
    Show answer and explanation
    Correct answer: D

    Lock files pin the exact versions that a build installs, including indirect dependencies that a top-level manifest may not show, so matching against advisories is more precise. The other options misstate what lock files contain and how manifests work.

Secret Detection (3 questions)

  1. Question 16

    A developer removed an API token from a file in the latest commit, but the same token still exists in an earlier commit on the branch. Secret detection on the new commit reports nothing. What is the best next step?

    1. ADelete the branch and recreate it from the default branch so the old commits are discarded
    2. BIgnore the finding because the current version of the file no longer contains the token
    3. CAdd the file name to the SAST excluded paths so the historical commits are no longer analyzed
    4. DRevoke and rotate the token immediately, because it remains readable in the branch history
    Show answer and explanation
    Correct answer: D

    The token is exposed in history, so the value must be treated as compromised and rotated or revoked even though the file was cleaned. Ignoring it, excluding the file from SAST, or recreating the branch does not make the leaked value safe.

  2. Question 17

    Why is rotating a leaked credential usually necessary even after the secret is removed from the code in a newer commit?

    1. AGit cannot store files that were removed in a later commit, so the old value is lost from storage
    2. BAnyone who already copied the credential can keep using it until the provider revokes or replaces it
    3. CRemoving the text from the repository automatically disables the credential at the provider
    4. DSecret detection scans only branches, so the removed value stays hidden from the rest of the team
    Show answer and explanation
    Correct answer: B

    A credential that appeared in code should be assumed compromised, and deleting it from a later commit does not revoke it at the service that issued it. The other options misstate how Git history and provider access work.

  3. Question 18

    A company issues internal API tokens in a format that the default secret detection rules do not recognize. The security team wants every project to flag that format. What should they do?

    1. AAsk developers to write the token format into a code comment so the scanner can match the pattern
    2. BAdd a custom detection rule to a secret detection ruleset file that the scanner reads for the project
    3. CDisable secret detection and rely on code reviewers to notice the new token format by hand
    4. DRename the internal token prefix to match a default rule that the scanner already recognizes today
    Show answer and explanation
    Correct answer: B

    Custom detection rules let a team teach the scanner a new credential format, and the scanner then applies them during scans. Comments, manual review alone, or renaming tokens to fit existing rules do not give consistent detection, and disabling the scanner removes coverage.

IaC Scanning (3 questions)

  1. Question 19

    Which kinds of files does GitLab's IaC scanning analyzer target?

    1. AInfrastructure definitions such as Terraform, CloudFormation, and Kubernetes manifest files
    2. BCompiled Java and .NET binaries that are deployed to application servers in production
    3. CMobile application packages that are submitted to the public app stores for distribution
    4. DDatabase backup archives that are copied to object storage buckets on a nightly schedule
    Show answer and explanation
    Correct answer: A

    IaC scanning checks infrastructure-as-code files for misconfigurations, such as Terraform, CloudFormation, and Kubernetes definitions. Compiled binaries, app store packages, and backup archives are not infrastructure definitions.

  2. Question 20

    The IaC scanner reports one rule on many Terraform files that the platform team has formally decided does not apply to its environment. What is the most appropriate way to handle the rule project-wide?

    1. ADisable that specific rule through a custom ruleset configuration kept in the repository, and record the reason
    2. BTurn off IaC scanning for the whole project so that none of the other rules produce findings either
    3. CRename every Terraform file with a different extension so that the analyzer no longer recognizes them
    4. DDismiss each finding one by one every time a pipeline runs and recreates them in the report
    Show answer and explanation
    Correct answer: A

    A custom ruleset configuration in the repository can disable an individual rule while the remaining rules keep running, and the change is versioned and reviewable. Turning off the whole scanner or hiding files removes coverage, and dismissing repeatedly is manual work that does not change what the analyzer runs.

  3. Question 21

    Which problem does IaC scanning mainly help a team prevent?

    1. AOutdated compiler versions on developer laptops that build the application from source code locally
    2. BContainer images being pushed to the registry with tags that are too long for the naming policy
    3. CMisconfigured cloud or cluster resources, such as publicly readable storage, being deployed from code
    4. DMerge requests being approved by reviewers who sit outside the team that owns the project code
    Show answer and explanation
    Correct answer: C

    IaC scanning analyzes infrastructure-as-code definitions for insecure settings before they are deployed, such as publicly readable storage. Compiler versions, registry tag lengths, and reviewer membership are not infrastructure configuration problems.

License Compliance (3 questions)

  1. Question 22

    What is the main purpose of license compliance scanning in GitLab?

    1. AValidating that the marketing pages of the product display the correct copyright notice text
    2. BChecking that every developer who has committed to the project has signed a contributor agreement
    3. CConfirming that container images use only an open source base operating system for production
    4. DIdentifying the licenses of dependencies so teams can spot restricted or unapproved ones
    Show answer and explanation
    Correct answer: D

    License compliance identifies the licenses attached to dependencies so that restricted or unapproved licenses can be flagged. Contributor agreements, base image choice, and copyright text are separate concerns that this feature does not check.

  2. Question 23

    A product team learns that a new npm dependency uses a license their legal team forbids for distribution. They want merge requests that add it to be blocked until someone reviews them. Which setup accomplishes this?

    1. AA CODEOWNERS entry that names the legal team as the owner of the README file in the repository root
    2. BA protected branch rule that requires a second developer to push each commit to the main branch
    3. CA license policy that denies the license, enforced through a merge request approval rule
    4. DA pipeline schedule that emails the legal team every Monday with the latest license report for the project
    Show answer and explanation
    Correct answer: C

    A license policy that denies the license, combined with an approval rule, makes matching merge requests wait for review. A branch rule, an unrelated code owner entry, or a scheduled email does not block a denied license from being merged.

  3. Question 24

    In a license policy, what does it mean when a license is marked as denied?

    1. AThe license may be used only inside internal projects and must not be shared with external contributors
    2. BDependencies that carry the license are flagged because the organization does not allow them
    3. CThe license is removed from the repository automatically during the next pipeline run
    4. DThe license file must be stored on a separate protected branch before the project can be built
    Show answer and explanation
    Correct answer: B

    A denied license means the organization has decided that dependencies carrying it are not allowed, so matching dependencies are flagged. The other options describe internal-only use, automatic removal, or branch storage, which are not what a denied license means.

Merge Request Approval Policies (2 questions)

  1. Question 25

    A policy must require an additional security approver whenever a merge request introduces a critical vulnerability. Which kind of approval rule accomplishes this?

    1. AA CODEOWNERS entry that names the security team as owner of every file in the repository root
    2. BA role-based rule that adds every Maintainer to each merge request automatically as an approver
    3. CA security-based approval rule that triggers when scan results meet a chosen severity condition
    4. DA branch protection setting that blocks any push that changes files on the default branch
    Show answer and explanation
    Correct answer: C

    A security-based approval rule in a merge request approval policy is triggered by scan results, such as a severity threshold, so the extra approver is required when the condition is met. Role-based rules, blanket code owner entries, and push restrictions do not respond to the vulnerability findings in the merge request.

  2. Question 26

    What does a role-based approval in a merge request approval policy accomplish?

    1. AIt makes sure only members of the group that owns the default branch can approve any change
    2. BIt gives each reviewer a security clearance level that limits which files they are allowed to view
    3. CIt requires approval from users who hold a specified project role, such as Maintainer or Developer
    4. DIt lets the author of a merge request approve their own change when the author holds a privileged role
    Show answer and explanation
    Correct answer: C

    Role-based approvals name project roles whose members must approve, which gives a policy a reusable way to target reviewers. The other options invent clearance levels, group ownership rules, or self-approval, none of which describes this approval type.

DevSecOps Lifecycle (2 questions)

  1. Question 27

    What does shift-left mean in a DevSecOps program?

    1. AMoving secrets out of protected variables and into the source code repository for easier audits
    2. BMoving security reporting duties to the end of each quarter so the review covers a longer period
    3. CMoving production deployments to the start of each sprint so that testing finishes sooner
    4. DMoving security checks earlier in the lifecycle so issues are found while they are cheaper to fix
    Show answer and explanation
    Correct answer: D

    Shift-left means running security practices such as scanning and threat review early in development, when fixes are typically cheaper. The other options move reporting or deployments to later points, and moving secrets into the repository is an unsafe practice.

  2. Question 28

    A compliance team needs evidence that the required security scans ran for every release. Which GitLab capability is designed for this need?

    1. AA personal calendar note that a developer updates after each release to record the scan dates
    2. BA wiki page that developers edit by hand after each release to list the security checks they ran
    3. CCompliance reporting through compliance frameworks, which tracks required controls across projects
    4. DThe commit message of each release tag, which developers edit by hand to note the checks that ran
    Show answer and explanation
    Correct answer: C

    Compliance frameworks and their reports give auditors a consistent view of controls across projects, which is stronger evidence than manually maintained notes. Calendar notes, wiki pages, and tag messages are manual records that are easy to omit or change.

API Security Testing (2 questions)

  1. Question 29

    A team wants to fuzz a REST API that is described by an OpenAPI document, and the API runs in a staging environment. Which GitLab capability fits this request?

    1. ALicense compliance that checks the OpenAPI document for license headers in its descriptions
    2. BDependency scanning that reads the OpenAPI document to list the package versions it names
    3. CSecret detection that scans the OpenAPI document for tokens that might have leaked into examples
    4. DAPI fuzzing that uses the OpenAPI document to define the endpoints and parameters to test
    Show answer and explanation
    Correct answer: D

    API fuzzing can use an OpenAPI specification to discover the endpoints and parameters of the target API, then send varied inputs to it. Dependency, secret, and license scanners do not fuzz or exercise a running API.

  2. Question 30

    A team runs API fuzzing on every merge request and also on a nightly schedule. Why might it choose a longer, more thorough fuzzing setting for the nightly run and a shorter one for merge requests?

    1. AMerge request pipelines cannot run API fuzzing at all, so only the nightly scheduled run produces real results
    2. BA longer run tests more operations and inputs but takes more pipeline time
    3. CA shorter run uses much stronger attack payloads than a longer one, so it is reserved for the faster merge request pipelines
    4. DLonger runs remove the need for any API specification, so they are used whenever no OpenAPI file exists for the target
    Show answer and explanation
    Correct answer: B

    Fuzzing thoroughness trades off against run time: more inputs and operations find more issues but lengthen the job, so quick settings fit merge requests and longer settings fit scheduled pipelines. Fuzzing can run in merge request pipelines, payload strength is not tied to shortness, and fuzzing still needs an API description or target.