feat: add missing sensitive fields to redactSensitiveData #24121
+53
−1
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.
What does this PR do?
This PR addresses a security issue where sensitive delegation credential fields were not being redacted from logs, potentially exposing private keys and other sensitive authentication data.
Changes:
SENSITIVE_FIELDS
array inredactSensitiveData.ts
:private_key
- RSA/EC private keys from service account credentialsencrypted_credentials
- Encrypted credential datatenant_id
- Tenant identifiers that could be sensitiveclient_email
- Service account email addressesserviceAccountKey
- The entire service account key objectany
withRecord<string, unknown>
)Security Impact: Prevents logging of sensitive delegation credential data including private keys that could be used to impersonate service accounts.
Requested by: morgan@cal.com
Link to Devin run: https://app.devin.ai/sessions/384cd29a3e054233b6904c47b56251df
How should this be tested?
The changes include comprehensive unit tests that verify:
[REDACTED]
Additional testing recommendations:
Mandatory Tasks (DO NOT REMOVE)
Key Review Points
Checklist
TZ=UTC yarn test packages/lib/redactSensitiveData.test.ts
yarn type-check:ci --force