Skip to content

Conversation

@eddalmond1
Copy link
Collaborator

Description

Context

A few things are flagged up in both our and the pen test security reviews for the github actions role:

IAM customer managed policies should not allow decryption actions on all KMS keys
IAM customer managed policies that you create should not allow wildcard actions for services
IAM - Policies Allows “PassRole” Action For Any Resource

We can address these concerns by further tightening up the Github deployment role and permission boundary policies.

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.

effect = "Allow"

actions = [
"acm:*",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the permissions boundary used by assumed roles (e.g. lambda, cloudwatch --> kinesis etc.) so the permissions boundary itself needs to restrict to only those actions and resources we'd expect those roles to use.

sid = "RestrictRegion"
effect = "Allow"

actions = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the deployment role, so a wider range of services need to be accessed - we try here to restrict actions to only those deployments would need. As the permissions boundary doesn't actually grant permissions, we retain the * resource so that the role itself can set specific resource permissions.

# API Gateway domain and deployment
"apigateway:*",
# ACM for certs
"acm:DescribeCertificate",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

acm needs * level resource as it's an 'account level' thing.

Effect = "Allow",
Action = [
# IAM PassRole for specific service roles only
"iam:PassRole"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This specifically addresses the issue around passrole, limiting it to just the roles we want to deploy (and allow AWS services to assume)

{
Effect = "Allow",
Action = [
# Key management actions on account-specific keys only
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IAM customer managed policies should not allow decryption actions on all KMS keys

Restricting here to only those created in the account. Deployment role needs to be able to do this to access assets...

@eddalmond1 eddalmond1 merged commit e73905a into main Aug 15, 2025
22 checks passed
@eddalmond1 eddalmond1 deleted the feature/eja-eli-385-remove-wildcard-resource-and-passrole-permissions branch August 15, 2025 15:47
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