Secrets Scanning
Lacework’s Software Composition Analysis (SCA) tool can detect secrets found in your software project files. Secrets scanning can help ensure the security posture and integrity of your software is not compromised.
Lacework’s SCA tool can be configured to identify and report abnormal or compromised secrets, such as tokens or keys. Secrets scanning helps ensure that unauthorized users or components do not have access to your software projects.
Run SCA to Scan for Secrets
To scan for secrets in your software project, use the -secret flag with your SCA command.
Create a Custom Scan for Secrets
To create a custom scan for secrets in your code project, for example, to scan for secrets matching a specific path, you must configure the sca.config.yaml file. You can use our example configuration as a template, or create your own.
The sca.config.yaml File
Lacework SCA currently relies on a YAML-based configuration. The advantage of the YAML-based configuration is that you can create custom rules for secrets. These rules can help you search for patterns, abnormal, or matching secrets. In the future, we plan to have a UI-based policy management system.
By default, Lacework SCA looks in the following directory for the config.yaml file:
<SCAN_DIR>/.lacework/codesec.yaml
Example Configuration
The following code block is an example configuration to scan for a specific secrets path:
default:
sca:
secret: true
license-categories-not-allowed: [ forbidden, restricted ]
custom-secrets:
- id: rule1
category: general
title: Generic Rule
severity: HIGH
regex: (?i)(?P<key>(secret))(=|:).{0,5}['"](?P<secret>[0-9a-zA-Z\-_=]{8,64})['"]
The above example features our SCA License Scanning.
Create an SCA Secret Scan Configuration
A custom rule for secrets scanning must include the following information:
id- an identifier for the rule.category- the stringcategoryyou create for the ruletitle- a name for the rule.severity- the severity assigned to the rule (CRITICAL,HIGH,MEDIUM,LOW,INFO)regex- Golang expression for secret detection.
Detectable Secrets
The following table details the available secret categories and the secrets they detect:
| Category | Detectable Secrets |
|---|---|
AWS |
|
GitHub |
|
GitLab |
|
AsymmetricPrivateKey |
|
Shopify |
|
Slack |
|
Google |
|
Stripe |
|
PyPI |
|
Heroku |
|
Twilio |
|
Age |
|
Facebook |
|
Twitter |
|
Adobe |
|
Alibaba |
|
Asana |
|
Atlassian |
|
Bitbucket |
|
Beamer |
|
Clojars |
|
ContentfulDelivery |
|
DATABASE |
|
Databricks |
|
Discord |
|
Doppler |
|
Dropbox |
|
Duffel |
|
Dynatrace |
|
Easypost |
|
Fastly |
|
Finicity |
|
Flutterwave |
|
Frameio |
|
GoCardless |
|
Grafana |
|
HashiCorp |
|
HTTP |
|
HubSpot |
|
Intercom |
|
Ionic |
|
Linear |
|
Lob |
|
Mailchimp |
|
Mailgun |
|
Mapbox |
|
MessageBird |
|
NewRelic |
|
Npm |
|
Planetscale |
|
Postman |
|
Pulumi |
|
RubyGems |
|
SendGrid |
|
Sendinblue |
|
Shippo |
|
LinkedIn |
|
Twitch |
|
Typeform |
|