SlideShare a Scribd company logo
1 of 16
WHAT IS CLOUD CUSTODIAN?
• Cloud Custodian is a tool that unifies the dozens of tools and
scripts most organizations use for managing their AWS
accounts into one open source tool. It’s a stateless rules
engine for policy definition and enforcement, with metrics and
reporting for AWS.
WHAT IS CLOUD CUSTODIAN?
• We want developers to be able to use the cloud and get the full native experience but
sometimes developers make mistakes and create S3 buckets or databases that are
publicly accessible to the internet etc.
• Cloud Custodian provides an easy method to put guardrails in place through real-time
and reactive automation instead of the old way of manual process and checklists.
• It helps keep developers in a safe space while being productive without the manual
side of management which can lock down their ability for innovation.
• Using repeatable actions and filters effectively provides millions of Lego bricks to build
ad-hoc policies from. There isn't a specific number of things Cloud Custodian can do,
it's really up to the imagination.
WHAT IS CLOUD CUSTODIAN?
- name: (Required) Name for the policy
- resource: (Required) Which resource type to check (ec2, rds, ebs, etc 100+)
- description: Brief statement of what the policy does
- mode: How the policy will be executed (event(API Triggered), periodic(Cron Scheduled), config(Config Change Triggered), no mode for manual
runs)
- filters: Narrow down resource matches with 1 or more of these
- actions: What to do with the resulting resource set found. (notify, stop, start, terminate, tag, resize, etc)
Cloud Custodian is fed basic instructions on what to do using a user defined yaml file(s) which contain 1 or
more policies the user wants executed against their AWS resources. Policies are generally pretty simple to
define as Cloud Custodian does all the heavy lifting and code processing on the backend.
Here is the basic structure of a policy:
WHAT DOES IT DO?
Cost Savings:
• Resource Off Hours
– Easy way to cut expenses by turning on/off resources on a automated schedule.
• Resource Resizing
– Ability to automatically resize resources based on metrics over time.
• Garbage Collection
– Automatic notifications and removal of stale and unused resources.
WHAT DOES IT DO?
Compliance:
• Encryption
– Verify and enforce encryption across numerous resources.
• Backups
– Performs automated snapshots of servers and databases.
• Tag Enforcement
– Proper tags are necessary for resource support and tracking.
• Security
– Puts up automated safeguards to detect, remediate, and notify customers of non-compliant actions
• Standards
– Ensure certain standards are used with consistency across all managed AWS accounts.
WHAT DOES IT DO?
Speed of Delivery:
• New AWS Accounts
– Verifies CloudTrail Logging is enabled and configured properly
– Verifies Network Logging is enabled and configured properly
– Verifies Root user’s access keys have been deleted
– Verifies MFA Token has been applied to Root user
– Verifies proper IAM password policy is enforced for users
• Detects and automates service limit increases
– Automatically opens AWS support case for service limit increases when
necessary*
*Only works on accounts with Business Support Plans or above as this feature relies
on advanced Trusted Advisor stats only available on certain paid support plans.
CLOUD CUSTODIAN POLICY EXAMPLES
COST SAVINGS - RESOURCE OFF HOURS
- name: ec2-offhours-stop
resource: ec2
description: |
Stops any EC2 instance which has a c7n_maid_offhours
tag set if the day and time specified in the tag match the
current day and time. Ex off=(M-F,19);on=(M-F,7);tz=ct
mode:
type: periodic
schedule: "rate(5 minutes)"
filters:
- type: offhour
tag: c7n_maid_offhours
default_tz: ct
offhour: 19
actions:
- stop
- name: ec2-offhours-start
resource: ec2
description: |
Starts any EC2 instance which has a c7n_maid_offhours tag set
if the day and time specified in the tag match the current day and
time.
Ex off=(M-F,19);on=(M-F,7);tz=ct
mode:
type: periodic
schedule: "rate(5 minutes)"
filters:
- type: onhour
tag: c7n_maid_offhours
default_tz: ct
onhour: 7
actions:
- start
COST SAVINGS - RESIZING RESOURCES
- name: rds-resize-storage
resource: rds
description: |
Resizes RDS databases who are using more than
90%
of their storage space and adds 30% more space
filters:
- type: metrics
name: FreeStorageSpace
percent-attr: AllocatedStorage
attr-multiplier: 1073741824
value: 90
op: greater-than
actions:
- type: resize
percent: 30
- name: ec2-instance-too-large-resizer
resource: ec2
filters:
- type: value
key: InstanceType
op: in
value:
- m4.10xlarge
- m4.4xlarge
- type: instance-age
value: 14
- type: metrics
name: CPUUtilization
days: 14
value: 3
op: less-than
actions:
- type: resize
restart: true
type-map:
m4.4xlarge: m4.2xlarge
m4.10xlarge: m4.4xlarge
COST SAVINGS - GARBAGE COLLECTION
- name: ebs-mark-unattached-
deletion
resource: ebs
description: |
Mark any unattached EBS volumes for deletion
in
30 days. This will clean up old unused
orphaned
volumes that customers forget to delete.
filters:
- "tag:maid_status": absent
- State: available
actions:
- type: mark-for-op
op: delete
days: 30
- name: elb-mark-unused-for-deletion
resource: elb
description: |
Mark any ELB with no instances attached for
deletion in 14 days.
filters:
- "tag:maid_status": absent
- Instances: []
actions:
- type: mark-for-op
tag: c7n_unused_elb
msg: "Unused ELB No Instances: {op}@{action_date}"
op: delete
days: 14
- name: rds-mark-unused
resource: rds
description: |
Take the average number of connections over
14 days and mark any unused for deletion
filters:
- "tag:c7n_rds_unused": absent
- type: value
value_type: age
key: InstanceCreateTime
value: 14
op: greater-than
- type: metrics
name: DatabaseConnections
days: 14
value: 0
op: equal
actions:
- type: mark-for-op
tag: c7n_rds_unused
op: delete
days: 14
- notify…..
COMPLIANCE - ENCRYPTION- name: s3-encrypt-buckets-realtime
resource: s3
description: |
A lambda encryption function is generated (if missing) and
attached
to newly created S3 buckets which will encrypt all uploaded
objects
mode:
type: cloudtrail
events:
- CreateBucket
filters:
- type: value
key: "Notification"
value: empty
- not:
- type: value
key: "Name"
op: regex
value: ^(cf-te?)w+
actions:
- attach-encrypt
- name: encrypt-unencrypted-ebs-volumes
resource: ebs
description: |
Multistep automated Cloud Custodian encryption process:
- Stop instance (if running)
- For each volume
- Create snapshot
- Wait on snapshot creation
- Copy Snapshot to create encrypted snapshot
- Wait on snapshot creation
- Create encrypted volume from snapshot
- Wait on volume creation
- Delete transient snapshots
- Detach Unencrypted Volume
- Attach Encrypted Volume
- Set DeleteOnTermination instance attribute equal to source
volume
- For each volume
- Delete unencrypted volume
- Start Instance (if originally running)
- For each newly encrypted volume
- Delete transient tags
filters:
- Encrypted: false
actions:
- type: encrypt-instance-volumes
key: alias/encrypted
COMPLIANCE - BACKUPS
- name: ec2-daily-backup
resource: ec2
description: |
Creates a snapshot of every EC2 EBS
volume daily when custodian runs
its daily scan
actions:
- type: snapshot
copy-tags:
- Owner
- "Resource Contact"
- Environment
- "Billing Cost Center"
- Name
- name: rds-daily-snapshot
resource: rds
description: |
Creates a snapshot of every RDS
volume daily when custodian runs
its full scan
actions:
- snapshot
- name: delete-old-snapshots
resource: ebs-snapshot
description: |
Deletes a snapshot if its older than 7
days and it was created by
cloud custodian
mode:
type: periodic
schedule: "rate(1 day)"
timeout: 300
filters:
- type: age
days: 7
op: greater-equal
- type: value
key: Description
op: regex
value: ^(Automated,Backup,-
?)w+
actions:
- delete
- name: rds-snapshot-delete-stale
resource: rds-snapshot
description: |
Deletes RDS single instance
snapshots
of age 15 days or older.
filters:
- type: age
days: 15
op: greater-equal
- type: value
key: DBSnapshotIdentifier
op: regex
value: ^(backup-?)w+
- type: value
key: SnapshotType
op: eq
value: manual
actions:
- delete
COMPLIANCE – TAG ENFORCEMENT- name: ec2-tag-compliance-mark
resource: ec2
mode:
type: cloudtrail
events:
- RunInstances
description: |
Find all non-autoscaling instances
that
are not conformant to tagging
policies
and tag them for stoppage in 1
days.
filters:
- "tag:aws:autoscaling:groupName":
absent
- "tag:c7n_tag_compliance": absent
- or:
- "tag:Resource Contact": absent
- "tag:Billing Cost Center":
absent
- "tag:Environment": absent
- "tag:Resource Purpose":
absent
- "tag:Business Unit": absent
actions:
- type: mark-for-op
tag: c7n_tag_compliance
op: stop
days: 1
- notify….
- name: ec2-tag-compliance-stop
resource: ec2
mode:
type: periodic
schedule: "rate(1 hour)"
description: |
Stop all non-autoscaling group
instances previously marked for
stoppage by today's date, and
schedule termination in 2 days.
filters:
- "tag:aws:autoscaling:groupName":
absent
- or:
- "tag:Resource Contact": absent
- "tag:Billing Cost Center":
absent
- "tag:Environment": absent
- "tag:Resource Purpose":
absent
- "tag:Business Unit": absent
- type: marked-for-op
tag: c7n_tag_compliance
op: stop
- type: instance-age
op: greater-than
hours: 24
- not:
- "State.Name": terminated
actions:
- stop
- type: mark-for-op
tag: c7n_tag_compliance
op: terminate
days: 2
- name: ec2-tag-compliance-nag-
stop
resource: ec2
mode:
type: periodic
schedule: "rate(1 hour)"
description: |
Stop all instances marked for
termination every hour starting 1
day
before their termination.
filters:
- "tag:aws:autoscaling:groupName": absent
- or:
- "tag:Resource Contact": absent
- "tag:Billing Cost Center":
absent
- "tag:Environment": absent
- "tag:Resource Purpose":
absent
- "tag:Business Unit": absent
- type: marked-for-op
tag: c7n_tag_compliance
op: terminate
skew: 1
- type: instance-age
op: greater-than
hours: 48
- not:
- "State.Name": terminated
actions:
- stop
- notify….
- name: ec2-tag-compliance-terminate
resource: ec2
mode:
type: periodic
schedule: "rate(1 hour)"
description: |
Terminate all stopped instances
marked for termination today
filters:
- "tag:aws:autoscaling:groupName":
absent
- or:
- "tag:Resource Contact": absent
- "tag:Billing Cost Center":
absent
- "tag:Environment": absent
- "tag:Resource Purpose":
absent
- "tag:Business Unit": absent
- type: marked-for-op
tag: c7n_tag_compliance
op: terminate
- type: instance-age
op: greater-than
hours: 72
- not:
- "State.Name": terminated
actions:
- type: terminate
force: true
- notify….
COMPLIANCE - STANDARDS
- name: rds-prd-multi-az-remediate
resource: rds
description: |
Notify on all Prod RDS Instances that are Not Multi AZ setup.
mode:
type: cloudtrail
events:
- source: rds.amazonaws.com
event: CreateDBInstance
ids:
"requestParameters.dBInstanceIdentifier"
filters:
- type: value
key: 'tag:Environment'
value: '^pro?d'
op: regex
- MultiAZ: false
actions:
- notify…..
- name: ec2-auto-tag-user
resource: ec2
description: |
Tag any new instance with the
Creators ID and Principle ID.
mode:
type: cloudtrail
events:
- RunInstances
filters:
- tag:CreatorName: absent
actions:
- type: auto-tag-user
tag: CreatorName
principal_id_tag:
CreatorId
- name: password-policy-check
resource: account
description: |
Verifies password policy on account
meets our requirements and notifies if not
region: us-east-1
filters:
- type: password-policy
key: MinimumPasswordLength
value: 14
op: less-than
- type: password-policy
key: RequireSymbols
value: false
- type: password-policy
key: RequireNumbers
value: false
- type: password-policy
key: RequireUppercaseCharacters
value: false
- type: password-policy
key: RequireLowercaseCharacters
value: false
- type: password-policy
key: PasswordReusePrevention
value: 2
op: less-than
- type: password-policy
key: MaxPasswordAge
value: 90
op: less-than
- type: password-policy
key: ExpirePasswords
value: false
- type: password-policy
key: HardExpiry
value: false
actions:
- notify….
CLOUD CUSTODIAN QUESTIONS

