-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Restore release cadence #155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bridgecrew has found infrastructure configuration errors in this PR ⬇️
@@ -225,15 +228,15 @@ data "aws_iam_policy_document" "ecs_task_exec" { | |||
} | |||
|
|||
resource "aws_iam_role" "ecs_exec" { | |||
count = local.enabled && length(var.task_exec_role_arn) == 0 ? 1 : 0 | |||
count = local.create_exec_role ? 1 : 0 | |||
name = module.exec_label.id | |||
assume_role_policy = join("", data.aws_iam_policy_document.ecs_task_exec.*.json) | |||
permissions_boundary = var.permissions_boundary == "" ? null : var.permissions_boundary | |||
tags = module.exec_label.tags | |||
} | |||
|
|||
data "aws_iam_policy_document" "ecs_exec" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure IAM policies does not allow write access without constraint
Resource: aws_iam_policy_document.ecs_exec | ID: BC_AWS_IAM_57
How to Fix
data "aws_iam_policy_document" "example" {
statement {
sid = "1"
effect = "Allow"
actions = [
"s3:*"
]
resources = [
"foo",
]
}
}
Description
This policy allows actions that permit modification of resource-based policies or can otherwise can expose AWS resources to the public via similar actions that can lead to resource exposure.For example:
1 - s3:PutBucketPolicy, s3:PutBucketAcl, and s3:PutObjectAcl grant permissions to modify the properties of S3 buckets or objects for new or existing objects in an S3 bucket, which could expose objects to rogue actors or to the internet.
2 - ecr:SetRepositoryPolicy could allow an attacker to exfiltrate container images (which sometimes unintentionally contain secrets and non-public information), tamper with container images, or otherwise modify.
3 - iam:UpdateAssumeRolePolicy could allow an attacker to create a backdoor by assuming a privileged role in the victim account from an external account.
The ability to modify AWS Resource Access Manager, which could allow a malicious actor to share a VPC hosting sensitive or internal services to rogue AWS accounts
Attackers can easily exploit Resource Exposure permissions to expose resources to rogue users or the internet, as shown by endgame, an AWS pentesting tool that was also released by Salesforce.
For more info, visit cloudsplaning documentation
https://cloudsplaining.readthedocs.io/en/latest/glossary/resource-exposure/
@@ -225,15 +228,15 @@ data "aws_iam_policy_document" "ecs_task_exec" { | |||
} | |||
|
|||
resource "aws_iam_role" "ecs_exec" { | |||
count = local.enabled && length(var.task_exec_role_arn) == 0 ? 1 : 0 | |||
count = local.create_exec_role ? 1 : 0 | |||
name = module.exec_label.id | |||
assume_role_policy = join("", data.aws_iam_policy_document.ecs_task_exec.*.json) | |||
permissions_boundary = var.permissions_boundary == "" ? null : var.permissions_boundary | |||
tags = module.exec_label.tags | |||
} | |||
|
|||
data "aws_iam_policy_document" "ecs_exec" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure IAM policies do not allow data exfiltration
Resource: aws_iam_policy_document.ecs_exec | ID: BC_AWS_IAM_55
How to Fix
data "aws_iam_policy_document" "example" {
statement {
sid = "1"
effect = "Allow"
actions = [
"lambda:CreateFunction",
"lambda:CreateEventSourceMapping",
"dynamodb:CreateTable",
]
resources = [
"*",
]
}
}
Description
Data Exfiltration actions allow certain read-only IAM actions without resource constraints, such as s3:GetObject, ssm:GetParameter*, or secretsmanager:GetSecretValue.1 - Unrestricted s3:GetObject permissions has a long history of customer data leaks
2 - ssm:GetParameter* and secretsmanager:GetSecretValue are both used to access secrets.
3 - rds:CopyDBSnapshot and rds:CreateDBSnapshot can be used to exfiltrate RDS database contents.
For more info, visit cloudsplaning documentation
https://cloudsplaining.readthedocs.io/en/latest/glossary/data-exfiltration/
} | ||
} | ||
|
||
resource "aws_security_group_rule" "allow_all_egress" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure every Security Group rule has a description
Resource: aws_security_group_rule.allow_all_egress | ID: BC_AWS_NETWORKING_31
Description
Descriptions can be up to 255 characters long and can be set and viewed from the AWS Management Console, AWS Command Line Interface (CLI), and the AWS APIs.We recommend you add descriptive text to each of your Security Group Rules clarifying each rule's goals, this helps prevent developer errors.
Benchmarks
- SOC2 CC6.3.3
- ISO27001 A.10.1.1
/test all NOTE: Failure of Validate Codeowners is to due to restrictions placed on bots on this repository and is not significant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but left a comment
- name: Vladimir Syromyatnikov | ||
github: SweetOps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this comes from a git revert, but I would leave this in
what and why
enable_ecs_service_role
totrue
only if there is a load balancer #118, closes Unable to use module with bridge network_mode and without load balancers. #136, via Change condition for ecs_load_balancers #137, Fix Exception when no ALB is assigned to the service #145, thanks to @ragumix, @verbalius, @asiragusatask_definition_arn
output #125, thanks to @nitrocode>= 3.69.0
#152, thanks to @ethanrubiomake github/init
#154, thanks to @korenyoni