Keyboard Time: 20 mins, Automation Wait Time: 10 mins
Scenarios: Instructor-Led, Self-Paced
Add security scanning and dynamic review environments. Per-branch dynamic environments are required for all scanning types that need an active copy of the application - DAST, IAST, Fuzzing and Accessibility Auditing all fall in this category. Dynamic environments can also be used for human review and testing.
Use the Pipeline Editor and its Lint feature.
Update the Application Build project to add Auto DevOps (Runner Push Deployment) with the GitLab Agent cluster connection method.
Track the progress of the build through security scanning, staging environment and ‘production’ environment. (Production in this case means that the Application container is production ready.)
Through both environments of the Environment Deployment project using the background page color.
In this Lab you will update the application project to have a review application and perform security scanning.
Open ‘yourpersonalgroup/hello-world’
In the left navigation, Click CI/CD => Editor
You will be editing YAML - be careful that tabbing is properly aligned. Only removing the comment character (“#”) should result in proper tabbing.
Under include:
uncomment - template: Auto-DevOps.gitlab-ci.yml
which should make the section look like this.:
include:
- local: .gitlab/ci_includes/increment_semver.gitlabci.yml
- template: Auto-DevOps.gitlab-ci.yml
Under variables:
uncomment the variables indicated below at the top of the section. There will be additional variables in the section - starting with NEXTVERSION:
- that must be left as-is.
variables:
BUILD_DISABLED: 'true'
TEST_DISABLED: 'true'
POSTGRES_ENABLED: 'false'
CODE_QUALITY_DISABLED: 'true'
MANUAL_PROMOTE: 'true'
STAGING_ENABLED: '' #empty disables staging
DAST_DISABLED: 'true'
BROWSER_PERFORMANCE_DISABLED: 'true'
NEXTVERSION: 'read-from-registry'
...
Immediately above determine-version:
, uncomment the following segment. The keyword container_scanning
should start completely to the left edge and each level indented 2 spaces.
container_scanning:
variables:
GIT_STRATEGY: fetch
Above the editing area, Click the word Validate
Near the bottom center of the page, Click Validate pipeline (button)
You should have a green banner that says “Syntax is correct”
In the same top navigation area, Click Edit
On a blank line Type this is an error
Above the editing area, Click the word Validate
Near the bottom center of the page, Click Validate pipeline (button)
You should have a red banner that says “Syntax is incorrect”
Make a mental note of the line number and column noted in the grey box.
In the same navigation area, Click Edit
Find the line number and Delete this is an error
Above the editing area, Click the word Validate
Near the bottom center of the page, Click Validate pipeline (button)
You should have a green banner that says “Syntax is correct”
In the same navigation area, Click Edit
Click Commit changes
In the left navigation Click Hello World (The project name banner)
Click CI/CD => Pipelines
Open the most recent non-skipped pipeline by clicking [the pipeline Status badge] or [the pipeline #]
[Automation wait: ~7 min] While you wait for the GitLab deployment to staging to complete, notice these things:
There are multiple security tests under the “Test” stage.
A special environment is deployed by the “Review” stage for DAST testing by the “Dast” stage.
The “Cleanup” stage will run to tear down the dast environment even before you approve the production deployment
The “promote-image-to-latest-prod” job no longer runs automatically, but will require a manual play button activation.
Click Deployments => Environments
On the ‘staging’ line, to the right, Click Open
If SSL is not yet resolving, click the “advanced” option and open the site anyway.
In the browser tabs, Click [the tab with environments]
Return to the same pipeline (Browser Back Control may take you there)
For the job ‘production_manual’, Click [the Play button]
[Automation wait: ~3 min] Wait for the browser_performance job to complete successfully and the Play button to appear on the ‘promote-image-to-latest’ job.
IMPORTANT: For the job ‘promote-image-to-latest’ Click [the Play button]
Click Packages & Registries => Container Registry
Click [the line ending in ‘/main’]
Search for the latest-prod tag
It should have been built in the last 15 minutes. There should also be a new version tag with the same value for ‘Digest’
Use the Pipeline Editor and its Lint feature.
Update the Application Build project to add Auto DevOps (Runner Push Deployment) with the GitLab Agent cluster connection method.
Track the progress of the build through security scanning, staging environment and ‘production’ environment. (Production in this case means that the Application container is production ready.)
Through both environments of the Environment Deployment project using the background page color.