[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-9954":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":42,"discoverSource":43},9954,"cloud-custodian","cloud-custodian\u002Fcloud-custodian","Rules engine for cloud security, cost optimization, and governance, DSL in yaml for policies to query, filter, and take actions on resources","https:\u002F\u002Fcloudcustodian.io",null,"Python",6005,1622,163,1404,0,2,9,26,40.63,"Apache License 2.0",false,"main",true,[25,26,27,28,29,30,31,32,33,34,35,36,37,38],"aws","azure","cloud","cloud-computing","compliance","finops","gcp","kubernetes","management","oci","rules-engine","serverless","tencent-cloud","terraform","2026-06-12 02:02:14","Cloud Custodian (c7n)\n=================\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fcloudcustodian.io\u002Fimg\u002Flogo_capone_devex_cloud_custodian.svg\" alt=\"Cloud Custodian Logo\" width=\"200px\" height=\"200px\" \u002F>\u003C\u002Fp>\n\n---\n\n[![slack](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fslack-chat-yellow)](https:\u002F\u002Fcommunityinviter.com\u002Fapps\u002Fcloud-custodian\u002Fc7n-chat)\n[![CI](https:\u002F\u002Fgithub.com\u002Fcloud-custodian\u002Fcloud-custodian\u002Fworkflows\u002FCI\u002Fbadge.svg?event=push)](https:\u002F\u002Fgithub.com\u002Fcloud-custodian\u002Fcloud-custodian\u002Factions?query=workflow%3ACI+branch%3Amain+event%3Apush)\n[![](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202-blue.svg)](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0)\n[![](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fcloud-custodian\u002Fcloud-custodian\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fcloud-custodian\u002Fcloud-custodian)\n[![CII Best Practices](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F3402\u002Fbadge)](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F3402)\n\nCloud Custodian, also known as c7n, is a rules engine for managing\npublic cloud accounts and resources. It allows users to define\npolicies to enable a well managed cloud infrastructure, that\\'s both\nsecure and cost optimized. It consolidates many of the adhoc scripts\norganizations have into a lightweight and flexible tool, with unified\nmetrics and reporting.\n\nCustodian can be used to manage AWS, Azure, and GCP environments by\nensuring real time compliance to security policies (like encryption and\naccess requirements), tag policies, and cost management via garbage\ncollection of unused resources and off-hours resource management.\n\nCustodian also supports running policies on infrastructure as code assets\nto provide feedback directly on developer workstations or within CI pipelines.\n\nCustodian policies are written in simple YAML configuration files that\nenable users to specify policies on a resource type (EC2, ASG, Redshift,\nCosmosDB, PubSub Topic) and are constructed from a vocabulary of filters\nand actions.\n\nIt integrates with the cloud native serverless capabilities of each\nprovider to provide for real time enforcement of policies with builtin\nprovisioning. Or it can be run as a simple cron job on a server to\nexecute against large existing fleets.\n\nCloud Custodian is a CNCF Incubating project, led by a community of hundreds\nof contributors.\n\nFeatures\n--------\n\n-   Comprehensive support for public cloud services and resources with a\n    rich library of actions and filters to build policies with.\n-   Run policies on infrastructure as code (terraform, etc) assets.\t\n-   Supports arbitrary filtering on resources with nested boolean\n    conditions.\n-   Dry run any policy to see what it would do.\n-   Automatically provisions serverless functions and event sources (\n    AWS CloudWatchEvents, AWS Config Rules, Azure EventGrid, GCP\n    AuditLog & Pub\u002FSub, etc)\n-   Cloud provider native metrics outputs on resources that matched a\n    policy\n-   Structured outputs into cloud native object storage of which\n    resources matched a policy.\n-   Intelligent cache usage to minimize api calls.\n-   Supports multi-account\u002Fsubscription\u002Fproject usage.\n-   Battle-tested - in production on some very large cloud environments.\n\nLinks\n-----\n\n-   [Homepage](https:\u002F\u002Fcloudcustodian.io)\n-   [Docs](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Findex.html)\n-   [Project Roadmap](https:\u002F\u002Fgithub.com\u002Forgs\u002Fcloud-custodian\u002Fprojects\u002F1)\n-   [Developer Install](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Fdeveloper\u002Finstalling.html)\n-   [Presentations](https:\u002F\u002Fwww.google.com\u002Fsearch?q=cloud+custodian&source=lnms&tbm=vid)\n-   [YouTube Channel](https:\u002F\u002Fwww.youtube.com\u002Fchannel\u002FUCdeXCdFLluylWnFfS0-jbDA)\n\nQuick Install\n-------------\n\nCustodian is published on pypi as a series of packages with the `c7n`\nprefix, it's also available as a docker image.\n\n```shell\n$ python3 -m venv custodian\n$ source custodian\u002Fbin\u002Factivate\n(custodian) $ pip install c7n\n```\n\n\nUsage\n-----\n\nThe first step to using Cloud Custodian (c7n) is writing a YAML file\ncontaining the policies that you want to run. Each policy specifies\nthe resource type that the policy will run on, a set of filters which\ncontrol resources will be affected by this policy, actions which the policy\nwith take on the matched resources, and a mode which controls which\nhow the policy will execute.\n\nThe best getting started guides are the cloud provider specific tutorials.\n\n - [AWS Getting Started](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Faws\u002Fgettingstarted.html)\n - [Azure Getting Started](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Fazure\u002Fgettingstarted.html)\n - [GCP Getting Started](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Fgcp\u002Fgettingstarted.html)\n\nAs a quick walk through, below are some sample policies for AWS resources.\n\n  1. will enforce that no S3 buckets have cross-account access enabled.\n  1. will terminate any newly launched EC2 instance that do not have an encrypted EBS volume.\n  1. will tag any EC2 instance that does not have the follow tags\n     \"Environment\", \"AppId\", and either \"OwnerContact\" or \"DeptID\" to\n     be stopped in four days.\n\n```yaml\npolicies:\n - name: s3-cross-account\n   description: |\n     Checks S3 for buckets with cross-account access and\n     removes the cross-account access.\n   resource: aws.s3\n   region: us-east-1\n   filters:\n     - type: cross-account\n   actions:\n     - type: remove-statements\n       statement_ids: matched\n\n - name: ec2-require-non-public-and-encrypted-volumes\n   resource: aws.ec2\n   description: |\n    Provision a lambda and cloud watch event target\n    that looks at all new instances and terminates those with\n    unencrypted volumes.\n   mode:\n    type: cloudtrail\n    role: CloudCustodian-QuickStart\n    events:\n      - RunInstances\n   filters:\n    - type: ebs\n      key: Encrypted\n      value: false\n   actions:\n    - terminate\n\n - name: tag-compliance\n   resource: aws.ec2\n   description: |\n     Schedule a resource that does not meet tag compliance policies to be stopped in four days. Note a separate policy using the`marked-for-op` filter is required to actually stop the instances after four days.\n   filters:\n    - State.Name: running\n    - \"tag:Environment\": absent\n    - \"tag:AppId\": absent\n    - or:\n      - \"tag:OwnerContact\": absent\n      - \"tag:DeptID\": absent\n   actions:\n    - type: mark-for-op\n      op: stop\n      days: 4\n```\n\nYou can validate, test, and run Cloud Custodian with the example policy with these commands:\n\n```shell\n# Validate the configuration (note this happens by default on run)\n$ custodian validate policy.yml\n\n# Dryrun on the policies (no actions executed) to see what resources\n# match each policy.\n$ custodian run --dryrun -s out policy.yml\n\n# Run the policy\n$ custodian run -s out policy.yml\n```\n\nYou can run Cloud Custodian via Docker as well:\n\n```shell\n# Download the image\n$ docker pull cloudcustodian\u002Fc7n\n$ mkdir output\n\n# Run the policy\n#\n# This will run the policy using only the environment variables for authentication\n$ docker run -it \\\n  -v $(pwd)\u002Foutput:\u002Fhome\u002Fcustodian\u002Foutput \\\n  -v $(pwd)\u002Fpolicy.yml:\u002Fhome\u002Fcustodian\u002Fpolicy.yml \\\n  --env-file \u003C(env | grep \"^AWS\\|^AZURE\\|^GOOGLE\") \\\n  cloudcustodian\u002Fc7n run -v -s \u002Fhome\u002Fcustodian\u002Foutput \u002Fhome\u002Fcustodian\u002Fpolicy.yml\n\n# Run the policy (using AWS's generated credentials from STS)\n#\n# NOTE: We mount the ``.aws\u002Fcredentials`` and ``.aws\u002Fconfig`` directories to\n# the docker container to support authentication to AWS using the same credentials\n# credentials that are available to the local user if authenticating with STS.\n\n$ docker run -it \\\n  -v $(pwd)\u002Foutput:\u002Fhome\u002Fcustodian\u002Foutput \\\n  -v $(pwd)\u002Fpolicy.yml:\u002Fhome\u002Fcustodian\u002Fpolicy.yml \\\n  -v $(cd ~ && pwd)\u002F.aws\u002Fcredentials:\u002Fhome\u002Fcustodian\u002F.aws\u002Fcredentials \\\n  -v $(cd ~ && pwd)\u002F.aws\u002Fconfig:\u002Fhome\u002Fcustodian\u002F.aws\u002Fconfig \\\n  --env-file \u003C(env | grep \"^AWS\") \\\n  cloudcustodian\u002Fc7n run -v -s \u002Fhome\u002Fcustodian\u002Foutput \u002Fhome\u002Fcustodian\u002Fpolicy.yml\n```\n\nThe [custodian cask\ntool](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fcask.html) is a go binary\nthat provides a transparent front end to docker that mirrors the regular\ncustodian cli, but automatically takes care of mounting volumes.\n\nConsult the documentation for additional information, or reach out on gitter.\n\nCloud Provider Specific Help\n----------------------------\n\nFor specific instructions for AWS, Azure, and GCP, visit the relevant getting started page.\n\n- [AWS](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Faws\u002Fgettingstarted.html)\n- [Azure](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Fazure\u002Fgettingstarted.html)\n- [GCP](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Fgcp\u002Fgettingstarted.html)\n\nGet Involved\n------------\n\n-   [GitHub](https:\u002F\u002Fgithub.com\u002Fcloud-custodian\u002Fcloud-custodian) - (This page)\n-   [Slack](https:\u002F\u002Fcommunityinviter.com\u002Fapps\u002Fcloud-custodian\u002Fc7n-chat) - Real time chat if you're looking for help or interested in contributing to Custodian! \n    - [Gitter](https:\u002F\u002Fgitter.im\u002Fcloud-custodian\u002Fcloud-custodian) - (Older real time chat, we're likely migrating away from this)\n-   [Linen.dev](https:\u002F\u002Fwww.linen.dev\u002Fs\u002Fcloud-custodian\u002Fc\u002Fgeneral) - Follow our discussions on Linen\n-   [Mailing List](https:\u002F\u002Fgroups.google.com\u002Fforum\u002F#!forum\u002Fcloud-custodian) - Our project mailing list, subscribe here for important project announcements, feel free to ask questions\n-   [Reddit](https:\u002F\u002Freddit.com\u002Fr\u002Fcloudcustodian) - Our subreddit\n-   [StackOverflow](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fcloudcustodian) - Q&A site for developers, we keep an eye on the `cloudcustodian` tag\n-   [YouTube Channel](https:\u002F\u002Fwww.youtube.com\u002Fchannel\u002FUCdeXCdFLluylWnFfS0-jbDA\u002F) - We're working on adding tutorials and other useful information, as well as meeting videos\n\nCommunity Resources\n-------------------\n\nWe have a regular community meeting that is open to all users and developers of every skill level.\nJoining the [mailing list](https:\u002F\u002Fgroups.google.com\u002Fforum\u002F#!forum\u002Fcloud-custodian) will automatically send you a meeting invite. \nSee the notes below for more technical information on joining the meeting. \n\n- [Community Meeting Videos](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=qy250y0UT-4&list=PLJ2Un8H_N5uBeAAWK95SnWvm_AuNJ8q2x)\n- [Community Meeting Notes Archive](https:\u002F\u002Fgithub.com\u002Forgs\u002Fcloud-custodian\u002Fdiscussions\u002Fcategories\u002Fannouncements)\n- [Upcoming Community Events](https:\u002F\u002Fcloudcustodian.io\u002Fevents\u002F)\n- [Cloud Custodian Annual Report 2021](https:\u002F\u002Fgithub.com\u002Fcncf\u002Ftoc\u002Fblob\u002Fmain\u002Freviews\u002F2021-cloud-custodian-annual.md) - Annual health check provided to the CNCF outlining the health of the project\n- [Ada Logics Third Party Security Audit](https:\u002F\u002Fostif.org\u002Fcc-audit-complete\u002F)\n\n\nAdditional Tools\n----------------\n\nThe Custodian project also develops and maintains a suite of additional\ntools here\n\u003Chttps:\u002F\u002Fgithub.com\u002Fcloud-custodian\u002Fcloud-custodian\u002Ftree\u002Fmain\u002Ftools>:\n\n- [**_Org_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-org.html) Multi-account policy execution.\n\n- [**_ShiftLeft_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-left.html) Shift Left ~ run policies against Infrastructure as Code assets like terraform.\n\n- [**_PolicyStream_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-policystream.html) Git history as stream of logical policy changes.\n\n- [**_Salactus_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-salactus.html) Scale out s3 scanning.\n\n- [**_Mailer_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-mailer.html) A reference implementation of sending messages to users to notify them.\n\n- [**_Trail Creator_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-trailcreator.html) Retroactive tagging of resources creators from CloudTrail\n\n- **_TrailDB_:** Cloudtrail indexing and time series generation for dashboarding.\n\n- [**_LogExporter_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-logexporter.html) Cloud watch log exporting to s3\n\n- [**_Cask_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fcask.html) Easy custodian exec via docker\n\n- [**_Guardian_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fc7n-guardian.html) Automated multi-account Guard Duty setup\n\n- [**_Omni SSM_:**](https:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Ftools\u002Fomnissm.html) EC2 Systems Manager Automation\n\n- [**_Mugc_:**](https:\u002F\u002Fgithub.com\u002Fcloud-custodian\u002Fcloud-custodian\u002Ftree\u002Fmain\u002Ftools\u002Fops#mugc) A utility used to clean up Cloud Custodian Lambda policies that are deployed in an AWS environment.\n\nContributing\n------------\n\nSee \u003Chttps:\u002F\u002Fcloudcustodian.io\u002Fdocs\u002Fcontribute.html>\n\nSecurity\n--------\n\nIf you've found a security related issue, a vulnerability, or a\npotential vulnerability in Cloud Custodian please let the Cloud\n[Custodian Security Team](mailto:security@cloudcustodian.io) know with\nthe details of the vulnerability. We'll send a confirmation email to\nacknowledge your report, and we'll send an additional email when we've\nidentified the issue positively or negatively.\n\nCode of Conduct\n---------------\n\nThis project adheres to the [CNCF Code of Conduct](https:\u002F\u002Fgithub.com\u002Fcncf\u002Ffoundation\u002Fblob\u002Fmain\u002Fcode-of-conduct.md)\n\nBy participating, you are expected to honor this code.\n\n","Cloud Custodian 是一个用于管理公有云账户和资源的规则引擎，旨在提高云基础设施的安全性和成本效益。它支持通过简单的YAML配置文件定义策略，以实现对AWS、Azure、GCP等云平台上的资源进行查询、过滤并采取相应措施。核心功能包括实时合规性检查（如加密和访问要求）、标签策略执行及成本优化（例如清理未使用资源）。此外，Custodian还能够与云原生无服务器功能集成，提供实时策略执行，并且可以在CI\u002FCD流程中对基础设施即代码资产进行策略验证。适用于需要加强云安全治理、自动化成本控制以及确保持续符合行业标准的企业或组织。","2026-06-11 03:25:45","top_topic"]