-
Notifications
You must be signed in to change notification settings - Fork 135
tests: Added test to fix masking for pem and jwk keys. #2139
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
12cb417
tests: Added test to fix masking for pem and jwk keys.
shivaygupta-dotcom dfc63a7
lint: Added nolint for certs and keys to prevent from lint errors
shivaygupta-dotcom 918e2c3
chore: Upgraded gdr version with latest commit hash
shivaygupta-dotcom 00a1d45
Merge branch 'main' into fix/env-var-masking-pem-jwk-keys
shivaygupta-dotcom d1245d2
Merge branch 'main' into fix/env-var-masking-pem-jwk-keys
shivaygupta-dotcom 7170ce7
fix: some test refactoring.
shivaygupta-dotcom cc0dcf7
Merge remote-tracking branch 'origin/fix/env-var-masking-pem-jwk-keys…
shivaygupta-dotcom 1b5d19d
chore: updated gdr to handle string encoded parsing for JWK
shivaygupta-dotcom 4868a1e
test: Added test with mixed type of secrets.
shivaygupta-dotcom 62ce618
chore: updated GDR with latest version.
shivaygupta-dotcom c9bfa62
Merge branch 'main' into fix/env-var-masking-pem-jwk-keys
shivaygupta-dotcom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
47 changes: 47 additions & 0 deletions
47
tests/integration/testdata/sync/057-env-var-masking-tests/comprehensive.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| _format_version: "3.0" | ||
|
|
||
| # This file tests comprehensive masking with PEM certificates, JWK keys, and normal secrets | ||
| certificates: | ||
| - id: 7fca84d6-7d37-4a74-a7b0-93e576089a41 | ||
| cert: ${{ env "DECK_CLIENT_CERT" }} | ||
| key: ${{ env "DECK_CLIENT_KEY" }} | ||
| tags: | ||
| - test-cert | ||
|
|
||
| # Key set for JWK keys | ||
| key_sets: | ||
| - id: d46b0e15-ffbc-4b15-ad92-09ef67935453 | ||
| name: comprehensive-keyset | ||
|
|
||
| # Key with JWK | ||
| keys: | ||
| - id: f21a7073-1183-4b1c-bd87-4d5b8b18eeb4 | ||
| name: comprehensive-jwk-test | ||
| kid: vsR8NCNV_1_LB06LqudGa2r-T0y4Z6VQVYue9IQz6A4 | ||
| jwk: ${{ env "DECK_JWK_KEY" }} | ||
| set: | ||
| id: d46b0e15-ffbc-4b15-ad92-09ef67935453 | ||
| tags: | ||
| - test-jwk | ||
|
|
||
| # Service with normal secrets in configuration | ||
| services: | ||
| - id: b35b3ec2-fa1c-4f6c-825e-c38141562c76 | ||
| name: comprehensive-test-service | ||
| host: example.com | ||
| port: 443 | ||
| protocol: https | ||
| tags: | ||
| - test-service | ||
| plugins: | ||
| - name: request-transformer | ||
| config: | ||
| add: | ||
| headers: | ||
| - "X-API-Key:${{ env "DECK_API_KEY" }}" | ||
| - "X-DB-Pass:${{ env "DECK_DATABASE_PASSWORD" }}" | ||
| - "Authorization:Bearer ${{ env "DECK_BEARER_TOKEN" }}" | ||
| - "X-Webhook-Secret:${{ env "DECK_WEBHOOK_SECRET" }}" | ||
| tags: | ||
| - test-plugin | ||
|
|
11 changes: 11 additions & 0 deletions
11
tests/integration/testdata/sync/057-env-var-masking-tests/jwk-key.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| _format_version: "3.0" | ||
| key_sets: | ||
| - id: d46b0e15-ffbc-4b15-ad92-09ef67935453 | ||
| name: test-keyset | ||
| keys: | ||
| - id: f21a7073-1183-4b1c-bd87-4d5b8b18eeb4 | ||
| jwk: ${{ env "DECK_JWK_KEY" }} | ||
| kid: vsR8NCNV_1_LB06LqudGa2r-T0y4Z6VQVYue9IQz6A4 | ||
| set: | ||
| id: d46b0e15-ffbc-4b15-ad92-09ef67935453 | ||
| name: test-jwk-key |
6 changes: 6 additions & 0 deletions
6
tests/integration/testdata/sync/057-env-var-masking-tests/pem-key.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| _format_version: "3.0" | ||
| certificates: | ||
| - id: 4803cc0f-4155-4802-9b55-ad988c7b0db7 | ||
| cert: ${{ env "DECK_CLIENT_CERT" }} | ||
| key: ${{ env "DECK_CLIENT_KEY" }} | ||
|
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the older secrets, like
apiKeySecret? Can we check for absence of those too below? Those shouldn't leak either.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand your comment correctly, you’re referring to verifying the secret that was set during the first sync, for example:
t.Setenv("DECK_API_KEY", "apiKeySecret")This is actually a known issue. When we run sync again after changing the environment variable value, the previous secret can be exposed in the output. We’re already addressing this as part of a separate issue. #2140
Please let me know if I misunderstood your comment or if you were referring to something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Everything else looks fine to me. Will approve once the CI is green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. you can approve now.