Playbook Remediation

What is Playbook Remediation?

Playbook Remediation helps you easily address some Warden findings by running a code playbook to remediate an issue rather than having to go through a manual process to do so. This helps you cut down the time spent on fixing issues within your cloud environment, leading to an improved security posture as more issues can get addressed.

Pre-Requisites

For AWS Playbooks:

  • AWS Software Development Kit for JavaScript in Node.js (AWS-SDK)
  • IAM credentials with sufficient permissions to run the playbooks
  • AWS-CLI environment set up to use the IAM credentials

For GCP Playbooks:

  • A service account with sufficient permissions OR Google Cloud SDK
  • Node.js Google APIs (each playbook has its own set of requirements)

Setup

First, install Node.js on your computer. Once installed, you should be able to run `node` (which runs the playbooks) and  `npm` (which installs and manages Node.js packages in your system).

For AWS Playbooks:

  1. Setup an IAM User or Role with the permissions needed to run the playbooks. Each playbook contains information about the permissions the user or role needs. 
  2. Setup your AWS CLI environment such that they can authenticate against AWS using an AWS_PROFILE.
  3. Install the AWS-SDK through npm.
npm install aws-sdk

For GCP Playbooks:

Method 1: Create a Service Account

1. Create or use a GCP Service Account with permissions needed to run the playbooks. Each playbook contains information about the permissions the user or role needs.

2. Set the GCP service account key as an environment variable.

Linux/MacOS:

export GOOGLE_APPLICATION_CREDENTIALS="[PATH TO JSON KEY]"

Windows CMD:

set GOOGLE_APPLICATION_CREDENTIALS=[PATH TO JSON KEY]

3. Make sure to enable the APIs needed for the playbook to run.

Method 2: Use GCloud CLI

1. Authenticate to your GCP project using the following command: 
gcloud auth login

A browser window should appear. Once this happens, select the Google account that’s part of the project you want to run the remediation on.

2. Configure the project you want to run playbooks on:

gcloud config set project <PROJECT_ID>
3. Make sure to enable the APIs needed for the playbook to run.