Skip to content

Commit

Permalink
update to standards (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
judell authored Aug 2, 2024
1 parent e4dadab commit 5ed6e75
Show file tree
Hide file tree
Showing 69 changed files with 212 additions and 234 deletions.
60 changes: 28 additions & 32 deletions ...getting-started-aws/apply_quick_action.md → ...g-started-aws/apply-quick-action/index.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
---
title: "Apply a Quick Action"
template: Documentation
nav:
  title: "Apply a Quick Action"
title: Apply a Quick Action
sidebar_label: Apply a Quick Action
---


# Apply a Quick Action

**Prerequisites**:

- [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect_an_account)
- [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe_aws_activity)
- [Attach a Guardrails policy](/guardrails/docs/runbooks/getting-started-aws/attach_a_policy)
- [Create a static exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create_static_exception)
- [Create a calculated exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create_calculated_exception)
- [Send an alert to email](/guardrails/docs/runbooks/getting-started-aws/send_alert_to_email)
- [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect-an-account/)
- [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe-aws-activity/)
- [Attach a Guardrails policy](/guardrails/docs/runbooks/getting-started-aws/attach-a-policy/)
- [Create a static exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create-static-exception/)
- [Create a calculated exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create-calculated-exception/)
- [Send an alert to email](/guardrails/docs/runbooks/getting-started-aws/send-alert-to-email/)


* Additional AWS Permissions: `s3:PutBucketVersioning`

Until now we’ve operated Guardrails in read-only mode, with the minimal permissions needed to discover resources, track changes, and alert on misconfigurations. In this runbook we’ll show how you can enable Guardrails to perform [Quick Actions](/guardrails/docs/guides/quick-actions) that fix misconfigurations.

## Step 1: Add the s3:PutBucketVersioning permission.

Use this CloudFormation stack to add one write permission to the `turbot-service-readonly` role you set up in [the first runbook]([/](https://turbot.com/guardrails/docs/guides/notifications/templates#example-slack-template)guardrails/docs/runbooks/getting-started-aws/connect_an_account).
Use this CloudFormation stack to add one write permission to the `turbot-service-readonly` role you set up in [the first runbook]([/](https://turbot.com/guardrails/docs/guides/notifications/templates#example-slack-template)guardrails/docs/runbooks/getting-started-aws/connect-an-account).

```yaml
AWSTemplateFormatVersion: '2010-09-09'
Expand Down Expand Up @@ -60,40 +56,40 @@ Outputs:
    Value: !Ref RoleName
```
## Step 2: Enable Quick Actions
## Enable Quick Actions
Do a top-level search for `quick actions` and click into the `Turbot > Quick Actions > Enabled` setting.
<p><img alt="aws_start_7_find_quick_actions_policies" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_7_find_quick_actions_policies.png"/></p><br/>
<p><img alt="aws_start_7_find_quick_actions_policies" src="/images/docs/guardrails/runbooks/getting-started-aws/apply-quick-action/aws-start-7-find-quick-actions-policies.png"/></p><br/>

It’s disabled by default. On its Policy Type page, click `New Policy Setting`, choose your Sandbox as the target resource, choose `Enabled`, and click `Create`.
<p><img alt="aws_start_7_ready_to_enable_quick_actions" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_7_ready_to_enable_quick_actions.png"/></p><br/>
<p><img alt="aws_start_7_ready_to_enable_quick_actions" src="/images/docs/guardrails/runbooks/getting-started-aws/apply-quick-action/aws-start-7-ready-to-enable-quick-actions.png"/></p><br/>

## Step 3: Find a bucket in Alarm for versioning
## Find a bucket in Alarm for versioning


In [Send an alert to email]( /guardrails/docs/runbooks/getting-started-aws/send_alert_to_email) we left your test bucket in the `Alarm` state.
In [Send an alert to email]( /guardrails/docs/runbooks/getting-started-aws/send-alert-to-email) we left your test bucket in the `Alarm` state.

Search for it.
<p><img alt="aws_start_7_search_bucket_in_alarm_for_quick_action" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_7_search_bucket_in_alarm_for_quick_action.png"/></p><br/>
<p><img alt="aws_start_7_search_bucket_in_alarm_for_quick_action" src="/images/docs/guardrails/runbooks/getting-started-aws/apply-quick-action/aws-start-7-search-bucket-in-alarm-for-quick-action.png"/></p><br/>

Click into the resource, switch to the `Controls` tab, and search for `s3 bucket versioning`.
<p><img alt="aws_start_7_find_bucket_in_alarm_for_quick_action" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_7_find_bucket_in_alarm_for_quick_action.png"/></p><br/>
<p><img alt="aws_start_7_find_bucket_in_alarm_for_quick_action" src="/images/docs/guardrails/runbooks/getting-started-aws/apply-quick-action/aws-start-7-find-bucket-in-alarm-for-quick-action.png"/></p><br/>



Click into the control and expand the `Actions` dropdown.
<p><img alt="aws_start_7_versioning_quick_action_dropdown" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_7_versioning_quick_action_dropdown.png"/></p><br/>
<p><img alt="aws_start_7_versioning_quick_action_dropdown" src="/images/docs/guardrails/runbooks/getting-started-aws/apply-quick-action/aws-start-7-versioning-quick-action-dropdown.png"/></p><br/>

## Step 4: Take a Quick Action to enable versioning  on a bucket
## Take a Quick Action to enable versioning  on a bucket

Choose `Enable Versioning`.


Guardrails reports that the action was successful, and the control goes to green.
<p><img alt="aws_start_7_quick_action_reports_success" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_7_quick_action_reports_success.png"/></p><br/>
<p><img alt="aws_start_7_quick_action_reports_success" src="/images/docs/guardrails/runbooks/getting-started-aws/apply-quick-action/aws-start-7-quick-action-reports-success.png"/></p><br/>

For more detail about what happened here, go to the top-level `Reports` tab, search in the page for `Activity Ledger`, and filter on `Control Type` == `AWS > S3 > Bucket > Versioning`.
<p><img alt="aws_start_7_quick_action_report_detail" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_7_quick_action_report_detail.png"/></p><br/>
<p><img alt="aws_start_7_quick_action_report_detail" src="/images/docs/guardrails/runbooks/getting-started-aws/apply-quick-action/aws-start-7-quick-action-report-detail.png"/></p><br/>

The flow of notifications tells the story. Reading from the bottom up, Guardrails:

Expand All @@ -103,7 +99,7 @@ The flow of notifications tells the story. Reading from the bottom up, Guardrail

- reevaluates the control.

In the [next runbook](/guardrails/docs/runbooks/getting-started-aws/enable_enforcement) we’ll set Guardrails to automatically enforce these actions continuously.
In the [next runbook](/guardrails/docs/runbooks/getting-started-aws/enable-enforcement) we’ll set Guardrails to automatically enforce these actions continuously.



Expand All @@ -115,18 +111,18 @@ In the [next runbook](/guardrails/docs/runbooks/getting-started-aws/enable_enfor

## You are here

1. [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect_an_account)
1. [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect-an-account/)

2. [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe_aws_activity)
2. [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe-aws-activity/)

3. [Attach a Guardrails policy](/guardrails/docs/runbooks/getting-started-aws/attach_a_policy)
3. [Attach a Guardrails policy](/guardrails/docs/runbooks/getting-started-aws/attach-a-policy/)

4. [Create a static exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create_static_exception)
4. [Create a static exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create-static-exception/)

5. [Create a calculated exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create_calculated_exception)
5. [Create a calculated exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create-calculated-exception/)

6. [Send an alert to email](/guardrails/docs/runbooks/getting-started-aws/send_alert_to_email)
6. [Send an alert to email](/guardrails/docs/runbooks/getting-started-aws/send-alert-to-email/)

7. **Apply a Quick Action**

8. [Enable automatic enforcement](/guardrails/docs/runbooks/getting-started-aws/enable_enforcement)
8. [Enable automatic enforcement](/guardrails/docs/runbooks/getting-started-aws/enable-enforcement/)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 28 additions & 31 deletions ...ks/getting-started-aws/attach_a_policy.md → ...ting-started-aws/attach-a-policy/index.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,93 +1,90 @@
---
title: "Attach a Guardrails policy"
template: Documentation
nav:
  title: "Attach a policy"
title: Attach a Guardrails policy
sidebar_label: Attach a Guardrails policy
---


# Attach a Guardrails policy

**Prerequisites**:

- [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect_an_account)
- [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe_aws_activity)
- [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect-an-account/)
- [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe-aws-activity/)


Now that we can track resource configuration drift, we can create policies to alert when those configurations do not meet our desired configuration.

## Step 1: Review bucket properties
## Review bucket properties

Check the properties of the bucket you created in [Observe AWS activity](/guardrails/docs/integrations/aws/getting-started-aws/observe_aws_activity). In that runbook you switched bucket versioning from the default (`Suspended`) to `Enabled`.
<p><img alt="aws_start_3_review_bucket_versioning" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_review_bucket_versioning.png"/></p><br/>
Check the properties of the bucket you created in [Observe AWS activity](/guardrails/docs/integrations/aws/getting-started-aws/observe-aws-dactivity). In that runbook you switched bucket versioning from the default (`Suspended`) to `Enabled`.
<p><img alt="aws_start_3_review_bucket_versioning" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-review-bucket-versioning.png"/></p><br/>

## Step 2:  Find and view the `AWS > S3 > Bucket > Versioning` policy type and controls
## Find and view the AWS > S3 > Bucket > Versioning policy type and controls

Do a top-level search for `aws s3 bucket versioning`.
<p><img alt="aws_start_3_search_bucket_versioning" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_search_bucket_versioning.png"/></p><br/>
<p><img alt="aws_start_3_search_bucket_versioning" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-search-bucket-versioning.png"/></p><br/>

The `controls` section reports that all buckets are in the `skipped` state. By default, there is no policy to enforce bucket versioning. Let’s make one. Click into the `AWS > S3 > Bucket > Versioning` policy type.
<p><img alt="aws_start_3_view_bucket_versioning_no_policy" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_view_bucket_versioning_no_policy.png"/></p><br/>
<p><img alt="aws_start_3_view_bucket_versioning_no_policy" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-view-bucket-versioning-no-policy.png"/></p><br/>

There’s a policy type, `AWS > S3 > Bucket > Versioning`, but as yet there are no policy settings. The default value for the setting is `Skip`.

## Step 3: Attach a policy
## Attach a policy

Your Guardrails workspace already has the pre-installed policy pack [Enforce Versioning Is Enabled for AWS S3 Buckets](https://hub.guardrails.turbot.com/policy-packs/aws_s3_enforce_versioning_is_enabled_for_buckets).

To attach it, click top-level `Resources`, navigate to your `Sandbox` folder, select the `Detail` tab, and click the `Manage` link next to `Policy Packs`.
<p><img alt="aws_start_3_find_policy_packs_manage" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_find_policy_packs_manage.png"/></p><br/>
<p><img alt="aws_start_3_find_policy_packs_manage" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-find-policy-packs-manage.png"/></p><br/>

In the `Edit policy pack attachments` dialog, select `Enforce Versioning is Enabled for AWS S3 Buckets` and  click `Save`.
<p><img alt="aws_start_3_edit_attachments_select_enforce_versioning" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_edit_attachments_select_enforce_versioning.png"/></p><br/>
<p><img alt="aws_start_3_edit_attachments_select_enforce_versioning" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-edit-attachments-select-enforce-versioning.png"/></p><br/>




Guardrails returns you to the `Detail` tab of the `Sandbox` page. Click the `Policies` tab, click `Descendant`, and search for `s3 bucket versioning`.
<p><img alt="aws_start_3_sandbox_policies_descendant" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_sandbox_policies_descendant.png"/></p><br/>
<p><img alt="aws_start_3_sandbox_policies_descendant" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-sandbox-policies-descendant.png"/></p><br/>

Click `AWS > S3 > Bucket > Versioning`.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdu_qFbeynk8c1JyeW8feoY2Df8JLyvGyGqvSc50cU37q5nhYow-o141Jr-m-AnLzRYqGQHVTHNoeF3uu8nsklW5HvKP054sBj-cpAM6a6JoiDN5rwYj-HdAO43XjMkbT5yNUhND2mf4xctFZcyiN1Fhkvc?key=67Q6ui6I83LD0pKPBaaJUA)
Click `AWS > S3 > Bucket > Versioning`.
<p><img alt="aws_start_3_review_bucket_versioning_policy_type" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-review-bucket-versioning-policy-type.png"/></p><br/>

This is the policy type for S3 bucket versioning. The default is `Skip`.

There is one policy setting. Click `1 setting` or `Switch to settings tab` to view it.
<p><img alt="aws_start_3_view_policy_setting" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_view_policy_setting.png"/></p><br/>
<p><img alt="aws_start_3_view_policy_setting" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-view-policy-setting.png"/></p><br/>

Here you can see the result of the policy pack you just attached: the setting for S3 bucket versioning now overrides the default and has become `Check: Enabled`.

## Step 4: Observe a policy-driven alarm
## Observe a policy-driven alarm

Do a top-level search for the name of your bucket, switch to the `Controls` tab, and search for `bucket versioning`. The control, which was formerly in the `Skipped` state, is now `OK` because you have enabled versioning for it.
<p><img alt="aws_start_3_observe_bucket_ok" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_observe_bucket_ok.png"/></p><br/>
<p><img alt="aws_start_3_observe_bucket_ok" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-observe-bucket-ok.png"/></p><br/>


Now, in the AWS console, set versioning for your bucket back to the AWS default, `Suspended`.
<p><img alt="aws_start_3_bucket_now_in_alarm" src="/images/docs/guardrails/runbooks/getting-started-aws/aws_start_3_bucket_now_in_alarm.png"/></p><br/>
<p><img alt="aws_start_3_bucket_now_in_alarm" src="/images/docs/guardrails/runbooks/getting-started-aws/attach-a-policy/aws-start-3-bucket-now-in-alarm.png"/></p><br/>



With versioning disabled, the bucket no longer complies with the `Check: Enabled` policy setting so Guardrails puts the bucket into the `Alarm` state for that policy.

You can override policies at any level. In the [next runbook](/guardrails/docs/runbooks/getting-started-aws/create_static_exception), we’ll create an exception that enables your test bucket to return to the `OK` state.
You can override policies at any level. In the [next runbook](/guardrails/docs/runbooks/getting-started-aws/create-static-exception), we’ll create an exception that enables your test bucket to return to the `OK` state.


## You are here

1. [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect_an_account)
1. [Connect an AWS account to Guardrails](/guardrails/docs/runbooks/getting-started-aws/connect-an-account/)

2. [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe_aws_activity)
2. [Observe AWS resource activity](/guardrails/docs/runbooks/getting-started-aws/observe-aws-activity/)

3. **Attach a Guardrails policy**

4. [Create a static exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create_static_exception)
4. [Create a static exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create-static-exception/)

5. [Create a calculated exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create_calculated_exception)
5. [Create a calculated exception to a Guardrails AWS policy](/guardrails/docs/runbooks/getting-started-aws/create-calculated-exception/)

6. [Send an alert to email](/guardrails/docs/runbooks/getting-started-aws/send_alert_to_email)
6. [Send an alert to email](/guardrails/docs/runbooks/getting-started-aws/send-alert-to-email/)

7. [Apply a Quick Action](/guardrails/docs/runbooks/getting-started-aws/apply_quick_action)
7. [Apply a Quick Action](/guardrails/docs/runbooks/getting-started-aws/apply-quick-action/)

8. [Enable automatic enforcement](/guardrails/docs/runbooks/getting-started-aws/enable_enforcement)
8. [Enable automatic enforcement](/guardrails/docs/runbooks/getting-started-aws/enable-enforcement/)
Loading

0 comments on commit 5ed6e75

Please sign in to comment.