Skip to content

Instantly share code, notes, and snippets.

@harsh4870
Last active February 10, 2022 14:39
Show Gist options
  • Save harsh4870/471433e8170af5699942d0e36b4321e0 to your computer and use it in GitHub Desktop.
Save harsh4870/471433e8170af5699942d0e36b4321e0 to your computer and use it in GitHub Desktop.
Cloud custodian GCP policy medium blog
policies:
- name: check-all-bucket-logging
description: |
Check all bucket logging enabled
resource: gcp.bucket
filters:
- type: value
key: logging
value: absent
actions:
- type: webhook
url: <URL>
body: |-
{
"attachments": [
{
"fallback": `CloudCustodian Policy Violation`,
"title": policy.description,
"color": `danger`,
"fields": [
{
"title": `Priority`,
"value": `High`,
"short": `true`
},
{
"title": `Bucket Rule Name`,
"value": resource.name,
"short": `true`
},
{
"title": `Bucket selfLink`,
"value": resource.selfLink,
"short": `false`
}
],
"footer": `Powered By M`
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment