Johan
07/13/2025, 1:38 PMpolicies:
- name: ec2-patched-now
resource: ec2
filters:
- type: finding
key: Severity.Title
op: equals
value: "Systems Manager Patch Summary - Managed Instance Non-Compliant"
state: ACTIVE
- type: ssm-compliance
compliance_types:
- Association
- Patch
states:
- COMPLIANT
Jimmy Ray
07/14/2025, 7:03 PMChristoph Krüger
07/15/2025, 12:17 PMprasanna
07/17/2025, 3:24 PMprasanna
07/17/2025, 3:24 PMTraceback (most recent call last):
File "/aws-cet-custodian-aws/_work/cet-cloudcustodian-aws/cet-cloudcustodian-aws/custodian/bin/c7n-mailer", line 8, in <module>
sys.exit(main())
File "/aws-cet-custodian-aws/_work/cet-cloudcustodian-aws/cet-cloudcustodian-aws/custodian/lib64/python3.9/site-packages/c7n_mailer/cli.py", line 255, in main
deploy.provision(mailer_config, functools.partial(session_factory, mailer_config))
File "/aws-cet-custodian-aws/_work/cet-cloudcustodian-aws/cet-cloudcustodian-aws/custodian/lib64/python3.9/site-packages/c7n_mailer/deploy.py", line 86, in provision
archive = get_archive(config)
File "/aws-cet-custodian-aws/_work/cet-cloudcustodian-aws/cet-cloudcustodian-aws/custodian/lib64/python3.9/site-packages/c7n_mailer/deploy.py", line 48, in get_archive
archive = PythonPackageArchive(modules=deps)
File "/aws-cet-custodian-aws/_work/cet-cloudcustodian-aws/cet-cloudcustodian-aws/custodian/lib64/python3.9/site-packages/c7n/mu.py", line 82, in __init__
self.add_modules(None, modules)
File "/aws-cet-custodian-aws/_work/cet-cloudcustodian-aws/cet-cloudcustodian-aws/custodian/lib64/python3.9/site-packages/c7n/mu.py", line 126, in add_modules
module = importlib.import_module(module_name)
File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'ellipticcurve'
after_in_child hook reset_at_fork was unregistered without first being registered
2025-07-09 05:30:22,490 - ddtrace.internal.forksafe - INFO - after_in_child hook reset_at_fork was unregistered without first being registered
Error: Process completed with exit code 1.
kapilt
07/17/2025, 6:42 PMAndrew
07/17/2025, 10:54 PMfrom c7n.actions.core import BaseAction
from c7n.manager import resources as manager_resources
from c7n.utils import dumps
class ConsoleLog(BaseAction):
...
@classmethod
def register_resource(cls, registry, resource_class):
if "console-log" in resource_class.action_registry:
return
resource_class.action_registry.register("console-log", cls)
# Registers this action for all resources
resources.subscribe(ConsoleLog.register_resource)
Ludovic LANGE
07/21/2025, 11:03 AMc7n-org
to deploy a periodic
policy that needs to execute in a VPC (AWS Lambda). I'd like to find a way to parametrize the security_groups
and subnets
parameters.
The policy looks like:
policies:
- name: my-lambda
mode:
type: periodic
schedule: "cron(00 11 ? * MON *)"
role: arn:aws:iam::{account_id}:role/my-role
security_groups:
- sg-12345678
subnets:
- subnet-aabbccdd
- subnet-00112233
- subnet-44556677
filters:
...
As I'm deploying the same policy to multiple accounts / multiples regions, I need to make those security_groups
/ subnets
parameters not hardcoded in the policy - but dependent on the account (may be OK) and the region (more complex).
Variables can be used in the accounts Yaml file - which takes care of the account dependency:
• Policy
policies:
- name: my-lambda
mode:
type: periodic
schedule: "cron(00 11 ? * MON *)"
role: arn:aws:iam::{account_id}:role/my-role
security_groups: "{security_groups}"
subnets: "{subnets}"
filters:
...
• Accounts
- account_id: '012345670901'
regions:
- eu-west-1
- eu-west-3
....
vars:
security_groups:
- sg-12345678
subnets:
- subnet-aabbccdd
- subnet-00112233
- subnet-44556677
....
But this can only make variables depend on account
. However the security_groups
and subnets
are dependent on account
X region
.
I tried to index the variable reference with either:
security_groups: "{security_groups[{region}]}"
or
security_groups: "{security_groups[region]}"
But it's not supported.
I may be able to "fix it" by adding special handling of variable resolution with references to other variables, but I was wondering if someone else had face this issue and how it was overcome.
(One solution would be to denormalize the accounts - duplicate each account the same number of time it has different regions ; but I'm looking for an alternative)
Let me know your thoughts.Andrew (Ego) Egelhofer
07/23/2025, 9:49 PM- IncludeDisabled: true
in the query
block because disabled AMIs won’t be visible by default
How can I do that from a Policy’s YAML definition; I’m not immediately finding a way to do this in the docsprasanna
07/24/2025, 1:42 PMprasanna
07/24/2025, 1:42 PM2025-07-24T13:39:57.654Z
[ERROR] Runtime.ImportModuleError: Unable to import module 'periodic': No module named 'jwt'
Traceback (most recent call last):
[ERROR] Runtime.ImportModuleError: Unable to import module 'periodic': No module named 'jwt' Traceback (most recent cal
2025-07-24T13:39:57.799Z
INIT_REPORT Init Duration: 1365.58 ms Phase: invoke Status: error Error Type: Runtime.ImportModuleError
INIT_REPORT Init Duration: 1365.58 ms Phase: invoke Status: error Error Type: Runtime.ImportModuleError
prasanna
07/24/2025, 1:47 PMprasanna
07/24/2025, 4:12 PMAndrew
07/24/2025, 5:33 PMprasanna
07/25/2025, 2:55 PMStephen Colebrook
07/30/2025, 1:05 PMBrian Gaber
07/31/2025, 9:25 PM- name: unused-credentials
resource: iam-user
filters:
- type: usage
LastAuthenticated:
type: value
value_type: age
op: greater-than
value: 45
match-operator: any
I get this error:
c7n_org:ERROR Exception running policy:unused-credentials account:go-noc-rd region:us-east-1 error:argument of type 'type' is not iterable
Any ideas on cause of error?Joe Vaughan
08/01/2025, 3:41 PMAsik Rasool
08/04/2025, 7:19 PMrole
to all the policy section.. is there anyway to mentioned Lambda IAM role in single place instead of just mentioning in all the policies section.
Exception running policy:ec2-auto-tagger account:default region:us-east-1 error:Lambda function role must be specified
Exception running policy:ami-auto-tagger account:default region:us-east-1 error:Lambda function role must be specified
Exception running policy:eip-auto-tagger account:default region:us-east-1 error:Lambda function role must be specified
Phe Nguyen
08/06/2025, 1:48 AMBrian Gaber
08/06/2025, 3:40 PMcloudcustodian/c7n
and cloudcustodian/c7n-org
Docker images be FIPS compliant so that they could be used in a FedRAMP environment?Michael Davis
08/11/2025, 7:49 PM- name: ec2-stopped-over-60-notify-windows
resource: aws.ec2
description: |
Notify Windows team of instances stopped over 60 days.
query:
- instance-state-name: stopped
filters:
- Platform: windows
- type: state-age
op: gt
days: 60
- not:
- or:
- "tag:cc-exemption": "stopped-dr"
- "tag:cc-exemption": "stopped-asneeded"
Michael Davis
08/11/2025, 7:49 PMSteveL
08/12/2025, 1:04 PMPong
08/12/2025, 7:47 PMSteveL
08/13/2025, 11:23 AMJacob
08/14/2025, 3:17 PM- "tag:owner": absent
- "tag:environment": absent
But using something like the below does not work:
- "label:owner": absent
You can definitely filter on label values. Just can’t find how to filter on missing labelsSteveL
08/20/2025, 10:21 AMSteveL
08/20/2025, 11:15 AMDerrick Tumblin
08/27/2025, 12:25 AM