Ownership rule packs
scan runs these packs, in this order, on every resource that no state manages. Then it runs your rules. The first rule that matches sets the resource's category, owner and reason, and the finding carries the rule's ID. Turn a pack off with scan.packs.<name>: false. The fields and functions a match expression can use are on the CEL reference.
| Pack | Category | Rules |
|---|---|---|
| aws-defaults | aws-managed | 10 |
| aws-service | aws-managed | 15 |
| other-iac | other-iac | 13 |
| derived | derived | 12 |
| ephemeral | ignored | 2 |
| guards | guard | 1 |
aws-defaults
Resources AWS creates in every account and region: the default VPC and what it comes with.
Category aws-managed. Config key scan.packs.aws-defaults, on by default.
default-vpc
Rule pack/aws-defaults/default-vpc, owner aws: default VPC that AWS creates in every region.
resource.type == "AWS::EC2::VPC" && resource.attrs.?is_default.orValue("") == "true"default-subnet
Rule pack/aws-defaults/default-subnet, owner aws: default subnet of the default VPC.
resource.type == "AWS::EC2::Subnet" && resource.attrs.?default_for_az.orValue("") == "true"default-network-acl
Rule pack/aws-defaults/default-network-acl, owner aws: default network ACL that AWS creates with every VPC.
resource.type == "AWS::EC2::NetworkAcl" && resource.attrs.?is_default.orValue("") == "true"default-security-group
Rule pack/aws-defaults/default-security-group, owner aws: default security group that AWS creates with every VPC.
resource.type == "AWS::EC2::SecurityGroup" && resource.name == "default"default-vpc-children
Rule pack/aws-defaults/default-vpc-children, owner aws: internet gateway, route table or DHCP options of the default VPC.
resource.type in ["AWS::EC2::InternetGateway", "AWS::EC2::RouteTable", "AWS::EC2::DHCPOptions"] && resource.relationships.exists(r, r.type == "AWS::EC2::VPC" && r.attrs.?is_default.orValue("") == "true")apex-ns-soa
Rule pack/aws-defaults/apex-ns-soa, owner aws: NS or SOA record at a hosted zone's apex, which Route 53 creates with every zone.
resource.type == "AWS::Route53::RecordSet" && resource.attrs.?apex.orValue("") == "true" && resource.attrs.?type.orValue("") in ["NS", "SOA"]default-dhcp-options
Rule pack/aws-defaults/default-dhcp-options, owner aws: DHCP options that AWS creates with the default VPC (only domain-name and AmazonProvidedDNS).
resource.type == "AWS::EC2::DHCPOptions" && size(resource.tags) == 0 && resource.attrs.?dhcp_options.orValue("") == "domain-name-servers=AmazonProvidedDNS;domain-name=" + (resource.region == "us-east-1" ? "ec2.internal" : resource.region + ".compute.internal")main-route-table
Rule pack/aws-defaults/main-route-table, owner aws: main route table that AWS creates with every VPC.
resource.type == "AWS::EC2::RouteTable" && resource.attrs.?main.orValue("") == "true"regional-nat-route-table
Rule pack/aws-defaults/regional-nat-route-table, owner aws: route table that AWS creates with a regional NAT gateway.
resource.type == "AWS::EC2::RouteTable" && resource.attrs.?regional_nat_gateway.orValue("") != ""account-defaults
Rule pack/aws-defaults/account-defaults, owner aws: resource that every account or region has once the service is used: default deployment configurations, capacity providers, buses, groups, workgroups, vaults, users (with ElastiCache's system-managed default.iam-user and default.iam-user-group), parameter groups, auto-defined Resolver rules and AWS-managed prefix lists.
(resource.source_type == "codedeploy:deploymentconfig" || resource.type == "AWS::CodeDeploy::DeploymentConfig") && [resource.name, resource.id].exists(n, n.startsWith("CodeDeployDefault.")) || (resource.source_type == "appconfig:deploymentstrategy" || resource.type == "AWS::AppConfig::DeploymentStrategy") && [resource.name, resource.id].exists(n, n.startsWith("AppConfig.")) || resource.type == "AWS::Cassandra::Keyspace" && [resource.name, resource.id].exists(n, n.startsWith("system")) || (resource.source_type == "ecs:capacity-provider" || resource.type == "AWS::ECS::CapacityProvider") && [resource.name, resource.id].exists(n, n in ["FARGATE", "FARGATE_SPOT"]) || resource.type in ["AWS::Scheduler::ScheduleGroup", "AWS::Events::EventBus"] && [resource.name, resource.id].exists(n, n == "default") || resource.type in ["AWS::Route53Resolver::ResolverRule", "AWS::Route53Resolver::ResolverRuleAssociation"] && resource.id.startsWith("rslvr-autodefined-") || resource.type == "AWS::Athena::WorkGroup" && resource.name == "primary" || resource.type == "AWS::Athena::DataCatalog" && resource.name == "AwsDataCatalog" || resource.type == "AWS::Backup::BackupVault" && resource.name == "Default" || resource.type in ["AWS::XRay::Group", "AWS::XRay::SamplingRule"] && [resource.name, resource.id].exists(n, n == "Default") || resource.type in ["AWS::ElastiCache::User", "AWS::ElastiCache::UserGroup"] && (resource.name == "default" || resource.name.startsWith("default.")) || resource.type == "AWS::MemoryDB::User" && resource.name == "default" || resource.type == "AWS::MemoryDB::ACL" && resource.name == "open-access" || resource.type in ["AWS::RDS::DBParameterGroup", "AWS::MemoryDB::ParameterGroup"] && resource.name.startsWith("default.") || resource.type == "AWS::RDS::OptionGroup" && resource.name.startsWith("default:") || resource.type == "AWS::EC2::PrefixList" && (resource.arn.contains(":aws:prefix-list/") || resource.name.startsWith("com.amazonaws.")) || resource.type == "AWS::AppRunner::AutoScalingConfiguration" && resource.arn.contains(":autoscalingconfiguration/DefaultConfiguration/")aws-service
Resources that AWS services, IAM Identity Center, Control Tower, StackSets and CDK bootstrap create.
Category aws-managed. Config key scan.packs.aws-service, on by default.
service-linked-role
Rule pack/aws-service/service-linked-role, owner aws: service-linked role that an AWS service created.
resource.type == "AWS::IAM::Role" && resource.arn.contains(":role/aws-service-role/")sso-role
Rule pack/aws-service/sso-role, owner iam-identity-center: permission set role that IAM Identity Center created.
resource.type == "AWS::IAM::Role" && resource.name.startsWith("AWSReservedSSO_")control-tower
Rule pack/aws-service/control-tower, owner control-tower: created by AWS Control Tower.
resource.name.startsWith("aws-controltower-") || resource.name.startsWith("AWSControlTower") || resource.arn.contains(":role/aws-controltower-") || resource.arn.contains(":role/AWSControlTower")stacksets-execution-role
Rule pack/aws-service/stacksets-execution-role, owner cloudformation-stacksets: execution role of CloudFormation StackSets.
resource.type == "AWS::IAM::Role" && (resource.name.startsWith("stacksets-exec-") || resource.name == "AWSCloudFormationStackSetExecutionRole")aws-managed-kms-key
Rule pack/aws-service/aws-managed-kms-key, owner aws: AWS managed KMS key (KeyManager AWS).
resource.type == "AWS::KMS::Key" && resource.attrs.?key_manager.orValue("") == "AWS"aws-kms-alias
Rule pack/aws-service/aws-kms-alias, owner aws: alias of an AWS managed KMS key.
resource.type == "AWS::KMS::Alias" && (resource.arn.contains(":alias/aws/") || resource.name.startsWith("alias/aws/"))cdk-bootstrap
Rule pack/aws-service/cdk-bootstrap, owner cdk: CDK bootstrap resource (default qualifier hnb659fds).
resource.name.startsWith("cdk-hnb659fds-") || resource.name.startsWith("cdktoolkit-stagingbucket-") || resource.arn.contains(":role/cdk-hnb659fds-")eks-cluster-security-group
Rule pack/aws-service/eks-cluster-security-group, owner eks: cluster security group that EKS creates with every cluster.
resource.type == "AWS::EC2::SecurityGroup" && resource.name.startsWith("eks-cluster-sg-") && "aws:eks:cluster-name" in resource.tagsquicksight-service-role
Rule pack/aws-service/quicksight-service-role, owner quicksight: service role or policy that QuickSight created under /service-role/.
resource.type in ["AWS::IAM::Role", "AWS::IAM::ManagedPolicy"] && (resource.arn.contains(":role/service-role/") || resource.arn.contains(":policy/service-role/")) && (resource.name.startsWith("aws-quicksight-") || resource.name.startsWith("AWSQuickSight"))apigateway-log-group
Rule pack/aws-service/apigateway-log-group, owner apigateway: execution log group that API Gateway created.
resource.type == "AWS::Logs::LogGroup" && (resource.name.startsWith("API-Gateway-Execution-Logs_") || resource.name == "/aws/apigateway/welcome")service-linked-secret
Rule pack/aws-service/service-linked-secret, owner aws: secret that an AWS service created and manages (a <service>! name or the owningService tag).
resource.type == "AWS::SecretsManager::Secret" && (resource.name.matches("^(appflow|databrew|datasync|directconnect|ecs-sc|events|marketplace-deployment|opsworks-cm|pcs|rds|redshift|s2svpn|sqlworkbench)!") || "aws:secretsmanager:owningService" in resource.tags)log-delivery-bucket-policy
Rule pack/aws-service/log-delivery-bucket-policy, owner log-delivery: bucket policy that log delivery added (only AWSLogDeliveryWrite and AWSLogDeliveryAclCheck statements).
resource.type == "AWS::S3::BucketPolicy" && resource.attrs.?policy_sids.orValue("") != "" && resource.attrs.policy_sids.split(",").all(s, s.startsWith("AWSLogDeliveryWrite") || s.startsWith("AWSLogDeliveryAclCheck"))autoscaling-managed-rule
Rule pack/aws-service/autoscaling-managed-rule, owner autoscaling: EventBridge rule that EC2 Auto Scaling creates and manages (ManagedBy autoscaling.amazonaws.com).
resource.type == "AWS::Events::Rule" && resource.name == "AutoScalingManagedRule"efs-automatic-backup
Rule pack/aws-service/efs-automatic-backup, owner efs: backup plan, vault or selection that Amazon EFS creates for automatic backups.
resource.type in ["AWS::Backup::BackupPlan", "AWS::Backup::BackupVault", "AWS::Backup::BackupSelection"] && resource.name in ["aws/efs/automatic-backup-plan", "aws/efs/automatic-backup-vault", "aws/efs/automatic-backup-selection"]quicksight-policy-attachment
Rule pack/aws-service/quicksight-policy-attachment, owner quicksight: QuickSight service policy that QuickSight attached when its data source access changed.
resource.type == "Native::IAM::RolePolicyAttachment" && resource.attrs.?policy_arn.orValue("").matches(":policy/service-role/AWSQuick[Ss]ight")other-iac
Resources that another IaC tool or a Kubernetes controller manages, found by the tags it sets.
Category other-iac. Config key scan.packs.other-iac, on by default.
cloudformation
Rule pack/other-iac/cloudformation, owner cloudformation: tagged by a CloudFormation stack (CloudFormation, CDK, StackSets, Control Tower).
"aws:cloudformation:stack-name" in resource.tags || "aws:cloudformation:stack-id" in resource.tagspulumi
Rule pack/other-iac/pulumi, owner pulumi: tagged by Pulumi.
resource.tags.exists(k, k.startsWith("pulumi:"))crossplane
Rule pack/other-iac/crossplane, owner crossplane: tagged by Crossplane (crossplane-kind, crossplane-name).
resource.tags.exists(k, k.startsWith("crossplane.io/") || k.startsWith("crossplane-"))aft
Rule pack/other-iac/aft, owner aft: created by Account Factory for Terraform.
resource.type == "AWS::IAM::Role" && resource.name in ["AWSAFTAdmin", "AWSAFTExecution", "AWSAFTService"] || resource.tags.?managed_by.orValue("") == "AFT"cloudformation-stack
Rule pack/other-iac/cloudformation-stack, owner cloudformation: a CloudFormation stack is itself infrastructure as code.
resource.type == "AWS::CloudFormation::Stack"external-dns
Rule pack/other-iac/external-dns, owner external-dns: record or TXT ownership record of external-dns (heritage=external-dns).
resource.type == "AWS::Route53::RecordSet" && resource.attrs.?external_dns.orValue("") == "true"aws-load-balancer-controller-rule
Rule pack/other-iac/aws-load-balancer-controller-rule, owner aws-load-balancer-controller: security group rule that the AWS Load Balancer Controller wrote.
resource.type in ["AWS::EC2::SecurityGroupIngress", "AWS::EC2::SecurityGroupEgress"] && (resource.attrs.?controller.orValue("") == "aws-load-balancer-controller" || resource.relationships.exists(r, r.relationship == "References" && "elbv2.k8s.aws/cluster" in r.tags))in-tree-elb-rule
Rule pack/other-iac/in-tree-elb-rule, owner cloud-provider-aws: security group rule that the in-tree Kubernetes cloud provider wrote for an NLB.
resource.type in ["AWS::EC2::SecurityGroupIngress", "AWS::EC2::SecurityGroupEgress"] && resource.attrs.?controller.orValue("") == "cloud-provider-aws"vpc-cni-eni
Rule pack/other-iac/vpc-cni-eni, owner vpc-cni: network interface that the Amazon VPC CNI plugin created.
resource.type == "AWS::EC2::NetworkInterface" && ("eks:eni:owner" in resource.tags || "node.k8s.amazonaws.com/instance_id" in resource.tags)ebs-csi
Rule pack/other-iac/ebs-csi, owner ebs-csi-driver: volume or snapshot that the EBS CSI driver created.
"ebs.csi.aws.com/cluster" in resource.tagsefs-csi
Rule pack/other-iac/efs-csi, owner efs-csi-driver: access point that the EFS CSI driver created.
"efs.csi.aws.com/cluster" in resource.tagsack
Rule pack/other-iac/ack, owner ack: created by an AWS Controllers for Kubernetes (ACK) controller.
"services.k8s.aws/controller-version" in resource.tagskubernetes
Rule pack/other-iac/kubernetes, owner kubernetes: tagged by a Kubernetes controller (cloud provider, AWS Load Balancer Controller).
resource.tags.exists(k, k.startsWith("kubernetes.io/cluster/") || k.startsWith("elbv2.k8s.aws/") || k.startsWith("ingress.k8s.aws/"))derived
Resources that AWS creates as children of another resource.
Category derived. Config key scan.packs.derived, on by default.
service-eni
Rule pack/derived/service-eni, owner aws: network interface that an AWS service created (requester-managed, a service interface type, an attachment owned by another account, or a Lambda or VPC CNI description).
resource.type == "AWS::EC2::NetworkInterface" && (resource.attrs.?requester_managed.orValue("") == "true" || resource.attrs.?interface_type.orValue("") in ["api_gateway_managed", "aws_codestar_connections_managed", "branch", "ec2_instance_connect_endpoint", "efs", "gateway_load_balancer", "gateway_load_balancer_endpoint", "global_accelerator_managed", "iot_rules_managed", "lambda", "load_balancer", "nat_gateway", "network_load_balancer", "quicksight", "transit_gateway", "trunk", "vpc_endpoint"] || resource.attrs.?instance_owner_id.orValue(resource.account) != resource.account || ["AWS Lambda VPC ENI-", "aws-K8S-", "aws-k8s-branch-eni", "aws-k8s-trunk-eni"].exists(p, resource.attrs.?description.orValue("").startsWith(p)))autoscaled-instance
Rule pack/derived/autoscaled-instance, owner aws: instance launched by an Auto Scaling group, an EKS node group or Karpenter.
resource.type == "AWS::EC2::Instance" && ("aws:autoscaling:groupName" in resource.tags || "eks:nodegroup-name" in resource.tags || resource.tags.exists(k, k.startsWith("karpenter.sh/")))node-launch-template
Rule pack/derived/node-launch-template, owner aws: launch template that EKS or Karpenter created.
resource.type == "AWS::EC2::LaunchTemplate" && ("eks:nodegroup-name" in resource.tags || "eks:cluster-name" in resource.tags || resource.tags.exists(k, k.startsWith("karpenter.sh/") || k.startsWith("karpenter.k8s.aws/")))ecs-task
Rule pack/derived/ecs-task, owner aws: task that ECS started.
resource.source_type == "ecs:task"lambda-edge-replica
Rule pack/derived/lambda-edge-replica, owner aws: Lambda@Edge replica of a function in us-east-1.
resource.type == "AWS::Lambda::Function" && resource.region != "us-east-1" && resource.name.startsWith("us-east-1.")derived-instance-volume
Rule pack/derived/derived-instance-volume, owner aws: volume attached to an instance that an Auto Scaling group, EKS or Karpenter launched.
resource.type == "AWS::EC2::Volume" && resource.relationships.exists(r, r.type == "AWS::EC2::Instance" && ("aws:autoscaling:groupName" in r.tags || "eks:nodegroup-name" in r.tags || r.tags.exists(k, k.startsWith("karpenter.sh/"))))backup-snapshot
Rule pack/derived/backup-snapshot, owner aws-backup: snapshot or recovery point that AWS Backup created.
"aws:backup:source-resource" in resource.tagslambda-version
Rule pack/derived/lambda-version, owner lambda: published version of a Lambda function a unit manages (publish = true).
(resource.type == "AWS::Lambda::Version" || resource.source_type == "lambda:function/version") && resource.arn.split(":").size() == 8 && in_state("aws_lambda_function", resource.arn.split(":")[6])rds-automated-snapshot
Rule pack/derived/rds-automated-snapshot, owner rds: automated RDS snapshot or backup.
resource.source_type == "rds:auto-backup" || (resource.source_type in ["rds:snapshot", "rds:cluster-snapshot"] || resource.type in ["AWS::RDS::DBSnapshot", "AWS::RDS::DBClusterSnapshot"]) && (resource.arn.contains(":snapshot:rds:") || resource.arn.contains(":cluster-snapshot:rds:"))backup-recovery-point
Rule pack/derived/backup-recovery-point, owner aws-backup: recovery point in a backup vault a unit manages.
(resource.type == "AWS::Backup::RecoveryPoint" || resource.source_type == "backup:recovery-point") && resource.relationships.exists(r, r.type == "AWS::Backup::BackupVault" && in_state("aws_backup_vault", r.id))addon-pod-identity-association
Rule pack/derived/addon-pod-identity-association, owner eks: Pod Identity association that an EKS add-on owns (ownerArn is set).
resource.type == "AWS::EKS::PodIdentityAssociation" && resource.attrs.?owner_arn.orValue("") != ""target-tracking-alarm
Rule pack/derived/target-tracking-alarm, owner application-autoscaling: alarm that a target tracking scaling policy created.
resource.type == "AWS::CloudWatch::Alarm" && resource.name.startsWith("TargetTracking-")ephemeral
Short-lived or by-product resources that nobody manages on purpose.
Category ignored. Config key scan.packs.ephemeral, on by default.
managed-lambda-log-group
Rule pack/ephemeral/managed-lambda-log-group: log group that Lambda created for a function a unit manages.
resource.type == "AWS::Logs::LogGroup" && resource.name.startsWith("/aws/lambda/") && in_state("aws_lambda_function", resource.name.substring(12))athena-query-results
Rule pack/ephemeral/athena-query-results, owner athena: bucket that the Athena console created for query results.
resource.type == "AWS::S3::Bucket" && resource.name.startsWith("aws-athena-query-results-")guards
Guarded resources: a user rule whose category is in never_hide never applies to them. AWS Config doesn't record whether an IAM user has a console password, so every IAM user is guarded.
A guard sets no category. A user rule whose category is listed in scan.never_hide doesn't apply to a guarded resource, so the resource stays unmanaged.
iam-user
Rule guard/iam-user: IAM users can hold long-lived credentials.
resource.type == "AWS::IAM::User"