【问题标题】:How to ask cloudcustodian report only for non complient resources如何仅针对不合规资源要求云托管报告
【发布时间】:2021-12-21 14:53:16
【问题描述】:

我们正在尝试使用 cloudcustodian 进行基础架构审计,并为不符合标记策略的资源生成 csv 报告

配置示例:

vars:
  tag-filters: &tag-compliance-filters
      - "tag.team_name": absent
      - "tag.product_name": absent
      - "tag.application_name": absent
      - "tag.service_name": absent
      - "tag.group": absent


policies:
- name: tag-compliance-rds
  resource: aws.rds
  description: |
    Detect resources which does not meet tags compliance 
  filters: 
      - and: *tag-compliance-filters

但在 CSV 报告中,我看到了所有资源(甚至是符合此政策的资源)。使用了 c7n-org 实用程序。那么,问题是如何只过滤不具有这些标签中的至少一个的不合规资源?

【问题讨论】:

    标签: cloudcustodian


    【解决方案1】:

    我看到这篇文章很老了。还在回答

    您必须在过滤器中使用 OR。

    vars:
      tag-filters: &tag-compliance-filters
          - "tag.team_name": absent
          - "tag.product_name": absent
          - "tag.application_name": absent
          - "tag.service_name": absent
          - "tag.group": absent
    
    
    policies:
    - name: tag-compliance-rds
      resource: aws.rds
      description: |
        Detect resources which does not meet tags compliance 
      filters: 
          - or: *tag-compliance-filters
    

    【讨论】:

      猜你喜欢
      • 2015-08-15
      • 2013-09-29
      • 2020-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-02
      • 1970-01-01
      • 2022-08-22
      相关资源
      最近更新 更多