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

Restore release cadence #155

Merged
merged 4 commits into from
Dec 27, 2021
Merged

Restore release cadence #155

merged 4 commits into from
Dec 27, 2021

Conversation

Nuru
Copy link
Contributor

@Nuru Nuru commented Dec 27, 2021

what and why

@Nuru Nuru requested review from a team as code owners December 27, 2021 21:33
Copy link

@bridgecrew bridgecrew bot left a 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" {
Copy link

@bridgecrew bridgecrew bot Dec 27, 2021

Choose a reason for hiding this comment

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

LOW   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" {
Copy link

@bridgecrew bridgecrew bot Dec 27, 2021

Choose a reason for hiding this comment

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

LOW   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" {
Copy link

@bridgecrew bridgecrew bot Dec 27, 2021

Choose a reason for hiding this comment

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

LOW   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

@Nuru
Copy link
Contributor Author

Nuru commented Dec 27, 2021

/test all

NOTE: Failure of Validate Codeowners is to due to restrictions placed on bots on this repository and is not significant.

Copy link
Member

@nitrocode nitrocode left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@korenyoni korenyoni left a 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

Comment on lines -232 to -233
- name: Vladimir Syromyatnikov
github: SweetOps
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants