Azure DevOps (beta)
This topic describes functionality that is currently in beta.
To integrate the Lacework IaC scanner with an Azure DevOps repository, you need to edit the azure-pipelines.yml file that is located in the root of your repository.
Obtain Secret Values
To integrate with Azure DevOps, you must first collect the values for LW_ACCOUNT, LW_API_KEY and LW_API_SECRET. To view this information:
- Log in to the Lacework Console.
- Click Settings > API keys.
- Select or create an API key.
- Click the download icon.
- Open the downloaded .json file to view your API Key and Secret.
Add Variables to Azure DevOps
Once you have obtained the values for LW_ACCOUNT, LW_API_KEY and LW_API_SECRET, you must add and set up the env to allow the scanning step to access them. Use the following steps to add the variables in Azure DevOps:
For each secret (LW_ACCOUNT, LW_API_KEY and LW_API_SECRET):
- Log in to Azure DevOps.
- Click Pipelines > Pipelines.
- On your pipeline, click the three dot more actions menu.
- Click Edit.
- Click Variables.
- Click New variable.
- Enter the name for the variable and the value.
- Click OK.
- Repeat for each variable and then click Save.
Example Azure DevOps Pipeline
The following example pipeline includes a single IaC scanning step.
trigger:
- main
pool:
vmImage: ubuntu-20.04
steps:
- script: |
echo "Running Lacework IaC checks."
docker run \
-e SCAN_COMMAND=tf-scan \
-e LW_ACCOUNT=$(LW_ACCOUNT) \
-e LW_API_KEY=$(LW_API_KEY) \
-e LW_API_SECRET=$(LW_API_SECRET) \
-v $(Build.SourcesDirectory):/app/src \
-e WORKSPACE=src \
-e EXIT_FLAG='high' \
docker.io/lacework/codesec-iac:latest
The Lacework IaC scanner comes pre-packaged as a Docker container.
Usage Variables
The previous example uses SCAN_COMMAND, WORKSPACE and EXIT_FLAG. Visit CI/CD Usage for more information. You can use these variables to configure the behavior of the scanner depending on your scenario.
Results
To view the results of this CI/CD integration in the Lacework Console, you must follow the assessment URL which is output by the scanner.
The assessment is not displayed in the Assessments > Pipelines tab.