More Related Content

What's hot

Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceAmazon Web Services
 
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon Web Services
 
What's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial DatabasesWhat's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial DatabasesAmazon Web Services
 
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWSAmazon Web Services Korea
 
Deep Dive on Amazon S3 - AWS Online Tech Talks
Deep Dive on Amazon S3 - AWS Online Tech TalksDeep Dive on Amazon S3 - AWS Online Tech Talks
Deep Dive on Amazon S3 - AWS Online Tech TalksAmazon Web Services
 
AWS EMR Cost optimization
AWS EMR Cost optimizationAWS EMR Cost optimization
AWS EMR Cost optimizationSANG WON PARK
 
Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...
Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...
Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...Amazon Web Services
 
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018Amazon Web Services
 
AWS Security Week: Security, Identity, & Compliance
AWS Security Week: Security, Identity, & ComplianceAWS Security Week: Security, Identity, & Compliance
AWS Security Week: Security, Identity, & ComplianceAmazon Web Services
 
AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안
AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안
AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안Amazon Web Services Korea
 
Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트Amazon Web Services Korea
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Amazon Web Services
 
Data Migration to AWS with DataSync & Transfer for SFTP
Data Migration to AWS with DataSync & Transfer for SFTPData Migration to AWS with DataSync & Transfer for SFTP
Data Migration to AWS with DataSync & Transfer for SFTPAmazon Web Services
 
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Amazon Web Services
 
