How should configuration be exposed while using scanners?

Prepare for the GitLab Certified Associate Exam with informative questions and flashcards. Each question includes hints and detailed explanations to help you succeed!

Exposing configuration as CI/CD variables is considered best practice for several reasons. CI/CD variables provide a secure and manageable way to store sensitive information, such as API keys, passwords, and other configuration settings, that various parts of your pipeline may need to access during execution.

By using CI/CD variables, you can control the scope of access, environment visibility, and modification without hardcoding sensitive data into your scripts or files, which helps prevent potential security leaks. Additionally, CI/CD variables can be easily managed through the GitLab interface, allowing for quick adjustments without modifying the codebase or configuration files directly.

Moreover, CI/CD variables enhance flexibility because you can define different values for different environments (production, staging, etc.) and change them as needed without altering the source code. This aligns well with the principles of infrastructure as code and helps maintain clean code practices.

In contrast, other choices focus solely on file-based configurations or environment variables alone, which may not provide the same level of security, manageability, and environment-specific customization as CI/CD variables do. This makes them less effective for handling configurations needed by scanners in CI/CD pipelines.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy