Integrate Application Security with your AWS CodeBuild instance to allow dynamic, automated, and context-specific scans within your development workflow. This includes continuous scanning of your workflow whenever changes are pushed or triggered, integrating security checks, and catching issues as soon as they are introduced. Additionally, it automates shift-left actions such as notifying developers or creating tickets, based on scan results.
Prerequisite
Before you begin:
Onboarding steps
On the Cortex XSIAM console:
Search for and hover over AWS CodeBuild, and click Add, or Add Another Instance if an instance is already onboarded.
On the Add Environment Variables step of the AWS CodeBuild integration wizard.
Select .
The API key secret and API key ID values are generated and populate their respective fields.
Select the system architecture that your tool runs on.
Click .
Store your generated Cortex XSIAM API key and API key ID in AWS Secrets Manager.
If you have an API key.
Copy the CORTEX_API_KEY and CORTEX_API_KEY_ID variable names from their respective fields in the wizard.
Add the CORTEX_API_KEY and CORTEX_API_KEY_ID and their corresponding values as separate environment variables (secrets) to the AWS Secrets Manager.
If you do not have an API key:
→ .
Add the CORTEX_API_KEY and CORTEX_API_KEY_ID and their corresponding values as separate environment variables (secrets) to the AWS Secrets Manager.
Note
Do not change the names of the environment variables provided by Cortex XSIAM. They are required for proper integration and functionality.
For more information on storing secrets in AWS Secrets Manager, refer to AWS Secrets Manager Documentation.
Grant the IAM service role associated with your AWS CodeBuild project the necessary permissions to read the Cortex XSIAM API key and Cortex XSIAM API key ID from AWS Secrets Manager.
Copy and paste the pre-populated sample code from the Configure Subscription step of the integration wizard into your
buildspec.yamlconfiguration.Note
The code is only a reference. Replace the placeholder values with your build-specific values.
Select in the wizard.
Ensure that the Connector Created Successfully message is displayed in the final step of the wizard, and click Close.
Verify integration and confirm that the your integrated AWS CodeBuild instance has a status of Connected.
On the Data Sources & Integrations page, search for AWS CodeBuild in the search bar.
Hover over the resulting entry and click .
Verify that the status of your AWS CodeBuild instance is Connected.
Next step: View scan results and mitigate issues.
AWS CodeBuild code scan workflow template
This AWS CodeBuild workflow example automates code scanning using the Cortex CLI. The workflow contains placeholder values (often in brackets) and generic terms (such as dev) that you must replace with your environment-specific information before use.
Manage data source integrations
Manage integrations to align with evolving requirements and ensure they remain current.
Navigate to → and use the Vendor filter to located the required integration.
Select your vendor from the list.
The integrated instances for the selected vendor are displayed.
Right-click on an instance and select an option:
: Redirects to the Select Repositories step of the integration wizard, where you can modify configurations for the selected instance. For more details, refer to the relevant integration guide
: When confirmed, deletes the instance, including data from previous scans
Copy entire row – Copies all column values for the selected row to the clipboard.