Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions cfg_analyzers/gcp/enable_disable_checkers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,36 @@ Where the first argument is the action you wish to perform, and the second argum
If the Lacework CLI is not configured to the same lacework-tenant provided in the ARGs the command will fail.

This script also generates an updated version of the checker maps based on the recommendations(checkers) deployed to the target environment.



### Example of end-to-end usage to disable all report checks and enable the new ones

```text
python3 -V
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the use of python3? We recommend using pyenv virtualenv to manage python versions.
Provided pyenv virtualenv is installed locally, you should just be able to run this script to configure the correct python version https://github.com/lacework-dev/scripts/blob/main/cfg_analyzers/gcp/enable_disable_checkers/pyenv-init.sh

#check you are running at least python 3.8

lacework configure show
#if CLI is not installed, do:
#curl https://raw.githubusercontent.com/lacework/go-sdk/main/cli/install.sh | bash
#lacework configure

wget https://raw.githubusercontent.com/lacework-dev/scripts/main/cfg_analyzers/gcp/enable_disable_checkers/gcp-cis-config.py
LW_ACCOUNT=yourlaceworkaccountname
python3 gcp-cis-config.py disable_cis_12 $LW_ACCOUNT
python3 gcp-cis-config.py enable_cis_12 $LW_ACCOUNT
```

Replace `yourlaceworkaccountname` with your Lacework subdomain (without the `.lacework.net`).

Once the new rules have been activated, either wait 24h or manually run a new Compliance Report.

```text
lacework compliance google run-assessment $(lacework compliance google list --json | jq -r ".gcp_projects[0].organization_id")
```

This script can also be used to disable and enable Lacework custom rules, Kubernetes rules, and all rules.. Run the script with the `-h` flag to see the options available:

```text
python3 gcp-cis-config.py -h
```