-
Notifications
You must be signed in to change notification settings - Fork 2
eli-731 adding missing permissions that the regression test role needs #658
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -836,6 +836,7 @@ data "aws_iam_policy_document" "regression_test_permissions" { | |
| "dynamodb:Scan", | ||
| "dynamodb:UpdateItem", | ||
| "dynamodb:DeleteItem", | ||
| "dynamodb:BatchWriteItem", | ||
| "dynamodb:DescribeTable", | ||
| "dynamodb:DeleteTable", | ||
| "dynamodb:TagResource", | ||
|
|
@@ -851,19 +852,21 @@ data "aws_iam_policy_document" "regression_test_permissions" { | |
| sid = "DynamoGlobal" | ||
| effect = "Allow" | ||
| actions = [ | ||
| "dynamodb:ListTables", | ||
| "dynamodb:CreateTable" | ||
| "dynamodb:ListTables", | ||
| "dynamodb:CreateTable" | ||
| ] | ||
| resources = ["*"] | ||
| } | ||
|
|
||
| statement { | ||
| sid = "SecretsManagerAccess" | ||
| sid = "SecretsManagerAccess" | ||
| effect = "Allow" | ||
| actions = [ | ||
| "secretsmanager:GetSecretValue", | ||
| "secretsmanager:DescribeSecret" | ||
| ] | ||
| "secretsmanager:DescribeSecret", | ||
| "secretsmanager:UpdateSecretVersionStage", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UpdateSecretVersionStage and PutSecretValue are used by the regression tests to test hashing/secrets |
||
| "secretsmanager:PutSecretValue" | ||
| ] | ||
| resources = ["arn:aws:secretsmanager:${var.default_aws_region}:${data.aws_caller_identity.current.account_id}:secret:eligibility-signposting-api-*"] | ||
| } | ||
|
|
||
|
|
@@ -949,8 +952,8 @@ data "aws_iam_policy_document" "github_actions_assume_role" { | |
| dynamic "statement" { | ||
| for_each = var.environment == "dev" ? [1] : [] | ||
| content { | ||
| sid = "AllowDevSSORoleToAssumeIamBootstrap" | ||
| effect = "Allow" | ||
| sid = "AllowDevSSORoleToAssumeIamBootstrap" | ||
| effect = "Allow" | ||
| actions = ["sts:AssumeRole"] | ||
|
|
||
| principals { | ||
|
|
@@ -966,8 +969,8 @@ data "aws_iam_policy_document" "github_actions_assume_role" { | |
| # Assume role policy document for GitHub Actions | ||
| data "aws_iam_policy_document" "regression_repo_assume_role" { | ||
| statement { | ||
| sid = "OidcAssumeRoleWithWebIdentity" | ||
| effect = "Allow" | ||
| sid = "OidcAssumeRoleWithWebIdentity" | ||
| effect = "Allow" | ||
| actions = ["sts:AssumeRoleWithWebIdentity"] | ||
|
|
||
| principals { | ||
|
|
@@ -980,21 +983,16 @@ data "aws_iam_policy_document" "regression_repo_assume_role" { | |
| condition { | ||
| test = "StringLike" | ||
| variable = "token.actions.githubusercontent.com:sub" | ||
| values = ["repo:${var.github_org}/${var.regression_repo}:*"] | ||
| } | ||
|
|
||
| condition { | ||
| test = "StringLike" | ||
| variable = "token.actions.githubusercontent.com:job_workflow_ref" | ||
| values = [ | ||
| "${var.github_org}/${var.regression_repo}/.github/workflows/regression_tests.yml@*" | ||
| "repo:${var.github_org}/${var.regression_repo}:*", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to allow the role to be assumed by workflows in both the main repo (this one) and the regression test repo |
||
| "repo:${var.github_org}/${var.github_repo}:*", | ||
| ] | ||
| } | ||
|
|
||
| condition { | ||
| test = "StringEquals" | ||
| variable = "token.actions.githubusercontent.com:aud" | ||
| values = ["sts.amazonaws.com"] | ||
| values = ["sts.amazonaws.com"] | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,9 +246,9 @@ data "aws_iam_policy_document" "permissions_boundary" { | |
| } | ||
| # Environment-specific actions | ||
| dynamic "statement" { | ||
| for_each = var.environment == "preprod" ? [1] : [] | ||
| for_each = contains(["dev", "test", "preprod"], var.environment) ? [1] : [] | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need dynamoDB permissions for the regression test role to be within the permissions boundary for all pre-live environments |
||
| content { | ||
| sid = "AllowPreprodDynamoDBItemOps" | ||
| sid = "AllowDynamoDBItemOps" | ||
| effect = "Allow" | ||
| actions = [ | ||
| "dynamodb:GetItem", | ||
|
|
||
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.
Regression tests use BatchWrite to write test data