(aws-msk-alpha): Cannot provide my own encryption key for SASL Scram authentication

Open Beginner friendly
#22,617 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, kafka, typescript

Research direction

Start in packages/@aws-cdk/aws-msk/lib/cluster.ts and follow ClientAuthentication.sasl through the addUser entry point. Check how saslScramAuthenticationKey is initialized and confirm that a provided key is retained; done means addUser no longer reports that an authentication KMS key is missing when one was supplied.

Written by the indexing model from the issue text.

Description

@aws-cdk/aws-msk bug effort/small p2
Describe the bug

ClientAuthentication.sasl properties currently allow you to provide an encryption key for the user secret. However, the construct does not leverage that key.

Current code for authentication configuration:

  clientAuthentication: ClientAuthentication.sasl({
    scram: true,
    key: props.kmsEncryptionKeyForCredentialsSecret,
  })

Then, add user:
this.cluster.addUser(user)

Expected Behavior

It will use the encryption key I provide.

Current Behavior

It does not use the encryption key, nor creates new one.
It throws an error: Cannot create users if an authentication KMS key has not been created/provided.

Reproduction Steps

See above.

Possible Solution

Initialize this.saslScramAuthenticationKey with the provided key, if set.

https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-msk/lib/cluster.ts

Additional Information/Context

No response

CDK CLI Version

2.45

Framework Version

No response

Node.js Version

16.15.1

OS

MacOS

Language

Typescript

Language Version

No response

Other information

No response

Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
71

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-cdk

All issues in aws/aws-cdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.