(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto ScalingAmazon Web Services
 
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기Amazon Web Services Korea
 

What's hot (20)

Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database Service
 
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
 
What's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial DatabasesWhat's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial Databases
 
Auto scaling
Auto scalingAuto scaling
Auto scaling
 
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS
 
Deep Dive on Amazon S3 - AWS Online Tech Talks
Deep Dive on Amazon S3 - AWS Online Tech TalksDeep Dive on Amazon S3 - AWS Online Tech Talks
Deep Dive on Amazon S3 - AWS Online Tech Talks
 
AWS EMR Cost optimization
AWS EMR Cost optimizationAWS EMR Cost optimization
AWS EMR Cost optimization
 
Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...
Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...
Deep Dive on Amazon S3 Security and Management (E2471STG303-R1) - AWS re:Inve...
 
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
 
AWS Security Week: Security, Identity, & Compliance
AWS Security Week: Security, Identity, & ComplianceAWS Security Week: Security, Identity, & Compliance
AWS Security Week: Security, Identity, & Compliance
 
AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안
AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안
AWS Summit Seoul 2023 | SK쉴더스: AWS Native Security 서비스를 활용한 경계보안
 
Setting Up a Landing Zone
Setting Up a Landing ZoneSetting Up a Landing Zone
Setting Up a Landing Zone
 
Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
 
Data Migration to AWS with DataSync & Transfer for SFTP
Data Migration to AWS with DataSync & Transfer for SFTPData Migration to AWS with DataSync & Transfer for SFTP
Data Migration to AWS with DataSync & Transfer for SFTP
 
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
 
Deep Dive on Amazon S3
Deep Dive on Amazon S3Deep Dive on Amazon S3
Deep Dive on Amazon S3
 
AWS WAF - A Web App Firewall
AWS WAF - A Web App FirewallAWS WAF - A Web App Firewall
AWS WAF - A Web App Firewall
 
(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling
 
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
 

Similar to Cloud Custodian

FinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel Aviv
FinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel AvivFinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel Aviv
FinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel AvivAmazon Web Services
 
Best Practices for SecOps on AWS
Best Practices for SecOps on AWSBest Practices for SecOps on AWS
Best Practices for SecOps on AWSAmazon Web Services
 
(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014
(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014
(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014Amazon Web Services
 
Dag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage serviceDag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage serviceShapeBlue
 
Cost Optimization Best Practices: Rotem Yosef
Cost Optimization Best Practices: Rotem Yosef Cost Optimization Best Practices: Rotem Yosef
Cost Optimization Best Practices: Rotem Yosef Amazon Web Services
 
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...Amazon Web Services
 
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...Amazon Web Services
 
Achieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloudAchieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloudScott Miao
 
Build a custom metrics on aws cloud
Build a custom metrics on aws cloudBuild a custom metrics on aws cloud
Build a custom metrics on aws cloudAhmad karawash
 
Training AWS: Module 9 - CloudWatch
Training AWS: Module 9 - CloudWatchTraining AWS: Module 9 - CloudWatch
Training AWS: Module 9 - CloudWatchBùi Quang Lâm
 
Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure Amazon Web Services
 
Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2Amazon Web Services
 
Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services Amazon Web Services
 
Amazon Web Services User Group Sydney - March 2018
Amazon Web Services User Group Sydney - March 2018Amazon Web Services User Group Sydney - March 2018
Amazon Web Services User Group Sydney - March 2018PolarSeven Pty Ltd
 
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on OpenstackLinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on OpenstackOpenShift Origin
 
Who's in your Cloud? Cloud State Monitoring
Who's in your Cloud? Cloud State MonitoringWho's in your Cloud? Cloud State Monitoring
Who's in your Cloud? Cloud State MonitoringKevin Hakanson
 
AWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdfAWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdfChristopher Doman
 
Cloud inventory analytics Maestro server
Cloud inventory analytics   Maestro serverCloud inventory analytics   Maestro server
Cloud inventory analytics Maestro serverFelipe Klerk Signorini
 
Google Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with ZabbixGoogle Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with ZabbixMax Kuzkin
 

Similar to Cloud Custodian (20)

FinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel Aviv
FinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel AvivFinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel Aviv
FinOps - AWS Cost and Operational Efficiency - Pop-up Loft Tel Aviv
 
Best Practices for SecOps on AWS
Best Practices for SecOps on AWSBest Practices for SecOps on AWS
Best Practices for SecOps on AWS
 
(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014
(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014
(SPOT305) Event-Driven Computing on Change Logs in AWS | AWS re:Invent 2014
 
Dag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage serviceDag Sonstebo - CloudStack usage service
Dag Sonstebo - CloudStack usage service
 
Cost Optimization Best Practices: Rotem Yosef
Cost Optimization Best Practices: Rotem Yosef Cost Optimization Best Practices: Rotem Yosef
Cost Optimization Best Practices: Rotem Yosef
 
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
 
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
 
Achieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloudAchieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloud
 
Build a custom metrics on aws cloud
Build a custom metrics on aws cloudBuild a custom metrics on aws cloud
Build a custom metrics on aws cloud
 
Training AWS: Module 9 - CloudWatch
Training AWS: Module 9 - CloudWatchTraining AWS: Module 9 - CloudWatch
Training AWS: Module 9 - CloudWatch
 
Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure
 
Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2
 
Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services Optimizing Costs and Efficiency of AWS Services
Optimizing Costs and Efficiency of AWS Services
 
Amazon Web Services User Group Sydney - March 2018
Amazon Web Services User Group Sydney - March 2018Amazon Web Services User Group Sydney - March 2018
Amazon Web Services User Group Sydney - March 2018
 
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on OpenstackLinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
 
Who's in your Cloud? Cloud State Monitoring
Who's in your Cloud? Cloud State MonitoringWho's in your Cloud? Cloud State Monitoring
Who's in your Cloud? Cloud State Monitoring
 
AWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdfAWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdf
 
les07.pdf
les07.pdfles07.pdf
les07.pdf
 
Cloud inventory analytics Maestro server
Cloud inventory analytics   Maestro serverCloud inventory analytics   Maestro server
Cloud inventory analytics Maestro server
 
Google Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with ZabbixGoogle Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with Zabbix
 

Recently uploaded

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

Cloud Custodian

  • 1.
  • 2. WHAT IS CLOUD CUSTODIAN? • Cloud Custodian is a tool that unifies the dozens of tools and scripts most organizations use for managing their AWS accounts into one open source tool. It’s a stateless rules engine for policy definition and enforcement, with metrics and reporting for AWS.
  • 3. WHAT IS CLOUD CUSTODIAN? • We want developers to be able to use the cloud and get the full native experience but sometimes developers make mistakes and create S3 buckets or databases that are publicly accessible to the internet etc. • Cloud Custodian provides an easy method to put guardrails in place through real-time and reactive automation instead of the old way of manual process and checklists. • It helps keep developers in a safe space while being productive without the manual side of management which can lock down their ability for innovation. • Using repeatable actions and filters effectively provides millions of Lego bricks to build ad-hoc policies from. There isn't a specific number of things Cloud Custodian can do, it's really up to the imagination.
  • 4. WHAT IS CLOUD CUSTODIAN? - name: (Required) Name for the policy - resource: (Required) Which resource type to check (ec2, rds, ebs, etc 100+) - description: Brief statement of what the policy does - mode: How the policy will be executed (event(API Triggered), periodic(Cron Scheduled), config(Config Change Triggered), no mode for manual runs) - filters: Narrow down resource matches with 1 or more of these - actions: What to do with the resulting resource set found. (notify, stop, start, terminate, tag, resize, etc) Cloud Custodian is fed basic instructions on what to do using a user defined yaml file(s) which contain 1 or more policies the user wants executed against their AWS resources. Policies are generally pretty simple to define as Cloud Custodian does all the heavy lifting and code processing on the backend. Here is the basic structure of a policy:
  • 5. WHAT DOES IT DO? Cost Savings: • Resource Off Hours – Easy way to cut expenses by turning on/off resources on a automated schedule. • Resource Resizing – Ability to automatically resize resources based on metrics over time. • Garbage Collection – Automatic notifications and removal of stale and unused resources.
  • 6. WHAT DOES IT DO? Compliance: • Encryption – Verify and enforce encryption across numerous resources. • Backups – Performs automated snapshots of servers and databases. • Tag Enforcement – Proper tags are necessary for resource support and tracking. • Security – Puts up automated safeguards to detect, remediate, and notify customers of non-compliant actions • Standards – Ensure certain standards are used with consistency across all managed AWS accounts.
  • 7. WHAT DOES IT DO? Speed of Delivery: • New AWS Accounts – Verifies CloudTrail Logging is enabled and configured properly – Verifies Network Logging is enabled and configured properly – Verifies Root user’s access keys have been deleted – Verifies MFA Token has been applied to Root user – Verifies proper IAM password policy is enforced for users • Detects and automates service limit increases – Automatically opens AWS support case for service limit increases when necessary* *Only works on accounts with Business Support Plans or above as this feature relies on advanced Trusted Advisor stats only available on certain paid support plans.
  • 9. COST SAVINGS - RESOURCE OFF HOURS - name: ec2-offhours-stop resource: ec2 description: | Stops any EC2 instance which has a c7n_maid_offhours tag set if the day and time specified in the tag match the current day and time. Ex off=(M-F,19);on=(M-F,7);tz=ct mode: type: periodic schedule: "rate(5 minutes)" filters: - type: offhour tag: c7n_maid_offhours default_tz: ct offhour: 19 actions: - stop - name: ec2-offhours-start resource: ec2 description: | Starts any EC2 instance which has a c7n_maid_offhours tag set if the day and time specified in the tag match the current day and time. Ex off=(M-F,19);on=(M-F,7);tz=ct mode: type: periodic schedule: "rate(5 minutes)" filters: - type: onhour tag: c7n_maid_offhours default_tz: ct onhour: 7 actions: - start
  • 10. COST SAVINGS - RESIZING RESOURCES - name: rds-resize-storage resource: rds description: | Resizes RDS databases who are using more than 90% of their storage space and adds 30% more space filters: - type: metrics name: FreeStorageSpace percent-attr: AllocatedStorage attr-multiplier: 1073741824 value: 90 op: greater-than actions: - type: resize percent: 30 - name: ec2-instance-too-large-resizer resource: ec2 filters: - type: value key: InstanceType op: in value: - m4.10xlarge - m4.4xlarge - type: instance-age value: 14 - type: metrics name: CPUUtilization days: 14 value: 3 op: less-than actions: - type: resize restart: true type-map: m4.4xlarge: m4.2xlarge m4.10xlarge: m4.4xlarge
  • 11. COST SAVINGS - GARBAGE COLLECTION - name: ebs-mark-unattached- deletion resource: ebs description: | Mark any unattached EBS volumes for deletion in 30 days. This will clean up old unused orphaned volumes that customers forget to delete. filters: - "tag:maid_status": absent - State: available actions: - type: mark-for-op op: delete days: 30 - name: elb-mark-unused-for-deletion resource: elb description: | Mark any ELB with no instances attached for deletion in 14 days. filters: - "tag:maid_status": absent - Instances: [] actions: - type: mark-for-op tag: c7n_unused_elb msg: "Unused ELB No Instances: {op}@{action_date}" op: delete days: 14 - name: rds-mark-unused resource: rds description: | Take the average number of connections over 14 days and mark any unused for deletion filters: - "tag:c7n_rds_unused": absent - type: value value_type: age key: InstanceCreateTime value: 14 op: greater-than - type: metrics name: DatabaseConnections days: 14 value: 0 op: equal actions: - type: mark-for-op tag: c7n_rds_unused op: delete days: 14 - notify…..
  • 12. COMPLIANCE - ENCRYPTION- name: s3-encrypt-buckets-realtime resource: s3 description: | A lambda encryption function is generated (if missing) and attached to newly created S3 buckets which will encrypt all uploaded objects mode: type: cloudtrail events: - CreateBucket filters: - type: value key: "Notification" value: empty - not: - type: value key: "Name" op: regex value: ^(cf-te?)w+ actions: - attach-encrypt - name: encrypt-unencrypted-ebs-volumes resource: ebs description: | Multistep automated Cloud Custodian encryption process: - Stop instance (if running) - For each volume - Create snapshot - Wait on snapshot creation - Copy Snapshot to create encrypted snapshot - Wait on snapshot creation - Create encrypted volume from snapshot - Wait on volume creation - Delete transient snapshots - Detach Unencrypted Volume - Attach Encrypted Volume - Set DeleteOnTermination instance attribute equal to source volume - For each volume - Delete unencrypted volume - Start Instance (if originally running) - For each newly encrypted volume - Delete transient tags filters: - Encrypted: false actions: - type: encrypt-instance-volumes key: alias/encrypted
  • 13. COMPLIANCE - BACKUPS - name: ec2-daily-backup resource: ec2 description: | Creates a snapshot of every EC2 EBS volume daily when custodian runs its daily scan actions: - type: snapshot copy-tags: - Owner - "Resource Contact" - Environment - "Billing Cost Center" - Name - name: rds-daily-snapshot resource: rds description: | Creates a snapshot of every RDS volume daily when custodian runs its full scan actions: - snapshot - name: delete-old-snapshots resource: ebs-snapshot description: | Deletes a snapshot if its older than 7 days and it was created by cloud custodian mode: type: periodic schedule: "rate(1 day)" timeout: 300 filters: - type: age days: 7 op: greater-equal - type: value key: Description op: regex value: ^(Automated,Backup,- ?)w+ actions: - delete - name: rds-snapshot-delete-stale resource: rds-snapshot description: | Deletes RDS single instance snapshots of age 15 days or older. filters: - type: age days: 15 op: greater-equal - type: value key: DBSnapshotIdentifier op: regex value: ^(backup-?)w+ - type: value key: SnapshotType op: eq value: manual actions: - delete
  • 14. COMPLIANCE – TAG ENFORCEMENT- name: ec2-tag-compliance-mark resource: ec2 mode: type: cloudtrail events: - RunInstances description: | Find all non-autoscaling instances that are not conformant to tagging policies and tag them for stoppage in 1 days. filters: - "tag:aws:autoscaling:groupName": absent - "tag:c7n_tag_compliance": absent - or: - "tag:Resource Contact": absent - "tag:Billing Cost Center": absent - "tag:Environment": absent - "tag:Resource Purpose": absent - "tag:Business Unit": absent actions: - type: mark-for-op tag: c7n_tag_compliance op: stop days: 1 - notify…. - name: ec2-tag-compliance-stop resource: ec2 mode: type: periodic schedule: "rate(1 hour)" description: | Stop all non-autoscaling group instances previously marked for stoppage by today's date, and schedule termination in 2 days. filters: - "tag:aws:autoscaling:groupName": absent - or: - "tag:Resource Contact": absent - "tag:Billing Cost Center": absent - "tag:Environment": absent - "tag:Resource Purpose": absent - "tag:Business Unit": absent - type: marked-for-op tag: c7n_tag_compliance op: stop - type: instance-age op: greater-than hours: 24 - not: - "State.Name": terminated actions: - stop - type: mark-for-op tag: c7n_tag_compliance op: terminate days: 2 - name: ec2-tag-compliance-nag- stop resource: ec2 mode: type: periodic schedule: "rate(1 hour)" description: | Stop all instances marked for termination every hour starting 1 day before their termination. filters: - "tag:aws:autoscaling:groupName": absent - or: - "tag:Resource Contact": absent - "tag:Billing Cost Center": absent - "tag:Environment": absent - "tag:Resource Purpose": absent - "tag:Business Unit": absent - type: marked-for-op tag: c7n_tag_compliance op: terminate skew: 1 - type: instance-age op: greater-than hours: 48 - not: - "State.Name": terminated actions: - stop - notify…. - name: ec2-tag-compliance-terminate resource: ec2 mode: type: periodic schedule: "rate(1 hour)" description: | Terminate all stopped instances marked for termination today filters: - "tag:aws:autoscaling:groupName": absent - or: - "tag:Resource Contact": absent - "tag:Billing Cost Center": absent - "tag:Environment": absent - "tag:Resource Purpose": absent - "tag:Business Unit": absent - type: marked-for-op tag: c7n_tag_compliance op: terminate - type: instance-age op: greater-than hours: 72 - not: - "State.Name": terminated actions: - type: terminate force: true - notify….
  • 15. COMPLIANCE - STANDARDS - name: rds-prd-multi-az-remediate resource: rds description: | Notify on all Prod RDS Instances that are Not Multi AZ setup. mode: type: cloudtrail events: - source: rds.amazonaws.com event: CreateDBInstance ids: "requestParameters.dBInstanceIdentifier" filters: - type: value key: 'tag:Environment' value: '^pro?d' op: regex - MultiAZ: false actions: - notify….. - name: ec2-auto-tag-user resource: ec2 description: | Tag any new instance with the Creators ID and Principle ID. mode: type: cloudtrail events: - RunInstances filters: - tag:CreatorName: absent actions: - type: auto-tag-user tag: CreatorName principal_id_tag: CreatorId - name: password-policy-check resource: account description: | Verifies password policy on account meets our requirements and notifies if not region: us-east-1 filters: - type: password-policy key: MinimumPasswordLength value: 14 op: less-than - type: password-policy key: RequireSymbols value: false - type: password-policy key: RequireNumbers value: false - type: password-policy key: RequireUppercaseCharacters value: false - type: password-policy key: RequireLowercaseCharacters value: false - type: password-policy key: PasswordReusePrevention value: 2 op: less-than - type: password-policy key: MaxPasswordAge value: 90 op: less-than - type: password-policy key: ExpirePasswords value: false - type: password-policy key: HardExpiry value: false actions: - notify….

Editor's Notes

  1. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  2. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  3. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  4. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  5. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  6. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  7. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  8. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  9. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule
  10. Resource Off Hours – Customers can easily turn on and off their servers on a schedule by simply applying a c7n_maid_offhours tag to the server with their defined schedule