Skip to content

Commit

Permalink
Feature/update preventive scp (#1548)
Browse files Browse the repository at this point in the history
* Added policies

* Removed policy already existing in integrity.tf

* Fixing go vendor
  • Loading branch information
Mik-Nord committed Sep 18, 2024
1 parent e09d175 commit bc14bf4
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
71 changes: 71 additions & 0 deletions security/org-policies/preventive.tf
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,75 @@ data "aws_iam_policy_document" "preventive" {
values = ["arn:aws:iam::*:role/OrgRole"]
}
}

statement {
sid = "DenyRootUser"
effect = "Deny"
resources = ["*"]
actions = ["*"]

condition {
test = "StringLike"
variable = "aws:PrincipalArn"
values = ["arn:aws:iam::*:root"]
}
}

statement {
sid = "DenyPublicVPC"
effect = "Deny"
resources = ["*"]

actions = [
"ec2:AttachInternetGateway",
"ec2:CreateInternetGateway",
"ec2:CreateEgressOnlyInternetGateway",
"ec2:CreateVpcPeeringConnection",
"ec2:AcceptVpcPeeringConnection",
"globalaccelerator:Create*",
"globalaccelerator:Update*",
]

condition {
test = "StringNotLike"
variable = "aws:PrincipalArn"
values = ["arn:aws:iam::*:role/OrgRole"]
}
}

statement {
sid = ""
effect = "Deny"
resources = ["*"]
actions = ["ec2:AssociateAddress"]
}

statement {
sid = "DenyDisablingSecuritySettings"
effect = "Deny"
resources = ["*"]

actions = [
"ec2:DisableEbsEncryptionByDefault",
"s3:PutAccountPublicAccessBlock",
"s3:PutBucketPublicAccessBlock",
]
}

statement {
sid = "DenyLambdaFunctionUrlConfig"
effect = "Deny"
resources = ["arn:aws:lambda:*:*:function:*"]

actions = [
"lambda:CreateFunctionUrlConfig",
"lambda:UpdateFunctionUrlConfig",
]

condition {
test = "StringNotEquals"
variable = "lambda:FunctionUrlAuthType"
values = ["AWS_IAM"]
}
}
}
2 changes: 1 addition & 1 deletion test/integration/suite/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.dfds.cloud/infrastructure-modules/test/integration/suite

go 1.23
go 1.23.0

require (
github.com/fluxcd/pkg/apis/meta v1.6.0
Expand Down

0 comments on commit bc14bf4

Please sign in to comment.