feat: Remove AWS key and use ECR passwords for docker login [Ubuntu 24] - #171
Merged
Merged
Conversation
Signed-off-by: DhairyaMajmudar <dhairya.opensource@gmail.com>
sangamcse
requested review from
sangamcse and
ya-developer
and removed request for
sangamcse
August 28, 2026 10:29
sangamcse
requested changes
Aug 30, 2026
sangamcse
left a comment
Contributor
There was a problem hiding this comment.
@dhairya-hackerrank, can you check these comments? Rest looks good
dhairya-hackerrank
force-pushed
the
2404-ecr
branch
from
August 30, 2026 16:01
d3e8dee to
b64386f
Compare
Signed-off-by: dhairya-majmudar <dhairya.majmudar@hackerrank.com>
Signed-off-by: dhairya-majmudar <dhairya.majmudar@hackerrank.com>
sangamcse
approved these changes
Aug 31, 2026
Comment on lines
+271
to
+281
| while true; do | ||
| if token=$(cat "${BLACKBOX_ECR_TOKEN_DIR}/${name}" 2>/dev/null) && [ -n "$token" ]; then | ||
| printf "%s" "$token" | ||
| return 0 | ||
| fi | ||
|
|
||
| (( waited < wait_seconds )) || break | ||
|
|
||
| sleep "$interval_seconds" | ||
| waited=$(( waited + interval_seconds )) | ||
| done |
Contributor
There was a problem hiding this comment.
Retry is also not required after our internal service change. We can keep a PR ready, and once the internal service is released, we can check it in sanity. then remove it
Contributor
Author
There was a problem hiding this comment.
Thanks, done removed retry logic
Contributor
|
@ya-developer, we are changing the way we are currently using AWS secrets for Docker login. Instead of hardcoding the Secrets in this repo, we will be creating ECR passwords from our internal service and handing off the workspace. Blackbox will use those ECR passwords for Docker login from here. Can you please review this? |
Signed-off-by: dhairya-majmudar <dhairya.majmudar@hackerrank.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the embedded AWS access key/secret from Blackbox’s ECR login flow.
ECR passwords are now supplied by the host through a read-only token handoff directory, instead of being generated inside Blackbox with static AWS credentials.
Changes
BLACKBOX_ECR_TOKEN_DIR(default:/run/hackerrank/devops-ecr).private-password/public-passwordfiles;rootandBLACKBOX_USER_NAME.awscliprovisioning temporarily because AWS-related modules still rely on its LocalStack shim and placeholder environment setup; it is no longer used to obtain ECR credentials.Reviewer notes
The host must publish complete token files atomically in the configured directory. Blackbox reads the token before logging out any baked Docker credential, avoiding a misleading expired-token pull failure when the host handoff is missing.