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

BFD-3698: Address missing global EC2 permissions #2493

Merged
merged 6 commits into from
Nov 26, 2024
Merged

BFD-3698: Address missing global EC2 permissions #2493

merged 6 commits into from
Nov 26, 2024

Conversation

mjburling
Copy link
Member

@mjburling mjburling commented Nov 15, 2024

JIRA Ticket:
BFD-3698

What Does This PR Do?

Historically, we've just ignored AMI provisioning errors and EC2 instance initialization errors. This seeks to address the consistent errors that result from insufficient IAM privileges within the primary instance profiles through the following:

  1. Consolidate packer-specific IAM resources in mgmt under newly introduced packer-iam.tf
  2. Define and import previously non-terraform managed packer resources into the mgmt state through this packer-iam.tf file
    NOTE: These have since been removed from the state and must be re-imported, These have been imported into the mgmt state, i.e. terraform import aws_iam_role.packer bfd-packer and terraform import aws_iam_instance_profile.packer bfd-packer
  3. Remove outdated, irrelevant policies from the packer role
  4. Establish the bfd-mgmt-ec2-instance-tags-ro policy to globally allow ec2:DescribeInstances and ec2:DescribeTags
  5. Attach and/or embed the instance-tags-ro policy to the relevant packer, migrator, pipeline, and server instance profile role definitions
  6. Add an instruction to reconfigure Grub in the platinum definition. This is out-of-scope of BFD-3689, however, the validation couldn't proceed without it. Yielding to the reviewers to determine if this shouldn't belong elsewhere.

What Should Reviewers Watch For?

  • Do these changes seem reasonable?
  • Do they make sense?
  • Do any FIXME comments still exist within the change set?

What Security Implications Does This PR Have?

Please indicate if this PR does any of the following:

  • Adds any new software dependencies

  • Modifies any security controls

  • Adds new transmission or storage of data

  • Any other changes that could possibly affect security?

  • I have considered the above security implications as it relates to this PR. (If one or more of the above apply, it cannot be merged without the ISSO or team security engineer's (@sb-benohe) approval.)

Validation

Have you fully verified and tested these changes? Is the acceptance criteria met? Please provide reproducible testing instructions, code snippets, or screenshots as applicable.

  • I successfully provisioned platinum and application images with these changes using Jenkins.
  • Out-of-band, I applied those images to the test environment.
  • I witnessed the expected drop in what have become expected failures during AMI provisioning and EC2 initialization:
    • The recent v2.166.0 release yielded 32 distinct, assumed roles by ec2 instances with one or more failures
    • Provisioning and initialization with this branch into the test environment yielded zero.

@mjburling mjburling marked this pull request as ready for review November 25, 2024 23:28
Copy link
Contributor

@timothy-ellis-ky timothy-ellis-ky left a comment

Choose a reason for hiding this comment

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

see comment for env/mgmt/packer-iam.tf

@mjburling mjburling merged commit 2ddc3b3 into master Nov 26, 2024
6 checks passed
@mjburling mjburling deleted the bfd-3698 branch November 26, 2024 19:54
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.

3 participants