CCSS (Common Configuration Scoring System) is a set of measures used to determine the severity of the rule.
Each rule is associated with a high-level category. For example IAM, Container, Monitoring, Logging, Network, etc.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsGranting broad permissions in the ECR repository policy can lead to unauthorized access and potential data breaches. Policies that are too permissive may allow users to perform any action on the ECR repository, increasing the risk of accidental or malicious alterations, deletions, or exposure of sensitive container images. It is essential to adhere to the principle of least privilege by restricting actions to the minimum required for specific roles or services.
Set the policy.Statement.Action
attribute in aws_ecr_repository_policy
resource to a value other than ecr:*
.
resource "aws_ecr_repository" "allowed1" {
name = "allowed_764"
}
resource "aws_ecr_repository_policy" "allowed1_policy" {
repository = aws_ecr_repository.allowed1.name
policy = jsonencode(
{
Version = "2012-10-17",
Statement = [
{
Principal = {
"AWS" : ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"]
}
Effect = "Allow",
Action = [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:InitiateLayerUpload",
"ecr:ListImages"
],
},
]
}
)
}