Skip to content

Feature/eli 731 add regression role to tf#642

Open
TOEL2 wants to merge 9 commits intomainfrom
feature/ELI-731-add-regression-role-to-tf
Open

Feature/eli 731 add regression role to tf#642
TOEL2 wants to merge 9 commits intomainfrom
feature/ELI-731-add-regression-role-to-tf

Conversation

@TOEL2
Copy link
Copy Markdown
Contributor

@TOEL2 TOEL2 commented Apr 15, 2026

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

policy_arn = aws_iam_policy.regression_test_permissions.arn
}

resource "aws_iam_role_policy_attachment" "security_management" {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we already have a policy attachment called security_management on line 1006? Should this be regression_security_management ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree

"secretsmanager:DescribeSecret",
"secretsmanager:UpdateSecretVersionStage"
]
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need to add a resource here for the specific secrets

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the reason I haven't is because we only have 1 and also because secrets that we add later will likely need to be tested by regression anyway so its just gunna end up listing all the secrets here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

happy to be convinced otherwise though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

just realised i'm missing the resource tab entirely! will add a *

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could probably still specify a wildcarded path based on the 'path' of the secrets we save.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"arn:aws:secretsmanager:${var.default_aws_region}:${data.aws_caller_identity.current.account_id}:secret:eligibility-signposting-api-*"

data "aws_iam_policy_document" "regression_test_permissions" {
statement {
sid = "S3Access"
Effect = "Allow",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

for data sources, I think Terraform uses lower case effect, actions, resources (for this and below)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how annoyingly inconsistent, but true, will amend

Comment thread infrastructure/stacks/iams-developer-roles/github_actions_policies.tf Outdated
Comment thread infrastructure/stacks/iams-developer-roles/github_actions_policies.tf Outdated
@TOEL2 TOEL2 marked this pull request as ready for review April 16, 2026 13:02
@TOEL2 TOEL2 requested a review from a team as a code owner April 16, 2026 13:02
@TOEL2 TOEL2 closed this Apr 16, 2026
@TOEL2 TOEL2 reopened this Apr 16, 2026
]
resources = [
"arn:aws:ssm:${var.default_aws_region}:${data.aws_caller_identity.current.account_id}:parameter/${var.environment}/*",
"arn:aws:ssm:${var.default_aws_region}:${data.aws_caller_identity.current.account_id}:parameter/splunk/*",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can't think why regression tests would need either our splunk or proxygen tokens (the ones below).

Presumably needs mtls to send requests to our api, so the first resource is probably ok

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah this is another case of just trying to give what they had, but agree its not needed i will remove

effect = "Allow"
action = [
"secretsmanager:GetSecretValue",
"secretsmanager:PutSecretValue",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do the tests change the secret values or versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought they might do or may do in future, i will discuss with adam as i'd rather they didnt

"dynamodb:ListTagsOfResource"
]
resources = [
"arn:aws:dynamodb:*:${data.aws_caller_identity.current.account_id}:table/*eligibility-signposting-api-${var.environment}-eligibility_datastore"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

think this needs the region var

"arn:aws:dynamodb:${var.default_aws_region}:${data.aws_caller_identity.current.account_id}:table/*eligibility-signposting-api-${var.environment}-eligibility_datastore"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i did think that but no where else in this file is that given? so i just went with the convention, happy to change though

statement {
sid = "SecretsManagerAccess"
effect = "Allow"
action = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

actions

data "aws_iam_policy_document" "regression_test_permissions" {
statement {
sid = "S3Access"
effect = "Allow",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bin the comma

"s3:PutObjectTagging",
"s3:GetObjectVersion",
],
resource = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

resources

"s3:GetObjectTagging",
"s3:PutObjectTagging",
"s3:GetObjectVersion",
],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bin comma

statement {
sid = "DynamoAccess"
effect = "Allow"
action = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

actions

statement {
sid = "CloudWatchLogsRead"
effect = "Allow"
action = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

actions

statement {
sid = "XRayRead"
effect = "Allow"
action = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

actions

statement {
sid = "SSMRead"
effect = "Allow"
action = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants