All of the CI examples rely on an existing DockerHub repo that you control and have the ability to push the container images being built. This repo should exist before getting started. This repo value will be used in the CONTAINER_REPO
variable throughout the examples. You will also need a personal access token to be used for the DockerHub password in all pipelines.
The pipeline examples use the Dockerfile inside this repository for build purposes.
The <repo_name>
tag listed in the pipeline examples file will need to be updated with a repo that is accessible via the docker login credentials outlined in the below example specific instructions.
The FALCON_CLOUD_REGION
variable may also need to be changed to accommodate your Falcon Platform region. The current setting is for us-2
.
These pipeline examples were built to showcase the docker build
with a subsequent image scan handled by the CrowdStrike Image Scan API.
- The Jenkinsfile is intended to be built as a Jenkins Pipeline Job using
Pipeline script from SCM
and the default settings.
- Github
Github credentials will need to be added to Jenkins Global Credential Manager as the ID of github
. This should be the username and a personal access token added with all repo
and child object permissions. Personal access tokens can be created at https://github.com/settings/tokens.
- ImageRegistry
This example uses DockerHub as the image registry. DockerHub credentials will need to be added to the Jenkins Global Credential Manager with the ID of dockerhub
.
- Falcon API
Falcon API credentials will need to be added as two credentials in the Jenkins Global Credential Manager as Kind 'secret text' with the IDs FALCON_CLIENT_ID
and FALCON_CLIENT_SECRET
. OAuth2 API client and keys can be created at https://falcon.crowdstrike.com/support/api-clients-and-keys.
- Fork the repo
- Modify the
<repo_name>
tag and perhaps theFALCON_CLOUD_REGION
to suite your needs - Log into your Jenkins instance
- Browse to
Manage Jenkins
->Manage Credentials
->(global)
- Add the required credentials listed above
- Browse back to the main dashboard
- Select
New Item
- Name your new item
Image Scan Pipeline
, select thePipeline
option, and selectOK
- Scroll to the
Pipeline
heading and change the definition drop down toPipeline script from SCM
- Change the SCM option to
Git
- Paste your forked repo URL into the
Repository URL
- Select your credentials for github
- Select
Save
- Use the
Build Now
option to build the pipeline
This pipeline implies a variable group named cs_falcon_vars
with the following secret variables.
FALCON_CLIENT_SECRET
and FALCON_CLIENT_ID
These variables should be secret variables and Allow access to all pipelines disabled.
These variables could also be added directly to the pipeline as secret variables in a similar manner however that is not covered in this example.
This also uses an authenticated docker registry service connection on the project named 'DockerHub'
This example repo should be added as an Azure Devops repo with an existing pipeline using the 'azure-pipeline.yml' file located in the base directory.
- Import this github repo into an existing Azure Devops project.
- Edit
azure-pipeline.yml
and adjust the values forFALCON_CLOUD_REGION
andCONTAINER_REPO
to fit your needs. - Browse to the
Pipelines
->Library
menu and add a variable group namedcs_falcon_vars
. - Add the
FALCON_CLIENT_ID
andFALCON_CLIENT_SECRET
variables and save - Create a Service Connection on the Project for
Docker Registry
and name itDockerHub
for the Service Connection Name. - Navigate back to
Pipelines
->Pipelines
and Create a pipeline - Use the Azure Repos Git
- Choose the
image-scan-examples.git
repo in your Project - Choose
Existing Azure Pipeline YAML file
and select the fileazure-pipeline.yml
in the drop down and press continue - Select Run
- Falcon API
Falcon API credentials will need to be added as two repository secrets with the IDs FALCON_CLIENT_ID
and FALCON_CLIENT_SECRET
. OAuth2 API client and keys can be created at https://falcon.crowdstrike.com/support/api-clients-and-keys.
- ImageRegistry
This example uses Docker Login based GitHub action and therefore requires access token based username and password secrets. DockerHub credentials will need to be added to the repository secrets as DOCKER_USER
and DOCKER_PASSWORD
.
- Fork the repo
- Click on the repo
Settings
->Secrets
->New Repository Secret
- Add Secrets for
FALCON_CLIENT_ID
,FALCON_CLIENT_SECRET
,DOCKER_USER
andDOCKER_PASSWORD
- Navigate back to
<> Code
->.github/workflows
and editimage-scan.yaml
- Adjust the
FALCON_CLOUD_REGION
and theCONTAINER_REPO
variables to fit your needs - Commit the repo changes
NOTE: GitHub Action workflow is set to run only in the main
branch.
All information for this example is located in the aws-codebuild-terraform and CodeBuild is ran using the buildspec.yml