Skip to content

feat: support AWS MSK IAM authentication (AWS_MSK_IAM SASL mechanism) - #345

Open
adiig7 wants to merge 2 commits into
redpanda-data:masterfrom
adiig7:feat/aws-msk-iam
Open

feat: support AWS MSK IAM authentication (AWS_MSK_IAM SASL mechanism)#345
adiig7 wants to merge 2 commits into
redpanda-data:masterfrom
adiig7:feat/aws-msk-iam

Conversation

@adiig7

@adiig7 adiig7 commented Jul 29, 2026

Copy link
Copy Markdown

What

Adds AWS_MSK_IAM as a supported SASL mechanism so KMinion can connect to IAM-auth-only Amazon MSK clusters.

  • Uses franz-go's built-in pkg/sasl/aws (ManagedStreamingIAM) — no new SASL implementation, just wiring it into the existing mechanism switch
  • Credentials resolve via the AWS SDK default credential chain (environment, shared config, EC2/ECS task role), so no static keys are required when running on AWS
  • Optional STS assume-role via roleArn / externalId / roleSessionName under kafka.sasl.aws
  • Docs: docs/reference-config.yaml and README mechanism list updated

Why

Amazon MSK clusters configured with IAM access control only accept the custom AWS_MSK_IAM SASL mechanism (port 9098). KMinion currently supports PLAIN/SCRAM/GSSAPI/OAUTHBEARER, so it cannot connect to such clusters at all — and IAM-only is a common posture since it needs no secret management on the Kafka side.

Relationship to #305

This supersedes #305 by @AdrienneCohea (credit to her for the original implementation — the wiring here follows the same approach). That PR's only review feedback from @sbocinec was to rename the config struct for consistency with the other SASL mechanism configs; this PR names it AWSConfig accordingly. Also avoids the franz-go version bump from #305 since current master (v1.20.6) already includes pkg/sasl/aws.

Testing

  • go build ./..., go vet ./..., go test ./... pass; gofmt clean on touched files
  • Config validation covers the new mechanism (AWS_MSK_IAM accepted, unknown mechanisms still rejected)
  • Will be running this against an IAM-only MSK cluster (ap-south-1) as part of our production monitoring rollout — happy to report back results or make changes

@adiig7
adiig7 force-pushed the feat/aws-msk-iam branch 2 times, most recently from 5d06985 to d1b0884 Compare July 29, 2026 12:36
Adds the AWS_MSK_IAM SASL mechanism using franz-go's built-in
pkg/sasl/aws implementation. Credentials are resolved through the AWS
SDK default credential chain (environment, shared config, EC2/ECS task
role), with optional STS assume-role (roleArn/externalId/
roleSessionName) and an optional region override for credential
resolution.

Supersedes redpanda-data#305, addressing the review feedback (struct renamed to
AWSConfig for consistency with the other SASL mechanism configs).
@adiig7
adiig7 force-pushed the feat/aws-msk-iam branch from d1b0884 to 340f40c Compare July 29, 2026 12:38
Avoids the newest transitive modules (service/signin, internal/v4a)
flagged by the Snyk license/security checks; matches the dependency
footprint of redpanda-data#305.
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