Uh oh!
There was an error while loading. Please reload this page.
[enhance](nereids) improve masking of user's password for ALTER USER and CREATE USER commands in audit logs - #62141
Conversation
Thearas
commented
Apr 6, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
iaorekhov-1980
commented
Apr 6, 2026
run feut |
9851a15 to
7ddf5e0Compareiaorekhov-1980
commented
Apr 7, 2026
run feut |
iaorekhov-1980
commented
Apr 7, 2026
run feut |
1 similar comment
iaorekhov-1980
commented
Apr 7, 2026
run feut |
hello-stephen
commented
Apr 7, 2026
FE UT Coverage ReportIncrement line coverage |
iaorekhov-1980
commented
Apr 7, 2026
run feut |
4 similar comments
iaorekhov-1980
commented
Apr 7, 2026
run feut |
iaorekhov-1980
commented
Apr 7, 2026
run feut |
iaorekhov-1980
commented
Apr 7, 2026
run feut |
iaorekhov-1980
commented
Apr 7, 2026
run feut |
53a743b to
be55c79Compareiaorekhov-1980
commented
Apr 8, 2026
run feut |
3 similar comments
iaorekhov-1980
commented
Apr 8, 2026
run feut |
iaorekhov-1980
commented
Apr 8, 2026
run feut |
iaorekhov-1980
commented
Apr 8, 2026
run feut |
iaorekhov-1980
commented
Apr 8, 2026
run buildall |
hello-stephen
commented
Apr 8, 2026
FE UT Coverage ReportIncrement line coverage |
iaorekhov-1980
commented
Apr 15, 2026
/review |
There was a problem hiding this comment.
LGTM overall. I did not find any blocking correctness issues in the changed Nereids audit encryption path.
Critical checkpoint conclusions:
- Goal and correctness: The PR goal is to mask passwords in audit output for
CREATE USERandALTER USER. The final code achieves that in the Nereids path by markingAlterUserCommandasNeedAuditEncryptionand masking the password token invisitGrantUserIdentify, which is the shared parser path used by bothCREATE USERandALTER USER. - Scope and minimality: The change is small and focused. The parser change only labels the existing password literal in
grantUserIdentify, the masking logic is centralized in one existing encryption visitor hook, and the command side change forALTER USERis minimal. - Concurrency: No new concurrency or locking behavior is introduced.
- Lifecycle and initialization: No special lifecycle or static initialization risks introduced.
- Configuration: No new config items added.
- Compatibility: No incompatible storage, protocol, or symbol changes. Grammar label changes are internal to the parser visitor and do not affect external compatibility.
- Parallel paths: I checked the shared
grantUserIdentifypath and the audit hook inAuditLogHelper; the implementation now covers both NereidsCREATE USERandALTER USERconsistently. - Conditional checks: The new null check on
ctx.pwdis straightforward and necessary becauseIDENTIFIED BY ...is optional in the grammar. - Test coverage: The PR adds focused unit coverage for both
CREATE USERandALTER USERmasking. I could not fully validate by runningEncryptSQLTestin this runner because FE Maven resolution failed on missingorg.apache.doris:fe-foundation:1.2-SNAPSHOT, so local execution here was blocked by environment dependency resolution rather than a code failure. - Observability: Existing audit logging path remains the same; no extra observability appears necessary for this change.
- Transaction and persistence: Not applicable.
- Data write and atomicity: Not applicable.
- FE and BE variable passing: Not applicable.
- Performance: The change reuses the existing audit encryption reparse path and adds no meaningful extra overhead beyond paths already using
NeedAuditEncryption. - Other issues: None identified in the reviewed scope.
Residual risk:
- The added tests cover the plain
IDENTIFIED BYform. The shared implementation should also mask theIDENTIFIED BY PASSWORDform, but that variant is not explicitly covered by this PR test coverage.
f2bbb44 to
cd0ceddCompareiaorekhov-1980
commented
Apr 15, 2026
run buildall |
1 similar comment
iaorekhov-1980
commented
Apr 15, 2026
run buildall |
hello-stephen
commented
Apr 15, 2026
FE Regression Coverage ReportIncrement line coverage |
iaorekhov-1980
commented
May 5, 2026
run feut |
morningman
commented
May 5, 2026
run buildall |
PR approved by at least one committer and no changes requested. |
Uh oh!
There was an error while loading. Please reload this page.
…and CREATE USER commands in audit logs (#62141) ### What problem does this PR solve? This PR adds masking for users passwords for **CREATE USER** and **ALTER USER** commands. The masked values will be stored in audit table and audit files instead of actual values. The same functionality already exists for **SET USER PASSWORD** and **SET LDAP_ADMIN_PASSWORD** commands, so we other commands related to passwords should be masked as well. **Could you please include this PR into 4.x branches, please!** Issue Number: close#62140
…and CREATE USER commands in audit logs (#62141) ### What problem does this PR solve? This PR adds masking for users passwords for **CREATE USER** and **ALTER USER** commands. The masked values will be stored in audit table and audit files instead of actual values. The same functionality already exists for **SET USER PASSWORD** and **SET LDAP_ADMIN_PASSWORD** commands, so we other commands related to passwords should be masked as well. **Could you please include this PR into 4.x branches, please!** Issue Number: close#62140
…and CREATE USER commands in audit logs (#62141) ### What problem does this PR solve? This PR adds masking for users passwords for **CREATE USER** and **ALTER USER** commands. The masked values will be stored in audit table and audit files instead of actual values. The same functionality already exists for **SET USER PASSWORD** and **SET LDAP_ADMIN_PASSWORD** commands, so we other commands related to passwords should be masked as well. **Could you please include this PR into 4.x branches, please!** Issue Number: close#62140
…and CREATE USER commands in audit logs (#62141) ### What problem does this PR solve? This PR adds masking for users passwords for **CREATE USER** and **ALTER USER** commands. The masked values will be stored in audit table and audit files instead of actual values. The same functionality already exists for **SET USER PASSWORD** and **SET LDAP_ADMIN_PASSWORD** commands, so we other commands related to passwords should be masked as well. **Could you please include this PR into 4.x branches, please!** Issue Number: close#62140
…and CREATE USER commands in audit logs (apache#62141) (manually picked from commit 8209b79)
…and CREATE USER commands in audit logs (apache#62141) (manually picked from commit 8209b79)
… framework (#63689) ### What problem does this PR solve? This PR adds masking for users passwords for **CREATE USER** and **ALTER USER** commands. The masked values will be stored in audit table and audit files instead of actual values. The same functionality already exists for **SET USER PASSWORD** and **SET LDAP_ADMIN_PASSWORD** commands, so we other commands related to passwords should be masked as well. #62141 can't be automatically merged into branch-4.1 as it depends on new test framework. so I've executed manual merge with previous test framework to keep compatibility **Could you please include this PR into 4.x branches, please!** Issue Number: close#62140 (cherry picked from commit 8209b79) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #62141, #63038 Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [X] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [X] Yes. - Does this need documentation? - [X] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
…and CREATE USER commands in audit logs (apache#62141) ### What problem does this PR solve? This PR adds masking for users passwords for **CREATE USER** and **ALTER USER** commands. The masked values will be stored in audit table and audit files instead of actual values. The same functionality already exists for **SET USER PASSWORD** and **SET LDAP_ADMIN_PASSWORD** commands, so we other commands related to passwords should be masked as well. **Could you please include this PR into 4.x branches, please!** Issue Number: closeapache#62140
What problem does this PR solve?
This PR adds masking for users passwords for CREATE USER and ALTER USER commands.
The masked values will be stored in audit table and audit files instead of actual values.
The same functionality already exists for SET USER PASSWORD and SET LDAP_ADMIN_PASSWORD commands, so we other commands related to passwords should be masked as well.
Could you please include this PR into 4.x branches, please!
Issue Number: close#62140
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Check List (For Reviewer who merge this PR)