-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Create Docker registry auth detector #2677
Open
rgmz
wants to merge
1
commit into
trufflesecurity:main
Choose a base branch
from
rgmz:feat/docker-detector
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
2d4d336
to
3d0aa96
Compare
3d0aa96
to
37e6685
Compare
2 tasks
2cb905e
to
87c6a62
Compare
1633ac6
to
a8c6c9f
Compare
de80769
to
4fef2e4
Compare
4fef2e4
to
2e8f9e9
Compare
c107eef
to
16d0e35
Compare
16d0e35
to
eb03c7f
Compare
eb03c7f
to
75e0ee4
Compare
e9ee964
to
a79828f
Compare
a79828f
to
d7abdd8
Compare
17b9929
to
2a2570a
Compare
befdef0
to
5e3c671
Compare
91ad2d8
to
874f306
Compare
874f306
to
6026c51
Compare
6026c51
to
59cae37
Compare
5820a07
to
f73dc67
Compare
c131fd1
to
1ded170
Compare
1ded170
to
eb44ba7
Compare
eb44ba7
to
48b2759
Compare
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.
Description:
This implements a detector to find Docker registry credentials, inspired by this suggestion from @bgoareguer.
The current code works, but is a bit messy and requires more feedback + testing.
Questions/TODO
Should this also match and decode Kubernetes.dockerconfigjson
results, or rely on the base64 decoder?json.Unmarshal
) that are worth noting, as it could be indicative of a bug.gcr.io
credential, as that registry uses base64-encoded GCP service principals as the password. It's possible that this doesn't work with the current logic (e.g., encoded newlines.)Handle username for GCR credentials? (It's a static_json_key
, the real username is in the auth)Are there any other potential formats this data gets stored in? (e.g., YAML)\n
as well as literal?docker.io
which is a special case (https://stackoverflow.com/a/68654659)Future work?
json.NewDecoder
instead ofjson.Unmarshal
(https://github.com/Azure/ARO-RP/blob/25b8569698b61abd7af6cdefe680fdc1306b001f/pkg/operator/admission/validation/pullsecret/request.json#L1)base64-encoded auth does not match source
is a legitimate issue (probably not, seems to be caused by base64 decoder)Checklist:
make test-community
)?make lint
this requires golangci-lint)?