GitLab Certified Associate Practice Exam 2025 – 400 Free Practice Questions to Pass the Exam

Question: 1 / 400

Why should the before_script not be used in security job definitions?

It may complicate the CI/CD process

It can lead to poor project organization

Users may rely on it to prepare their projects for scanning

The rationale behind avoiding the use of before_script in security job definitions centers on the potential for users to depend on it for preparing their projects for scanning. The before_script is typically designed for setting up environments or installing dependencies that are required for running the main job scripts in a CI/CD pipeline. However, for security jobs specifically, relying on before_script can create issues, as it might lead to inconsistency in security posture and scanning processes.

Security jobs need to execute standardized scans that reflect the actual project state without the influence of additional setup processes that may vary between runs. If users start depending on before_script to configure or prepare their code for scanning, this could yield unreliable results. It may imply varying environments or executions, ultimately leading to a false sense of security regarding their code's safety.

In contrast, security jobs should be executed in a clean and controlled environment to ensure that they accurately reflect the project's security status without any pre-processing that could alter the results. This reinforces the premise that reliance on before_script in this context should be avoided to maintain the integrity and reliability of security scans.

Get further explanation with Examzify DeepDiveBeta

It is not supported in GitLab's environment

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy