Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Do not assign queries to pack (builtin), use top-level queries instead #114

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

preslavgerchev
Copy link
Contributor

@preslavgerchev preslavgerchev commented Nov 7, 2023

Those queries were on the pack level and that pack had no filters, meaning all queries get executed. To fix this, I have moved the queries to the top-level queries object which will lead to those queries properly being filtered out

Fixes mondoohq/cnspec#928

@czunker
Copy link
Contributor

czunker commented Nov 7, 2023

I gave this a try with an AWS account, and only the AWS queries were applied:

Asset: AWS Account mondoo-k8s-operator (1234)
-----------------------------------------------------

AWS ACM Certificates:
aws.acm.certificates.length: 0

AWS API Gateways:
aws.apigateway.restApis.length: 0

AWS Autoscaling Groups (not created by Mondoo):
aws.autoscaling.groups.where.length: 0

AWS CloudTrails:
aws.cloudtrail.trails.length: 1

AWS DynamoDB Global Tables:
aws.dynamodb.globalTables.length: 0

AWS DynamoDB Tables:
aws.dynamodb.tables.length: 0

AWS EC2 Instances:
aws.ec2.instances.length: 0

AWS ECS Clusters:
aws.ecs.clusters.length: 0

AWS ECS Container Instances:
aws.ecs.containerInstances.length: 0

AWS ECS Containers:
aws.ecs.containers.length: 0

AWS EFS Filesystems:
aws.efs.filesystems.length: 0

AWS ElastiCache Cache Clusters:
aws.elasticache.cacheClusters.length: 0

AWS ElastiCache Clusters:
aws.elasticache.clusters.length: 0

AWS Elastic Application Load Balancers:
aws.elb.loadBalancers.length: 0

AWS Elastic Classic Load Balancers:
aws.elb.classicLoadBalancers.length: 0

AWS Elastic Container Images (ECR):
aws.ecr.images.length: 0

AWS Elastic Kubernetes Clusters (EKS):
aws.eks.clusters.length: 4

AWS Elastic Map Reduce Clusters:
aws.emr.clusters.length: 0

AWS Elasticsearch Service Domain:
aws.es.domains.length: 0

AWS Guard Duty Detectors:
aws.guardduty.detectors.length: 0

AWS IAM custom policies:
aws.iam.policies.where.length: 0

AWS IAM groups:
aws.iam.groups.length: 0

AWS IAM users:
aws.iam.users.length: 1

AWS KMS Keys:
aws.kms.keys.length: 20

AWS Private Elastic Container Registries (ECR):
aws.ecr.privateRepositories.length: 0

AWS Public Elastic Container Registries (ECR):
aws.ecr.publicRepositories.length: 0

AWS RDS Database Clusters:
aws.rds.dbClusters.length: 0

AWS Redshift Clusters:
aws.redshift.clusters.length: 0

AWS Regions Active:
aws.regions.length: 17

AWS S3 Buckets:
aws.s3.buckets.length: 0

AWS SNS Topics:
aws.sns.topics.length: 0

AWS SageMaker Endpoints:
aws.sagemaker.endpoints.length: 0

AWS SageMaker Notebook Instances:
aws.sagemaker.notebookInstances.length: 0

AWS Secrets Manager Secrets:
aws.secretsmanager.secrets.length: 0

AWS Security Groups:
aws.ec2.securityGroups.length: 52

AWS Security Hub:
aws.securityhub.hubs.length: 0

AWS VPCs:
aws.vpcs.length: 21

Summary (1 assets)
==================

Target:     AWS Account mondoo-k8s-operator (12334)
Datapoints: 37

Copy link
Contributor

@czunker czunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@preslavgerchev preslavgerchev merged commit 6747b1e into main Nov 7, 2023
6 checks passed
@preslavgerchev preslavgerchev deleted the preslav/fix-asset-count-pack branch November 7, 2023 14:59
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data query filters in asset count policy not applying in edge/prod
2 participants