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

add keystore reference back #2876

Merged
merged 2 commits into from
Apr 19, 2024
Merged

add keystore reference back #2876

merged 2 commits into from
Apr 19, 2024

Conversation

chengjie8
Copy link
Contributor

What was the problem?

The dev log reports a missing keystore file, which was due to a recent script in kafka docker entrypoint file responsible for generating the file being removed.

Associated tickets or Slack threads:

How does this fix it?1

This PR is to revert the code back and get dev back to a working state

How to test this PR

  • Step 1
  • Step 22

Footnotes

  1. Pull-Requests guidelines. If PR is significant, update Current Software State wiki page.

  2. To check if a PR will succeed in the SecRel workflow, test PRs in the SecRel pipeline.

@chengjie8 chengjie8 requested a review from a team as a code owner April 18, 2024 19:32
@chengjie8 chengjie8 requested review from nelsestu and Ponnia-M April 18, 2024 19:32
Copy link
Contributor

@Ponnia-M Ponnia-M left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Test Results

151 tests  ±0   151 ✅ ±0   46s ⏱️ -1s
 46 suites ±0     0 💤 ±0 
 46 files   ±0     0 ❌ ±0 

Results for commit 905a7b1. ± Comparison against base commit f434279.

Copy link
Contributor

JaCoCo Test Coverage

Overall Project 76.64%

There is no coverage information present for the Files changed

Copy link
Contributor

@nelsestu nelsestu left a comment

Choose a reason for hiding this comment

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

Great work Cheng! It looks like you were able to regenerate the keystore during container startup, which helps facilitate a more maintainable image going forward. Please see the one other comment/question i have added to the review. If there is something to be done about that, then great, but this enhancement is approved either way.

export KEYSTORE_FILE="$PWD/keystore.p12"
echo "$BIE_KAFKA_KEYSTORE_INBASE64" | base64 -d > "$KEYSTORE_FILE"
echo -e "\nVerifying keystore ($KEYSTORE_FILE) and its password..."
if ! keytool -list -v -keystore "$KEYSTORE_FILE" -storepass "$BIE_KAFKA_KEYSTORE_PASSWORD" | grep "Alias name:"; then
Copy link
Contributor

Choose a reason for hiding this comment

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

I recognize that this if statement on line 18 is trying to test whether the password successfully unlocks the keystore, and I am wondering if we are able to use the command's error code to check for the pass/fail state in favor of the "Alias name" text. If there is some reason that doesn't work in this case, it is fine the way it is, but I wanted to ask the question since it stood out as a potential improvement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The improvement could be to either implement RBAC changes to the mock Kafka cluster or find a way to ensure that the keystore attribute in the application.yaml file applies only to local and integration tests, without affecting other environments.

@chengjie8 chengjie8 merged commit b4deccc into develop Apr 19, 2024
1 check passed
@chengjie8 chengjie8 deleted the chengjie8/fix-kafka-issues branch April 19, 2024 03:39
Ponnia-M pushed a commit that referenced this pull request Jul 22, 2024
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