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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

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. Establish a packer-iam.tf within mgmt for packer-specific IAM resource consolidation
  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, i.e. execution of terraform import aws_iam_role.packer bfd-packer and terraform import aws_iam_instance_profile.packer bfd-packer
  3. Establish the bfd-mgmt-ec2-instances-tags-ro policy to globally allow ec2:DescribeInstances and ec2:DescribeTags
  4. attach and/or embed the instances-tags-ro policy to packer, migrator, pipeline, and server instance profile role definitions

What Should Reviewers Watch For?

TODO

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.

TODO

Comment on lines +1 to +2
resource "aws_iam_policy" "packer_s3" {
#FIXME: This policy should be reconsidered before acceptance of BFD-3698. Suggest removal.
Copy link
Member Author

Choose a reason for hiding this comment

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

bfd-mgmt-packer-s3 was moved here as part of the consolidation effort, however, it probably shouldn't exist...

aws_iam_policy.packer_ssm.arn,
aws_iam_policy.packer_s3.arn,
aws_iam_policy.packer_kms.arn,
"arn:aws:iam::aws:policy/AmazonElasticFileSystemFullAccess", #FIXME: This should be reconsidered before acceptance of BFD-3698. Suggest removal.
Copy link
Member Author

Choose a reason for hiding this comment

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

This AWS Managed policy is probably a hold-over from either earlier EFT efforts and/or self-hosted Jenkins systems that relied on EFS for multi-mount capabilities between Jenkins systems and ephemeral, Packer-managed EC2 instances. This should probably be removed.

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.

1 participant