Warning
DEPRECATED: This repository is deprecated and no longer maintained. Please migrate to the official CrowdStrike container scanning action: CrowdStrike/fcs-action
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 SCMand 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_REGIONto 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 thePipelineoption, and selectOK - Scroll to the
Pipelineheading 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 Nowoption 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.ymland adjust the values forFALCON_CLOUD_REGIONandCONTAINER_REPOto fit your needs. - Browse to the
Pipelines->Librarymenu and add a variable group namedcs_falcon_vars. - Add the
FALCON_CLIENT_IDandFALCON_CLIENT_SECRETvariables and save - Create a Service Connection on the Project for
Docker Registryand name itDockerHubfor the Service Connection Name. - Navigate back to
Pipelines->Pipelinesand Create a pipeline - Use the Azure Repos Git
- Choose the
image-scan-examples.gitrepo in your Project - Choose
Existing Azure Pipeline YAML fileand select the fileazure-pipeline.ymlin 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_USERandDOCKER_PASSWORD - Navigate back to
<> Code->.github/workflowsand editimage-scan.yaml - Adjust the
FALCON_CLOUD_REGIONand theCONTAINER_REPOvariables 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