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

feat: s2s auth iam engine #237

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

feat: s2s auth iam engine #237

wants to merge 10 commits into from

Conversation

alex-reiff
Copy link
Contributor

@alex-reiff alex-reiff commented Nov 25, 2024

Description

Adding IAM engine to the main module. It is also the new default behavior. Not sure if this should qualify for a major release.

Issue: terraform-ibm-modules/terraform-ibm-secrets-manager-iam-engine#139

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@alex-reiff alex-reiff requested a review from shemau as a code owner November 25, 2024 19:36
@alex-reiff
Copy link
Contributor Author

/run pipeline

@alex-reiff
Copy link
Contributor Author

/run pipeline

1 similar comment
@alex-reiff
Copy link
Contributor Author

/run pipeline

@alex-reiff
Copy link
Contributor Author

/run pipeline

@alex-reiff
Copy link
Contributor Author

/run pipeline

@alex-reiff
Copy link
Contributor Author

/run pipeline

Copy link
Member

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

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

see comments

variables.tf Outdated
@@ -27,6 +27,12 @@ variable "sm_service_plan" {
}
}

variable "create_iam_engine" {
Copy link
Member

Choose a reason for hiding this comment

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

The only thing getting "created" here is s2s auth policies between SM and IAM. So maybe we need to rename this to skip_iam_authorization_policy ?

The variable description needs to be more specific as to what exact type of auth policies are created (as its possible a consumer may already have them set in their account)

main.tf Outdated
target_service_name = "iam-identity"
roles = ["Operator"]
description = "Authorization Policy"
transaction_id = "terraformAuthorizationPolicy"
Copy link
Member

Choose a reason for hiding this comment

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

what is transaction_id ?

main.tf Outdated
source_resource_instance_id = local.secrets_manager_guid
target_service_name = "iam-identity"
roles = ["Operator"]
description = "Authorization Policy"
Copy link
Member

Choose a reason for hiding this comment

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

The description needs more info as to the type of auth policy here. Check out other auth policy descrptions we have used in other modules for an idea

main.tf Outdated
source_resource_instance_id = local.secrets_manager_guid
target_service_name = "iam-groups"
roles = ["Groups Service Member Manage"]
description = "Authorization Policy"
Copy link
Member

Choose a reason for hiding this comment

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

same as above, description needs to be updated

@alex-reiff
Copy link
Contributor Author

/run pipeline

@alex-reiff
Copy link
Contributor Author

/run pipeline

@alex-reiff alex-reiff requested a review from ocofaigh December 16, 2024 16:17
Copy link
Member

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

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

see comments

secrets_manager_name = "${var.prefix}-secrets-manager" #tfsec:ignore:general-secrets-no-plaintext-exposure
sm_service_plan = "trial"
sm_tags = var.resource_tags
skip_iam_authorization_policy = true
Copy link
Member

Choose a reason for hiding this comment

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

why are you skipping?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have this auth policy in the account, so it fails because it can't make a duplicate.

variables.tf Outdated
@@ -27,6 +27,12 @@ variable "sm_service_plan" {
}
}

variable "skip_iam_authorization_policy" {
type = bool
description = "Skip creating 2 auth policies, one between this Secrets Manager instance and the IAM Identity service and the other between this Secrets Manager instance and the IAM Groups service to enable creation of IAM credentials."
Copy link
Member

Choose a reason for hiding this comment

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

Whether to skip the creation of the IAM authorization policies required to enable the IAM credentials engine. If set to false, a policies will be created that grants the Secrets Manager instance Operator access to the IAM identity service, and Groups Service Member Manage access to the IAM groups service.

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