Checkov scans our Terraform configuration to identify security issues affecting our infrastructure.
Checkov can identify hundreds of security issues that might impact our infrastructure, and therefore has the potential to significantly improve our security posture before the affected infrastructure is deployed.
Checkov runs against the infrastructure repository via GitHub Actions.
This GitHub checks will fail your PR and should (in most cases) prevent you from merging in resource specifications until the issues that Checkov has raised are either resolved or skipped.
Ideally, issues raised by Checkov should be resolved by following the advice suggested in the guideline
section of the GitHub Action output. Simply updating your PR with the corrected Terraform should be enough in these cases.
In some cases, Checkov might return a false positive – something it thinks is an issue, but which doesn’t affect Sourcegraph do to the specific way our infrastructure is configured. In other cases, Checkov might report an issue that will take too long to resolve given business needs.
In these cases, you can add a Checkov skip for the individual issue that Checkov has identified. You can find the relevant instructions in the ‘Suppressing individual checks’ section on the Checkov website, or look at some existing skips within our repositories. If you add a skip, please tag the Security team in your updated PR, so that we can approve the change and track the resulting issues where necessary.
Checkov is unfortunately currently configured with both global and local skips, and some of the reasons for the global skips are undocumented.
If you are approached with a request to add a Checkov skip, or tagged in a PR that adds a Checkov skip, your workflow should be as follows:
We do not add any new global skipped checks unless there is a pressing business reason to do so. Global skip checks are configured directly within the GitHub Action. Speak to the Security Lead if you have a need to do this.
A partial list of globally skipped checks can be found here. This list includes planned remediation work for these checks. If you are adding a globally skipped check then please keep this list updated.