fix(security): drop credential key_id from AZ-IDN-006 debug logging (#178)#184
Merged
Conversation
app_id/key_id are Azure AD identifiers, not the secret value itself (Microsoft Graph never returns password credential secret text after creation) — but key_id isn't needed to diagnose a malformed endDateTime either way, so drop it from the log line rather than argue the classification. Fixes #178 (CodeQL: clear-text logging of sensitive information, both findings — same log statement).
TFT444
requested review from
SHAURYAKSHARMA24,
parthrohit22 and
ritiksah141
as code owners
July 13, 2026 12:23
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
TFT444
requested review from
Vishnu2707 and
m-khan-97
and removed request for
SHAURYAKSHARMA24 and
parthrohit22
July 13, 2026 12:25
m-khan-97
approved these changes
Jul 13, 2026
m-khan-97
left a comment
Collaborator
There was a problem hiding this comment.
Small, clean, well-verified fix. Confirmed the removed `key_id` was genuinely unnecessary for diagnosing a malformed `endDateTime` — it's still used correctly everywhere else in the file (resource_id, metadata), only pulled from this one debug log line. Like that the PR description doesn't argue the true/false-positive classification and just removes the unneeded field regardless — the right call either way. Test is solid too: it actually reverted the fix locally to confirm the new test fails against the old code before confirming it passes against the fix, which is exactly how you prove a regression test has teeth. Approving.
ritiksah141
approved these changes
Jul 13, 2026
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
Fixes #178 — the medium-priority CodeQL batch (2 findings, both the same log statement in
scanner/rules/az_idn_006.py).app_id/key_idare Azure AD identifiers — Microsoft Graph never returns the actual password-credential secret text after creation, so these are GUIDs referencing a credential, not the credential itself. This is very likely CodeQL's naming-heuristic flagging variables near a "credential"/credcontext rather than a genuine secret leak.Regardless of true/false-positive status,
key_idisn't needed to diagnose a malformedendDateTimevalue, so the fix removes it from the log line entirely rather than arguing the classification.key_iditself is untouched everywhere else in the file (it's still used correctly in the finding'sresource_idandmetadata).Test plan
test_idn_006_malformed_end_date_time_does_not_log_key_id, which feeds a malformedendDateTimeand asserts a sentinelkeyIdvalue never appears in the captured log outputruff check/ruff format --check— cleandev