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

🧹 Updating AWS Policies to Align with Recent Developments #385

Merged
merged 33 commits into from
Apr 21, 2024

Conversation

HRouhani
Copy link
Contributor

No description provided.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
…t level

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
…3 Buckets

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
@HRouhani HRouhani force-pushed the hossein/aws-Upgrade branch from e51f99b to 2a54d6a Compare April 18, 2024 09:53
…concurrent execution limits

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

…ances are configured for deletion on instance termination

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

…ion protection enabled

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

…h Encryption-at-Rest

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

…ide encryption KMS & SageMaker test

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>

This comment has been minimized.

@HRouhani HRouhani marked this pull request as ready for review April 18, 2024 16:15
Copy link
Contributor

@mm-weber mm-weber left a comment

Choose a reason for hiding this comment

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

Generally it's a good idea to update the checks to keep in line with the new developments, but there's a problem with changing the asset_filters: of existing checks to other assets.

Many checks have been moved from the single asset, to the cluster asset, which 1) isn't the direction we're moving with checks in general and 2) more importantly, existing customers might have already worked with the single asset checks.

Would be great if we can keep the asset_filter scopes and just update the checks as needed.

core/mondoo-aws-security.mql.yaml Show resolved Hide resolved
core/mondoo-aws-security.mql.yaml Show resolved Hide resolved
core/mondoo-aws-security.mql.yaml Outdated Show resolved Hide resolved
core/mondoo-aws-security.mql.yaml Show resolved Hide resolved
core/mondoo-aws-security.mql.yaml Show resolved Hide resolved
…ion-level concurrent execution limits

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
…Management Service

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
…onfigured for deletion on instance

Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Copy link
Contributor

@mm-weber mm-weber left a comment

Choose a reason for hiding this comment

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

Thanks for the changes to the checks @HRouhani . Those all look good.

We need to double check and most likely remove all filters: asset.platform == "aws" at group level as those will never allow any of the single asset level variants: to run.

core/mondoo-aws-security.mql.yaml Outdated Show resolved Hide resolved
core/mondoo-aws-security.mql.yaml Outdated Show resolved Hide resolved
core/mondoo-aws-security.mql.yaml Outdated Show resolved Hide resolved
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
@HRouhani
Copy link
Contributor Author

HRouhani commented Apr 20, 2024

@mm-weber It should be fine now, I did it exactly like what we did in Azure, using asset.runtime. You can test all variant using following script:

#!/bin/bash

# List of AWS resource types to check
resource_types=(
  "ssm-instances"
  "ssm-instances-api"
  "ecr"
  "ecs"
  "s3-buckets"
  "cloudtrail-trails"
  "rds-dbinstances"
  "rds-dbclusters"
  "vpcs"
  "security-groups"
  "iam-users"
  "iam-groups"
  "cloudwatch-loggroups"
  "lambda-functions"
  "dynamodb-tables"
  "redshift-clusters"
  "ec2-volumes"
  "ec2-snapshots"
  "efs-filesystems"
  "gateway-restapis"
  "elb-loadbalancers"
  "es-domains"
  "kms-keys"
  "sagemaker-notebookinstances"
  "accounts"
  "ec2-instances-api"
  "instances"
)

# Path to the cnspec binary and the MQL file
cnspec_path="/home/.../cnspec"
bundle="/home/....mondoo-aws-security.mql.yaml"

# Loop over each resource type and execute the scan
for resource in "${resource_types[@]}"; do
  echo "********Discovering the $resource  resources and Starting to scan it respectively.....*********"
  $cnspec_path scan aws -f $bundle --discover "$resource"
done

echo "Scanning completed."

Change the cnspec path to your binary as well as the bundle path.

Copy link
Contributor

@mm-weber mm-weber left a comment

Choose a reason for hiding this comment

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

Good stuff @HRouhani !
Thank you.

@mm-weber mm-weber merged commit 345c5fc into main Apr 21, 2024
7 checks passed
@mm-weber mm-weber deleted the hossein/aws-Upgrade branch April 21, 2024 15:38
@github-actions github-actions bot locked and limited conversation to collaborators Apr 21, 2024
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.

2 participants