Skip to content

[fix](config) fix admin set all frontends config - #55016

Merged
morrySnow merged 3 commits into
apache:masterfrom
cambyzju:fix-master-250819
Aug 20, 2025
Merged

morrySnow merged 3 commits into
apache:masterfrom
cambyzju:fix-master-250819

Conversation

@cambyzju

@cambyzju cambyzju commented Aug 19, 2025 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

related pr: #54409

What's the problem:

  1. ADMIN SET ALL FRONTENDS CONFIG command will forward to other FEs use new commnad ADMIN SET FRONTEND CONFIG
  2. Then other FE if found MasterOnly config, will forward to this request to MASTER again

How to fix:

  1. SET ALL FRONTENDS forward to other FEs, still use the same command: SET ALL FRONTENDS;
  2. while Env.setConfig for SET ALL FRONTENDS , do not forward again while is proxy;

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas

Thearas commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@cambyzju

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 33756 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit b5e4f8fa8e09b4d5441d37dcbc2aafc43cfdc716, data reload: false

------ Round 1 ----------------------------------
q1	17602	5316	5061	5061
q2	1921	285	175	175
q3	10323	1300	739	739
q4	10229	1010	526	526
q5	7528	2451	2306	2306
q6	180	159	130	130
q7	925	757	613	613
q8	9306	1284	1079	1079
q9	6946	5161	5093	5093
q10	6887	2412	1984	1984
q11	471	285	264	264
q12	342	350	219	219
q13	17782	3645	3017	3017
q14	226	240	215	215
q15	558	504	485	485
q16	420	426	363	363
q17	589	907	353	353
q18	7317	7280	6991	6991
q19	978	941	560	560
q20	343	335	224	224
q21	3883	3228	2376	2376
q22	1056	1039	983	983
Total cold run time: 105812 ms
Total hot run time: 33756 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5098	5131	5128	5128
q2	253	323	223	223
q3	2193	2665	2270	2270
q4	1413	1788	1346	1346
q5	4234	4549	4606	4549
q6	223	166	129	129
q7	2093	1991	1828	1828
q8	2645	2773	2645	2645
q9	7337	7316	7321	7316
q10	3101	3332	2956	2956
q11	589	518	517	517
q12	697	788	652	652
q13	3547	3939	3333	3333
q14	317	289	284	284
q15	527	492	476	476
q16	458	494	441	441
q17	1183	1576	1395	1395
q18	8013	7845	7486	7486
q19	828	855	852	852
q20	2115	2070	1952	1952
q21	4813	4440	4336	4336
q22	1053	1042	1020	1020
Total cold run time: 52730 ms
Total hot run time: 51134 ms

@cambyzju

Copy link
Copy Markdown
Contributor Author

run buildall

zclllyybb
zclllyybb previously approved these changes Aug 19, 2025
@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Aug 19, 2025
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 33921 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 437c07300ef3c9d185a9be13b7295cde5fc7a823, data reload: false

------ Round 1 ----------------------------------
q1	17574	5222	5034	5034
q2	1920	293	183	183
q3	10303	1310	732	732
q4	10222	1009	519	519
q5	7698	2449	2289	2289
q6	222	162	130	130
q7	898	760	615	615
q8	9342	1300	1030	1030
q9	7147	5154	5125	5125
q10	6963	2386	2028	2028
q11	484	275	262	262
q12	360	335	215	215
q13	17789	3603	2996	2996
q14	224	241	212	212
q15	567	480	485	480
q16	425	420	363	363
q17	601	847	370	370
q18	7602	7210	7259	7210
q19	1089	961	563	563
q20	349	333	219	219
q21	3898	3261	2358	2358
q22	1107	1026	988	988
Total cold run time: 106784 ms
Total hot run time: 33921 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5229	5154	5121	5121
q2	249	326	220	220
q3	2213	2686	2292	2292
q4	1402	1791	1352	1352
q5	4221	4155	4138	4138
q6	210	162	124	124
q7	1890	1855	1665	1665
q8	2501	2472	2484	2472
q9	6844	6830	6823	6823
q10	2957	3148	2681	2681
q11	568	520	496	496
q12	652	735	598	598
q13	3286	3665	3012	3012
q14	277	286	257	257
q15	508	461	462	461
q16	423	478	420	420
q17	1132	1477	1345	1345
q18	7346	7140	7124	7124
q19	797	785	812	785
q20	1909	1959	1793	1793
q21	4778	4353	4259	4259
q22	1079	1063	1023	1023
Total cold run time: 50471 ms
Total hot run time: 48461 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 185833 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 437c07300ef3c9d185a9be13b7295cde5fc7a823, data reload: false

query1	834	401	410	401
query2	5172	1741	1727	1727
query3	3737	217	215	215
query4	25488	23313	23372	23313
query5	4691	624	470	470
query6	301	220	209	209
query7	3930	512	299	299
query8	270	248	231	231
query9	7148	2910	2878	2878
query10	484	348	291	291
query11	15041	14925	14678	14678
query12	158	116	109	109
query13	533	557	431	431
query14	6350	5844	5761	5761
query15	189	192	165	165
query16	639	665	542	542
query17	664	721	597	597
query18	397	440	305	305
query19	182	182	153	153
query20	137	127	117	117
query21	213	120	107	107
query22	4388	4332	4227	4227
query23	34069	33319	33359	33319
query24	3173	2377	2376	2376
query25	621	477	412	412
query26	617	272	164	164
query27	1675	502	344	344
query28	4847	2251	2224	2224
query29	1291	567	450	450
query30	294	223	189	189
query31	909	798	740	740
query32	88	73	78	73
query33	524	364	369	364
query34	843	844	514	514
query35	788	835	741	741
query36	956	1028	911	911
query37	184	103	86	86
query38	4056	4012	3962	3962
query39	1440	1416	1439	1416
query40	220	128	115	115
query41	61	59	54	54
query42	129	108	112	108
query43	506	492	472	472
query44	1334	853	850	850
query45	182	168	168	168
query46	867	1008	653	653
query47	1791	1820	1731	1731
query48	395	438	313	313
query49	740	499	389	389
query50	660	666	411	411
query51	4124	4094	4071	4071
query52	114	114	104	104
query53	227	276	197	197
query54	621	610	528	528
query55	86	88	85	85
query56	316	310	298	298
query57	1200	1191	1166	1166
query58	282	268	267	267
query59	2635	2832	2643	2643
query60	335	326	315	315
query61	123	120	124	120
query62	810	734	680	680
query63	225	186	191	186
query64	4649	1024	730	730
query65	4300	4172	4231	4172
query66	1420	417	326	326
query67	15436	15484	15234	15234
query68	5598	926	579	579
query69	514	314	292	292
query70	1150	1112	1081	1081
query71	440	322	300	300
query72	6283	4758	4807	4758
query73	656	635	350	350
query74	9243	8983	8996	8983
query75	3164	3074	2627	2627
query76	3869	1150	731	731
query77	503	393	321	321
query78	9591	9769	8910	8910
query79	2103	838	577	577
query80	833	532	459	459
query81	528	255	226	226
query82	193	142	104	104
query83	251	245	242	242
query84	263	110	78	78
query85	764	428	326	326
query86	350	315	310	310
query87	4188	4230	4212	4212
query88	2796	2219	2201	2201
query89	392	313	289	289
query90	1992	221	210	210
query91	136	152	113	113
query92	85	67	71	67
query93	1784	984	645	645
query94	664	394	316	316
query95	393	317	312	312
query96	480	594	279	279
query97	2571	2667	2572	2572
query98	230	218	207	207
query99	1372	1422	1259	1259
Total cold run time: 244488 ms
Total hot run time: 185833 ms

@doris-robot

Copy link
Copy Markdown
ClickBench: Total hot run time: 32.63 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 437c07300ef3c9d185a9be13b7295cde5fc7a823, data reload: false

query1	0.05	0.04	0.04
query2	0.08	0.04	0.04
query3	0.24	0.07	0.08
query4	1.62	0.11	0.10
query5	0.43	0.41	0.41
query6	1.18	0.64	0.67
query7	0.02	0.02	0.01
query8	0.06	0.03	0.03
query9	0.58	0.52	0.52
query10	0.58	0.56	0.58
query11	0.16	0.12	0.11
query12	0.14	0.11	0.12
query13	0.63	0.60	0.61
query14	0.80	0.83	0.83
query15	0.88	0.83	0.86
query16	0.39	0.40	0.37
query17	1.08	1.03	1.05
query18	0.21	0.20	0.20
query19	1.89	1.84	1.84
query20	0.01	0.00	0.01
query21	15.41	0.90	0.58
query22	0.77	1.24	0.83
query23	14.77	1.37	0.63
query24	6.59	0.75	1.31
query25	0.49	0.22	0.16
query26	0.56	0.16	0.14
query27	0.06	0.06	0.05
query28	9.81	0.93	0.43
query29	12.58	3.92	3.26
query30	3.10	2.97	2.90
query31	2.82	0.57	0.38
query32	3.26	0.55	0.47
query33	3.08	3.12	3.10
query34	16.08	5.43	4.88
query35	4.90	4.96	4.89
query36	0.67	0.52	0.49
query37	0.09	0.06	0.06
query38	0.06	0.04	0.04
query39	0.03	0.02	0.02
query40	0.17	0.15	0.16
query41	0.08	0.03	0.03
query42	0.04	0.02	0.03
query43	0.04	0.04	0.03
Total cold run time: 106.49 s
Total hot run time: 32.63 s

@cambyzju

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label Aug 19, 2025
@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 33997 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit d91aea1d4b198c460a70922cc8e4dffbd9bc1998, data reload: false

------ Round 1 ----------------------------------
q1	17559	5242	5087	5087
q2	1922	287	180	180
q3	10311	1320	733	733
q4	10217	1021	519	519
q5	7537	2428	2362	2362
q6	192	161	126	126
q7	904	754	604	604
q8	9302	1347	1154	1154
q9	7038	5147	5095	5095
q10	6890	2383	1977	1977
q11	481	294	278	278
q12	342	362	215	215
q13	17762	3633	3074	3074
q14	232	251	218	218
q15	536	474	481	474
q16	446	410	365	365
q17	590	868	361	361
q18	7454	7083	7160	7083
q19	1218	958	554	554
q20	361	337	223	223
q21	4021	3149	2331	2331
q22	1088	1037	984	984
Total cold run time: 106403 ms
Total hot run time: 33997 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5160	5151	5096	5096
q2	246	330	221	221
q3	2195	2698	2314	2314
q4	1352	1785	1299	1299
q5	4253	4592	4592	4592
q6	222	171	131	131
q7	2085	1981	1830	1830
q8	2647	2580	2619	2580
q9	7317	7206	7474	7206
q10	3089	3236	2864	2864
q11	580	560	503	503
q12	720	782	652	652
q13	3561	3915	3293	3293
q14	316	326	301	301
q15	562	468	491	468
q16	458	513	466	466
q17	1213	1573	1432	1432
q18	7937	7736	7583	7583
q19	879	861	897	861
q20	2039	2050	1933	1933
q21	5018	4351	4289	4289
q22	1074	1045	1000	1000
Total cold run time: 52923 ms
Total hot run time: 50914 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 185176 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit d91aea1d4b198c460a70922cc8e4dffbd9bc1998, data reload: false

query1	996	393	411	393
query2	6509	1778	1756	1756
query3	6749	220	219	219
query4	26568	23857	23301	23301
query5	4352	610	499	499
query6	318	223	208	208
query7	4625	495	287	287
query8	279	255	241	241
query9	8600	2867	2859	2859
query10	493	323	279	279
query11	16005	15145	14903	14903
query12	163	114	115	114
query13	1655	536	429	429
query14	9285	5835	5757	5757
query15	212	178	171	171
query16	7701	646	497	497
query17	1205	718	602	602
query18	2040	424	327	327
query19	199	185	174	174
query20	129	123	114	114
query21	218	123	113	113
query22	4199	4188	4134	4134
query23	34297	33200	33308	33200
query24	8131	2336	2348	2336
query25	530	468	414	414
query26	1237	276	161	161
query27	2714	502	354	354
query28	4350	2222	2198	2198
query29	727	546	456	456
query30	281	221	185	185
query31	901	813	720	720
query32	84	95	73	73
query33	543	364	340	340
query34	791	830	487	487
query35	794	818	766	766
query36	981	1026	900	900
query37	121	108	87	87
query38	4121	4033	4020	4020
query39	1474	1426	1454	1426
query40	214	124	116	116
query41	61	55	53	53
query42	122	109	111	109
query43	526	513	476	476
query44	1319	842	841	841
query45	173	166	162	162
query46	859	1005	632	632
query47	1760	1802	1714	1714
query48	379	421	314	314
query49	731	481	391	391
query50	669	682	398	398
query51	4188	4119	4141	4119
query52	115	111	104	104
query53	242	258	191	191
query54	593	573	518	518
query55	88	91	86	86
query56	317	310	294	294
query57	1209	1201	1119	1119
query58	283	270	272	270
query59	2654	2834	2705	2705
query60	340	338	316	316
query61	156	120	123	120
query62	822	716	677	677
query63	225	184	184	184
query64	4297	1022	710	710
query65	4311	4207	4253	4207
query66	1081	434	319	319
query67	15586	15449	14967	14967
query68	8173	907	567	567
query69	479	313	282	282
query70	1229	1088	1106	1088
query71	480	332	302	302
query72	5608	4773	4728	4728
query73	720	634	351	351
query74	9253	8734	8907	8734
query75	3879	3068	2621	2621
query76	3649	1129	736	736
query77	776	384	317	317
query78	9615	9791	8874	8874
query79	2202	798	589	589
query80	628	543	479	479
query81	475	251	223	223
query82	426	138	110	110
query83	256	263	252	252
query84	240	94	90	90
query85	783	371	336	336
query86	354	301	313	301
query87	4362	4329	4159	4159
query88	3490	2170	2143	2143
query89	376	307	286	286
query90	1948	213	210	210
query91	143	139	112	112
query92	92	71	64	64
query93	1431	993	646	646
query94	678	412	310	310
query95	387	312	300	300
query96	476	579	273	273
query97	2654	2671	2574	2574
query98	250	214	216	214
query99	1574	1381	1293	1293
Total cold run time: 274983 ms
Total hot run time: 185176 ms

@doris-robot

Copy link
Copy Markdown
ClickBench: Total hot run time: 31.83 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit d91aea1d4b198c460a70922cc8e4dffbd9bc1998, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.24	0.08	0.07
query4	1.62	0.10	0.11
query5	0.44	0.40	0.39
query6	1.16	0.64	0.63
query7	0.02	0.02	0.02
query8	0.05	0.03	0.03
query9	0.61	0.51	0.52
query10	0.57	0.57	0.57
query11	0.15	0.10	0.10
query12	0.14	0.11	0.12
query13	0.63	0.62	0.60
query14	0.80	0.83	0.82
query15	0.90	0.87	0.85
query16	0.39	0.39	0.39
query17	1.00	1.01	1.02
query18	0.21	0.20	0.20
query19	1.90	1.85	1.77
query20	0.02	0.01	0.01
query21	15.40	0.95	0.58
query22	0.75	1.16	0.65
query23	15.04	1.38	0.65
query24	7.07	0.61	0.40
query25	0.46	0.13	0.08
query26	0.62	0.16	0.14
query27	0.05	0.06	0.05
query28	9.38	0.95	0.43
query29	12.56	3.88	3.21
query30	3.07	3.04	2.99
query31	2.83	0.59	0.38
query32	3.24	0.54	0.47
query33	3.04	3.01	3.08
query34	15.99	5.44	4.84
query35	4.90	4.87	4.86
query36	0.68	0.50	0.50
query37	0.09	0.07	0.06
query38	0.06	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.15	0.14
query41	0.08	0.03	0.02
query42	0.04	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 106.57 s
Total hot run time: 31.83 s

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Aug 20, 2025
@morrySnow
morrySnow merged commit ce9fdd9 into apache:master Aug 20, 2025
cambyzju added a commit to cambyzju/incubator-doris that referenced this pull request Aug 20, 2025
related pr: apache#54409

**What's the problem:**
1. `ADMIN SET ALL FRONTENDS CONFIG` command will forward to other FEs
use new commnad `ADMIN SET FRONTEND CONFIG`
2. Then other FE if found `MasterOnly` config, will forward to this
request to MASTER again

**How to fix:**
1. `SET ALL FRONTENDS` forward to other FEs, still use the same command:
`SET ALL FRONTENDS`;
2. while Env.setConfig for `SET ALL FRONTENDS` , do not forward again
while is proxy;
cambyzju added a commit to cambyzju/incubator-doris that referenced this pull request Aug 20, 2025
related pr: apache#54409

**What's the problem:**
1. `ADMIN SET ALL FRONTENDS CONFIG` command will forward to other FEs
use new commnad `ADMIN SET FRONTEND CONFIG`
2. Then other FE if found `MasterOnly` config, will forward to this
request to MASTER again

**How to fix:**
1. `SET ALL FRONTENDS` forward to other FEs, still use the same command:
`SET ALL FRONTENDS`;
2. while Env.setConfig for `SET ALL FRONTENDS` , do not forward again
while is proxy;
cambyzju added a commit to cambyzju/incubator-doris that referenced this pull request Aug 21, 2025
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Nov 18, 2026
### Background

External catalogs retain connector properties. Provider declarations feed the FE's masking registry; catalog display, catalog metadata, and audit SQL rendering use that registry.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#70338 (provider-owned masking and ALTER CATALOG audit coverage), apache#70696 (overlapping metastore URI annotation fix), apache#55016 (all-FE configuration forwarding)
PR Type: Bugfix

Problem Summary:

Name-only matching exposes JDBC/URL and SDK/Hadoop credentials. Apply one display policy plus a dynamic FE-local name regex, preserving permanent rules. The diff also completes diagnostic annotations and tests.

An exercised `uri` value:

| Before | After |
|---|---|
| `https://fixture:fixture-password@api.example.com/v1?region=east&token=fixture-token` | `https://api.example.com/v1?region=east&token=*XXX` |

### Details

- **Change map:** Production code: +279/-28; tests: +710/-50; CI config: +9/-0; no generated/docs/submodule changes. Most added lines are tests. Production parts are shared name/value policy and output routing (about 210 added lines), validated configuration and SQL forwarding (about 30), and provider declarations/diagnostic masking (about 40).
- **Frequency:** Always when a retained credential uses one of the uncovered names or connection formats; reproduced in property display and CREATE/ALTER audit rewriting.
- **Root cause:** `DatasourcePrintableMap` checked names without inspecting values; credential declarations were incomplete. URI parsing accepted later endpoints as path text, and forwarded config SQL embedded decoded strings without escaping.
- **Why existing tests missed it:** Property tests missed URL/Hadoop/custom-name cases; access-key assertions expected disclosure. Metastore URI diagnostics lacked coverage. Admin config and manager regression tests used numeric values, missing SQL escaping.
- **Fix:** Share catalog/audit/lineage masking, complete credential annotations and distinguish diagnostic URIs; quote forwarded config strings using the session SQL mode.
- **Other paths and branches:** Shared output callers inherit the rules. Cached branch-3.1/4.0/4.1/4.2 retain the parsing gap; only master changes. No single introducing PR was identified.
- **Configs and defaults:** `datasource_sensitive_property_pattern` is FE-local, mutable and case-insensitive, defaulting to `password|passwd|secret|token|credential|access[._-]?key|api[._-]?key`. Startup/custom-file/runtime validation rejects invalid stored expressions without replacing the previous value. `(?!)` disables only the supplement; empty matches every name. Configure all serving FEs consistently.
- **Behavior change:** Stored properties and connections are unchanged. Display is more conservative: keyword matches can hide metadata, and URLs can lose userinfo/fragments or normalize query separators.

The complete masking rules are:

| Input | Output rule |
|---|---|
| Existing exact sensitive keys and provider prefixes | Remain masked, independently of the configurable pattern. Existing hidden-property rules still omit their entries. |
| Recognizable JDBC property names | Names ending in a JDBC `url`/`uri` component, including `jdbc_url`, `jdbc.jdbc_url`, `iceberg.jdbc.uri`, and `paimon.jdbc.uri`, mask completely. `connectionString`, `connection_string`, `connection-string`, and `connection.string` suffixes also mask completely. |
| JDBC values under any name | Any trimmed value beginning with `jdbc:`, case-insensitively, masks completely, including a bare `uri` alias and opaque/driver-specific JDBC syntax. |
| Native SDK credentials | Bare or dot/underscore/hyphen-delimited final components `token`, `credential`, or `credentials` mask completely. Registered aliases and the configurable pattern add coverage. |
| Hadoop credentials | The built-in families below mask completely, including dynamic bucket/account names and names prefixed before `fs.`; they do not depend on the configurable pattern. Other credential-like names receive the default pattern's protection. |
| Custom names | A match against the configured regex masks the entire value. Matching is a search, so the default protects `custom.password`, `clientSecret`, and `custom.accessKey`. It is unioned with every permanent rule. |
| Ordinary addresses | Hostnames, IPv4, bracketed IPv6, optional numeric ports in 0–65535, and comma-separated host lists remain visible. Empty address values stay empty. |
| URL selection | Sanitize properties ending in a delimited `uri/url/host/endpoint/address` component, including plural forms, and hierarchical `scheme://` values under other names. A name already classified sensitive takes precedence and masks completely. |
| Supported URL schemes | `http`, `https`, `thrift`, `hdfs`, `s3`, `s3a`, `s3n`, `oss`, `cos`, `cosn`, `obs`, `gs`, `abfs`, `abfss`, `wasb`, `wasbs`. Preserve the host, port, ordinary path, and non-sensitive query parameters; remove all userinfo and the entire fragment. |
| URL query credentials | Decode parameter names, process duplicates and both `&`/`;` separators, and mask values whose names match permanent/configured rules or contain `password/passwd/pwd/secret/token/credential`, access/API/account/private/auth/app/application key variants, or `authorization`; exact `auth` and `key` are also protected. Query separators render as `&`; decoded names must use ASCII letters/digits, dot, underscore, tilde, or hyphen. |
| Signed URLs | A decoded query name containing `signature`, or a delimited `sig`/`sas` component, masks the entire URL, including AWS/GCS/OSS/CloudFront signatures and Azure SAS. |
| Unreliable address parsing | Unknown schemes, opaque/invalid URLs, invalid host/port or escaping, unrecognized query names, matrix path parameters, repeated encoding, and nested connection strings in otherwise unclassified query values mask completely. Any comma-containing URL masks completely, including ordinary query commas; decoded paths containing commas or nested `://` also mask completely. Valid plain host:port lists remain visible. No raw-value or parser-exception fallback is logged. |
| All-FE configuration SQL | `ADMIN SET ALL FRONTENDS CONFIG` quotes decoded names and values according to the forwarded `sql_mode`; regex backslashes and quotes survive peer reparsing in default and `NO_BACKSLASH_ESCAPES` modes. |
| Typed URI diagnostics | Iceberg/Paimon JDBC and REST URI fields, including the shared `uri` alias, use `sensitive=true, sensitiveInDiagnosticsOnly=true`: non-empty diagnostic values render as `***`, empty values as `<empty>`. They do not export URI aliases into the global secret-name registry; catalog output follows the value-aware rules above. |
| Credential annotations | Access keys and every declared alias in S3, MinIO, GCS, OSS, COS, OBS, Iceberg Glue and Iceberg REST now join existing secret/token annotations; Ozone access keys and JDBC catalog URLs remain protected. These declarations mask typed diagnostics and contribute unconditional provider-sensitive names. Non-secret account names, OAuth modes/scopes and credential-file paths are unchanged. |

Permanent Hadoop families, matched case-insensitively:

| Namespace | Credential fields |
|---|---|
| `fs.s3.` / `fs.s3a.` and optional `bucket.<bucket>.` | `access.key`, `secret.key`, `session.token`, `encryption.key`, `server-side-encryption.key`, `proxy.password`; dotted bucket names are supported. |
| `fs.azure.` | `account.key`, `sas`, `sas.fixed.token`, `account.oauth2.client.secret`, `account.oauth2.refresh.token`, `encryption.encoded.client-provided.key`, including account/container suffixes. |
| `fs.adl.oauth2.` | `credential`, `refresh.token`. |
| `fs.oss.` | `accessKeyId`, `accessKeySecret`, `securityToken`. |
| `fs.cosn.` with optional `userInfo.` | `secretId`, `secretKey`. |
| `fs.obs.` | `access.key`, `secret.key`, `session.token`, `security.token`. |

Masking uses `*XXX` in property output. Lineage continues omitting name-classified secrets and sanitizes other values. Non-empty annotated credentials render as `***` in typed diagnostics. The retained `mc.session_token` declaration does not add token authentication to the current binder.

### Testing

- Before the policy change: 8 of 9 new property-policy tests fail because original credentials remain visible; the ordinary endpoint control passes.
- Before the JDBC annotation: 2 of 18 JDBC tests fail on the URL declaration and diagnostic disclosure.
- Configuration trimming: a targeted test reproduces accepting a regex that becomes invalid after storage trimming.
- Annotation follow-up baseline: S3 and Iceberg execute with 5 failures; Paimon executes separately with 2 URI diagnostic failures. The multi-URL case fails because its later password remains visible.
- `run-fe-ut.sh` passes all 367 tests in 35 selected classes locally: masking/audit/lineage, configuration, metastore/filesystem holders, actual provider registration, security/metadata/plugin surfaces, dispatch and config SQL roundtrips. Coverage includes URL lists, encoded/duplicate/signed URLs, 5,001-host lists, dynamic rules and unchanged connection values. FE Checkstyle passes.
- Extended the P0/nonConcurrent SQL audit suite with SHOW, `catalogs()`, and persisted CREATE/ALTER assertions. It was not executed locally; the regular P0 configuration includes it, while cloud P0 skips nonConcurrent suites.

| CI check | Evidence |
|---|---|
| Gitleaks 8.30.0 | The Gitleaks job scans the full PR commit range and misclassifies two adjacent Hadoop property-name literals as API-key values. The same scan reproduces 2 findings before the config fix and 0 after it. A generic-api-key exception requires both the exact test path and one of two exact synthetic property names. |
| All-FE regex forwarding | Before the serializer fix, 2 of 9 admin-config tests fail: the peer exposes `custom.pin1`, and the regex loses its backslash. After the fix, all 9 pass; actual parser/serializer/Env application plus masking and a literal matrix cover both SQL modes and command scopes. Peer application is simulated in-process, without multi-FE RPC. |
| Exception boundaries | Two fixture-name occurrences in another file and an unrelated synthetic API-key value in the allowed file remain detected; only the two intended occurrences are ignored. |

### Notes for Reviewers

The new defaulted `ConnectorProperty.sensitiveInDiagnosticsOnly` metadata prevents shared URI aliases from hiding every REST endpoint. Connector/metastore SPI signatures and baselines are unchanged. Free-text secrets, SDK containers and unrelated logging remain outside scope.

### Release note

External data source displays and audit property output now mask JDBC connection strings, native SDK/Hadoop credentials, credential-like custom properties, and URL authentication components. The new FE configuration `datasource_sensitive_property_pattern` adjusts extra name matching without disabling permanent credential rules.

### Check List (For Author)

- Behavior changed: Yes (see Details).
- Does this need documentation: Yes (document the FE config and catalog-output rules in apache/doris-website; detailed rules are included above).
- Pre-submission status: Partially verified: SQL regression and multi-FE RPC not executed locally.

### AI Disclosure

- Tool: Codex (GPT-6).
- Generated: Production changes, tests, and this description.
- Human review: not stated.
- Prompts: Mask MaxCompute/Ozone credentials, extend shared JDBC/URL/SDK/Hadoop/custom-name rules, then complete sensitive annotations and address review findings.
Gabriel39 added a commit that referenced this pull request Nov 20, 2026
…70705)

### Background

External catalogs retain connector properties. Provider declarations
feed the masking registry used by display, metadata and audit SQL.

### What problem does this PR solve?

Issue Number: None
Related PR: #70338 (provider-owned masking and ALTER CATALOG audit
coverage), #70696 (overlapping metastore URI annotation fix), #55016
(all-FE configuration forwarding), #67489 (resolved streaming audit
inputs)
PR Type: Bugfix

Problem Summary:

Name-only matching exposes JDBC/URL and SDK/Hadoop credentials. Apply
shared value-aware masking and a supplementary FE-local name regex,
completing diagnostic annotations.

An exercised `uri` value:

| Before | After |
|---|---|
|
`https://fixture:fixture-password@api.example.com/v1?region=east&token=fixture-token`
| `https://api.example.com/v1?region=east&token=*XXX` |

### Details

- **Change map:** Production: +514/-44 across 28 files; tests: +1237/-76
across 30; CI: +9/-0 in one. No generated/docs/submodule changes.
Production covers shared masking, provider annotations, configuration
forwarding and structured streaming audit rendering.
- **Frequency:** Always when a retained credential uses one of the
uncovered names or connection formats; reproduced in property display
and CREATE/ALTER audit rewriting.
- **Root cause:** `DatasourcePrintableMap` checked names without
inspecting values; credential declarations were incomplete. Generic URI
parsing also hid local files, ViewFS and resolved streaming batches;
configuration forwarding lost SQL escapes.
- **Why existing tests missed it:** Property tests missed
format-specific locations; streaming assertions had accepted hidden
final URIs. SQL audit tests missed these formats; existing ADBC metadata
tests already require visible local paths. Admin tests missed string
escaping.
- **Fix:** Share catalog/audit/lineage masking, complete credential
annotations and distinguish diagnostic URIs; preserve supported
locations and independently sanitize selected streaming files at final
audit emission; quote forwarded configuration strings correctly.
- **Other paths and branches:** Shared output callers inherit the rules.
Cached branch-3.1/4.0/4.1/4.2 retain the parsing gap; only master
changes. No single introducing PR was identified.
- **Configs and defaults:** `datasource_sensitive_property_pattern` is
FE-local, mutable and case-insensitive, defaulting to
`password|passwd|secret|token|credential|access[._-]?key|api[._-]?key`.
Startup/custom-file/runtime validation rejects invalid stored
expressions without replacing the previous value. `(?!)` disables only
the supplement; empty matches every name. Configure all serving FEs
consistently.
- **Behavior change:** Stored properties and connections are unchanged.
Display is more conservative: keyword matches can hide metadata, and
URLs can lose userinfo/fragments or normalize query separators.

The complete masking rules are:

| Input | Output rule |
|---|---|
| Existing exact sensitive keys and provider prefixes | Remain masked,
independently of the configurable pattern. Existing hidden-property
rules still omit their entries. |
| Recognizable JDBC property names | Names ending in a JDBC `url`/`uri`
component, including `jdbc_url`, `jdbc.jdbc_url`, `iceberg.jdbc.uri`,
and `paimon.jdbc.uri`, mask completely. `connectionString`,
`connection_string`, `connection-string`, and `connection.string`
suffixes also mask completely. |
| JDBC values under any name | Any trimmed value beginning with `jdbc:`,
case-insensitively, masks completely, including a bare `uri` alias and
opaque/driver-specific JDBC syntax. |
| Native SDK credentials | Bare or dot/underscore/hyphen-delimited final
components `token`, `credential`, or `credentials` mask completely.
Registered aliases and the configurable pattern add coverage. |
| Hadoop credentials | The built-in families below mask completely,
including dynamic bucket/account names and names prefixed before `fs.`;
they do not depend on the configurable pattern. Other credential-like
names receive the default pattern's protection. |
| Custom names | A match against the configured regex masks the entire
value. Matching is a search, so the default protects `custom.password`,
`clientSecret`, and `custom.accessKey`. It is unioned with every
permanent rule. |
| Ordinary addresses | Hostnames, IPv4, bracketed IPv6, optional numeric
ports in 0–65535, and comma-separated host lists remain visible. Empty
address values stay empty. |
| URL selection | Sanitize properties ending in a delimited
`uri/url/host/endpoint/address` component, including plural forms, and
hierarchical `scheme://` or `file:/`, `hdfs:/`, `viewfs:/` values under
other names. A name already classified sensitive takes precedence and
masks completely. |
| Supported URL schemes | `http`, `https`, `thrift`, `hdfs`, `viewfs`,
`file`, `s3`, `s3a`, `s3n`, `oss`, `cos`, `cosn`, `obs`, `gs`, `abfs`,
`abfss`, `wasb`, `wasbs`. Preserve the host, port, ordinary path, and
non-sensitive query parameters; remove authentication userinfo (Azure
exception below) and the entire fragment. |
| Local driver paths and file URIs | Recognized `driver_url` suffixes
retain absolute POSIX paths, including spaces/Unicode;
protocol-relative, control, query, fragment, userinfo, matrix or
nested-URL syntax masks completely. Hierarchical `file:/absolute/path`
and `file:///absolute/path` retain their spelling, require no authority,
and use the common query/signature/fragment rules. Name/JDBC masking
takes precedence. |
| Native filesystem locations | `viewfs://mount-name/path` accepts
validated ordinary-address authority syntax, including ASCII underscore
mount names, with numeric-port checks; it names a logical mount table
rather than requiring a DNS host. Hierarchical absolute `hdfs:/path`,
`hdfs:///path` and `viewfs:///path` can omit authority and retain their
slash form, using configured nameservice/default-mount semantics. GCS
`gs://` authorities require 3–222 lowercase ASCII
letters/digits/dots/underscores/hyphens, start/end with a letter/digit,
and dot-separated components at most 63 characters; ports, escaping and
other syntax mask completely. This accepts underscores rather than
imposing DNS-host syntax; remove authentication userinfo and retain
common query/path/signature checks. This is display-safety validation,
not bucket-creation policy. HTTP/S3 host validation remains strict. [GCS
naming rules](https://docs.cloud.google.com/storage/docs/buckets). |
| Resolved S3 streaming audit inputs | Snapshot task-selected files;
sanitize each singleton location independently, then assemble the
existing escaped batch syntax. Preserve selected filenames in final
success/failure/notification audit events, including tested literal
commas, braces, brackets, backslashes, spaces, hashes, percent text and
plus signs. Already-decoded selected keys treat `#` literally, including
in query-shaped suffixes; temporary URI encoding is only for validation.
Native path text is already decoded, so literal `%`, `%HH` and `+` are
preserved without another decoding or URI-encoding-layer check. Native
query-shaped suffixes preserve non-secret separator spelling, empty
components and raw values. Whole-suffix temporary encoding is only for
URI validation; names/signatures retain shared rules, while value
inspection checks raw and at most three percent-decoded views (including
form spaces) and masks residual encoding. Matrix/nested/list-shape path
guards and unknown-name masking remain. Ordinary URL fragments still
disappear. Query credentials/signatures retain their common policy. Any
signed/unreliable location masks the entire batch. Apply current name
rules and sanitize all other TVF properties at emission; execution
inputs remain unchanged. Release temporary map/list snapshots on the
worker after synchronous emission, including failure and early
cancellation. This exception is internal and does not admit untrusted
catalog/SQL URI-list strings. |
| Azure storage locations | For `abfs`, `abfss`, `wasb`, and `wasbs`
(case-insensitive), retain `container@host` after validating the raw
container with the existing `AzureUri` grammar: one character for
compatibility, or 3–63 lowercase ASCII letters/digits/hyphens, beginning
and ending with a letter/digit. Missing, encoded, malformed or
password-bearing containers mask the whole URI. Path/query checks and
signed-URL masking still apply. |
| URL query credentials | Decode parameter names, process duplicates and
both `&`/`;` separators, and mask values whose names match
permanent/configured rules or contain
`password/passwd/pwd/secret/token/credential`,
access/API/account/private/auth/app/application key variants, or
`authorization`; exact `auth` and `key` are also protected. Ordinary URL
query separators render as `&`; native selected-key suffixes retain
their separators and empty components; decoded names must use ASCII
letters/digits, dot, underscore, tilde, or hyphen. |
| Signed URLs | A decoded query name containing `signature`, or a
delimited `sig`/`sas` component, masks the entire URL, including
AWS/GCS/OSS/CloudFront signatures and Azure SAS. |
| Unreliable address parsing | For ordinary URL/address inputs, unknown
schemes, opaque/invalid URLs, invalid host/port or escaping,
unrecognized query names, matrix path parameters, repeated encoding, and
nested connection strings in otherwise unclassified query values,
including whitespace/form-space-prefixed JDBC, mask completely. Outside
the structured streaming path above, any comma-containing URL masks
completely, including ordinary query commas; decoded paths containing
commas or nested `://` also mask completely. Valid plain host:port lists
remain visible. No raw-value or parser-exception fallback is logged. |
| All-FE configuration SQL | `ADMIN SET ALL FRONTENDS CONFIG` quotes
decoded names and values according to the forwarded `sql_mode`; regex
backslashes and quotes survive peer reparsing in default and
`NO_BACKSLASH_ESCAPES` modes. |
| Typed URI diagnostics | Iceberg/Paimon JDBC and REST URI fields,
including the shared `uri` alias, use `sensitive=true,
sensitiveInDiagnosticsOnly=true`: non-empty diagnostic values render as
`***`, empty values as `<empty>`. They do not export URI aliases into
the global secret-name registry; catalog output follows the value-aware
rules above. |
| Credential annotations | Access keys and every declared alias in S3,
MinIO, GCS, OSS, COS, OBS, Iceberg Glue and Iceberg REST now join
existing secret/token annotations; Ozone access keys and JDBC catalog
URLs remain protected. These declarations mask typed diagnostics and
contribute unconditional provider-sensitive names. These annotation
additions do not reclassify account names, OAuth modes/scopes or
credential-file paths; generic name rules can independently mask such
names. |

Permanent Hadoop families, matched case-insensitively:

| Namespace | Credential fields |
|---|---|
| `fs.s3.` / `fs.s3a.` and optional `bucket.<bucket>.` | `access.key`,
`secret.key`, `session.token`, `encryption.key`,
`server-side-encryption.key`, `proxy.password`; dotted bucket names are
supported. |
| `fs.azure.` | `account.key`, `sas`, `sas.fixed.token`,
`account.oauth2.client.secret`, `account.oauth2.refresh.token`,
`encryption.encoded.client-provided.key`, including account/container
suffixes. |
| `fs.adl.oauth2.` | `credential`, `refresh.token`. |
| `fs.oss.` | `accessKeyId`, `accessKeySecret`, `securityToken`. |
| `fs.cosn.` with optional `userInfo.` | `secretId`, `secretKey`. |
| `fs.obs.` | `access.key`, `secret.key`, `session.token`,
`security.token`. |

Masking uses `*XXX` in property output. Lineage continues omitting
name-classified secrets and sanitizes other values. Non-empty annotated
credentials render as `***` in typed diagnostics. The retained
`mc.session_token` declaration does not add token authentication to the
current binder.

### Testing

- `run-fe-ut.sh` passes all 565 tests in 47 selected classes locally:
masking/audit/lineage, configuration, metastore/filesystem holders,
actual provider registration, security/metadata/plugin surfaces,
dispatch, S3 offsets, ADBC paths, audit publication and config SQL
roundtrips. Coverage includes URL lists, encoded/duplicate/signed URLs,
5,001-host lists, dynamic rules and unchanged connection values. FE
Checkstyle passes.
- Extended the P0/nonConcurrent SQL audit suite with SHOW, `catalogs()`,
and persisted CREATE/ALTER assertions. It was not executed locally; the
regular P0 configuration includes it, while cloud P0 skips nonConcurrent
suites.

| CI check | Evidence |
|---|---|
| Initial policy/annotation baselines | Before the policy change, 8 of 9
new tests expose credentials; the safe-endpoint control passes. Before
the JDBC annotation, 2 of 18 tests fail. S3/Iceberg annotation tests
reproduce 5 failures; Paimon separately reproduces 2. The multi-URL
baseline exposes its later password. |
| Configuration trimming | A targeted test reproduces a regex accepted
before trimming that becomes invalid when stored. |
| Azure container regression | Before the fix, 18 tests/2 classes
reproduce 5 assertion failures: container loss in property display,
token-query URLs, CREATE/ALTER audit and lineage, plus malformed
authority passing through. New cases cover all four schemes, uppercase
scheme, container length/character boundaries, encoded/password-bearing
authority, query credentials and SAS signatures. The final expanded FE
run passes all 565 tests/47 classes; the existing AzureUri parser suite
is included. |
| Existing FE integration tests | The previous head reproduces all 7 CI
failures in 39 tests/4 classes. Provider fixtures use opaque names to
prove admission independently of the generic regex. Final streaming
audit assertions now require resolved batches, replacing the incomplete
expectation that their URIs should be hidden. Malformed hosts and
CREATE/ALTER JOB JDBC URLs remain masked. |
| Location compatibility | Before this follow-up, 37 tests/3 classes
reproduce 9 failures across final streaming events, local paths and
lineage. A separate renderer probe reproduces literal-filename loss
before its fix and passes afterward. Final tests cover one/multiple
files, failed tasks, notifications, signed/embedded credentials, literal
filenames, runtime rule changes, local/file URI rejection boundaries and
ViewFS. |
| Native locations and snapshot lifetime | Actual formatter probe
reproduces three valid native locations masking; five focused methods
reproduce five assertion failures in property/lineage and successful,
failed and canceled task snapshot ownership. Added positive native
audit/lineage cases, credential/signature/opaque/invalid-S3 controls and
post-run release assertions. Final repository FE run passes 565 tests/47
classes; the same five focused methods and the actual native/literal
renderer probes pass; Checkstyle passes. |
| Literal hash identities | Before the fix, the actual final renderer
collapses two selected hash keys to identical names. Before the fix, six
focused methods execute: four expected
hash/notification/credential/signature assertion failures and two
existing controls pass. Tests require distinct hashes for one/multiple
selected files on success/failure, notifications and query-shaped
suffixes; ordinary URI fragment removal remains covered. Final FE run
passes 565 tests/47 classes; Checkstyle and all original probes pass.
Before its fix, a self-review probe initializes the pinned Hadoop
ViewFileSystem with mount_table but observes MASK in display;
named-ViewFS property/audit/lineage and malformed/encoded/port/signature
controls now cover the repaired authority branch. |
| Decoded native percent paths | Before the fix, the actual final
renderer masks a batch containing100%.csv; four focused methods
reproduce two percent failures with two existing controls passing. Tests
add native percent/nonhex/%HH/repeated-looking/plus identities for
one/multiple files, success/failure and notifications, with generic URI
negative controls. Final repository FE run passes 565 tests/47 classes;
the same percent renderer probe and four focused methods pass.
Checkstyle passes. |
| Independent local review | Qualified gpt-6-astra/xhigh lead and
coverage reviewers approve exact
head5a39cd98f66872ce9502f636d617bdae565ca5c5:59 changed files,17
checkpoints,0 findings/regressions,one-round convergence. [Commit-bound
PASS
receipt](#70705 (comment)).
Static review is separate from the author-run tests above; cluster
SQL/multi-FE RPC remain unverified. |
| Native suffix spelling and inspection | Before repair, six focused
methods produce four identity/credential/opaque-JDBC failures and two
passing controls. Cases cover separator/empty-component identity,
percent/space/plus/encoded-looking values, final
success/failure/notification events, masked values with preserved
non-secret syntax, and encoded/double/deep nested URLs beside malformed
native percent text. A separate form-space JDBC guard fails before its
repair. Final repository FE run passes 565 tests/47 classes; all seven
focused identity/security/control methods and independent Checkstyle
pass. |
| GCP metadata | Identity roundtrips run with the supplementary pattern
disabled using `(?!)`; permanent HMAC keys remain masked. A separate
credential-keyword test checks that `gs.credential_provider_type` is
masked, matching the default heuristic's conservative treatment of
metadata names. The original pattern is restored after each test. |
| Gitleaks 8.30.0 | The Gitleaks job scans the full PR commit range and
misclassifies two adjacent Hadoop property-name literals as API-key
values. The same scan reproduces 2 findings before the config fix and 0
after it. A generic-api-key exception requires both the exact test path
and one of two exact synthetic property names. |
| All-FE regex forwarding | Before the serializer fix, 2 of 9
admin-config tests fail: the peer exposes `custom.pin1`, and the regex
loses its backslash. After the fix, all 9 pass; actual
parser/serializer/Env application plus masking and a literal matrix
cover both SQL modes and command scopes. Peer application is simulated
in-process, without multi-FE RPC. |
| Exception boundaries | Two fixture-name occurrences in another file
and an unrelated synthetic API-key value in the allowed file remain
detected; only the two intended occurrences are ignored. |

### Notes for Reviewers

The new defaulted `ConnectorProperty.sensitiveInDiagnosticsOnly`
metadata prevents shared URI aliases from hiding every REST endpoint.
Connector/metastore SPI signatures and baselines are unchanged.
Free-text secrets, SDK containers and unrelated logging remain outside
scope.

### Release note

External data source displays and audit property output now mask JDBC
connection strings, native SDK/Hadoop credentials, credential-like
custom properties, and URL authentication components. The new FE
configuration `datasource_sensitive_property_pattern` adjusts extra name
matching without disabling permanent credential rules.

### Check List (For Author)

- Behavior changed: Yes (see Details).
- Does this need documentation: Yes (document the FE config and
catalog-output rules in apache/doris-website; detailed rules are
included above).
- Pre-submission status: Partially verified: SQL regression and multi-FE
RPC not executed locally.

### AI Disclosure

- Tool: Codex (GPT-6).
- Generated: Production changes, tests, and this description.
- Human review: not stated.
- Prompts: Mask MaxCompute/Ozone credentials, extend shared
JDBC/URL/SDK/Hadoop/custom-name rules, then complete sensitive
annotations and address review findings.
wyxxxcat pushed a commit to wyxxxcat/doris that referenced this pull request Nov 24, 2026
…pache#70705)

External catalogs retain connector properties. Provider declarations
feed the masking registry used by display, metadata and audit SQL.

Issue Number: None
Related PR: apache#70338 (provider-owned masking and ALTER CATALOG audit
coverage), apache#70696 (overlapping metastore URI annotation fix), apache#55016
(all-FE configuration forwarding), apache#67489 (resolved streaming audit
inputs)
PR Type: Bugfix

Problem Summary:

Name-only matching exposes JDBC/URL and SDK/Hadoop credentials. Apply
shared value-aware masking and a supplementary FE-local name regex,
completing diagnostic annotations.

An exercised `uri` value:

| Before | After |
|---|---|
|
`https://fixture:fixture-password@api.example.com/v1?region=east&token=fixture-token`
| `https://api.example.com/v1?region=east&token=*XXX` |

- **Change map:** Production: +514/-44 across 28 files; tests: +1237/-76
across 30; CI: +9/-0 in one. No generated/docs/submodule changes.
Production covers shared masking, provider annotations, configuration
forwarding and structured streaming audit rendering.
- **Frequency:** Always when a retained credential uses one of the
uncovered names or connection formats; reproduced in property display
and CREATE/ALTER audit rewriting.
- **Root cause:** `DatasourcePrintableMap` checked names without
inspecting values; credential declarations were incomplete. Generic URI
parsing also hid local files, ViewFS and resolved streaming batches;
configuration forwarding lost SQL escapes.
- **Why existing tests missed it:** Property tests missed
format-specific locations; streaming assertions had accepted hidden
final URIs. SQL audit tests missed these formats; existing ADBC metadata
tests already require visible local paths. Admin tests missed string
escaping.
- **Fix:** Share catalog/audit/lineage masking, complete credential
annotations and distinguish diagnostic URIs; preserve supported
locations and independently sanitize selected streaming files at final
audit emission; quote forwarded configuration strings correctly.
- **Other paths and branches:** Shared output callers inherit the rules.
Cached branch-3.1/4.0/4.1/4.2 retain the parsing gap; only master
changes. No single introducing PR was identified.
- **Configs and defaults:** `datasource_sensitive_property_pattern` is
FE-local, mutable and case-insensitive, defaulting to
`password|passwd|secret|token|credential|access[._-]?key|api[._-]?key`.
Startup/custom-file/runtime validation rejects invalid stored
expressions without replacing the previous value. `(?!)` disables only
the supplement; empty matches every name. Configure all serving FEs
consistently.
- **Behavior change:** Stored properties and connections are unchanged.
Display is more conservative: keyword matches can hide metadata, and
URLs can lose userinfo/fragments or normalize query separators.

The complete masking rules are:

| Input | Output rule |
|---|---|
| Existing exact sensitive keys and provider prefixes | Remain masked,
independently of the configurable pattern. Existing hidden-property
rules still omit their entries. |
| Recognizable JDBC property names | Names ending in a JDBC `url`/`uri`
component, including `jdbc_url`, `jdbc.jdbc_url`, `iceberg.jdbc.uri`,
and `paimon.jdbc.uri`, mask completely. `connectionString`,
`connection_string`, `connection-string`, and `connection.string`
suffixes also mask completely. |
| JDBC values under any name | Any trimmed value beginning with `jdbc:`,
case-insensitively, masks completely, including a bare `uri` alias and
opaque/driver-specific JDBC syntax. |
| Native SDK credentials | Bare or dot/underscore/hyphen-delimited final
components `token`, `credential`, or `credentials` mask completely.
Registered aliases and the configurable pattern add coverage. |
| Hadoop credentials | The built-in families below mask completely,
including dynamic bucket/account names and names prefixed before `fs.`;
they do not depend on the configurable pattern. Other credential-like
names receive the default pattern's protection. |
| Custom names | A match against the configured regex masks the entire
value. Matching is a search, so the default protects `custom.password`,
`clientSecret`, and `custom.accessKey`. It is unioned with every
permanent rule. |
| Ordinary addresses | Hostnames, IPv4, bracketed IPv6, optional numeric
ports in 0–65535, and comma-separated host lists remain visible. Empty
address values stay empty. |
| URL selection | Sanitize properties ending in a delimited
`uri/url/host/endpoint/address` component, including plural forms, and
hierarchical `scheme://` or `file:/`, `hdfs:/`, `viewfs:/` values under
other names. A name already classified sensitive takes precedence and
masks completely. |
| Supported URL schemes | `http`, `https`, `thrift`, `hdfs`, `viewfs`,
`file`, `s3`, `s3a`, `s3n`, `oss`, `cos`, `cosn`, `obs`, `gs`, `abfs`,
`abfss`, `wasb`, `wasbs`. Preserve the host, port, ordinary path, and
non-sensitive query parameters; remove authentication userinfo (Azure
exception below) and the entire fragment. |
| Local driver paths and file URIs | Recognized `driver_url` suffixes
retain absolute POSIX paths, including spaces/Unicode;
protocol-relative, control, query, fragment, userinfo, matrix or
nested-URL syntax masks completely. Hierarchical `file:/absolute/path`
and `file:///absolute/path` retain their spelling, require no authority,
and use the common query/signature/fragment rules. Name/JDBC masking
takes precedence. |
| Native filesystem locations | `viewfs://mount-name/path` accepts
validated ordinary-address authority syntax, including ASCII underscore
mount names, with numeric-port checks; it names a logical mount table
rather than requiring a DNS host. Hierarchical absolute `hdfs:/path`,
`hdfs:///path` and `viewfs:///path` can omit authority and retain their
slash form, using configured nameservice/default-mount semantics. GCS
`gs://` authorities require 3–222 lowercase ASCII
letters/digits/dots/underscores/hyphens, start/end with a letter/digit,
and dot-separated components at most 63 characters; ports, escaping and
other syntax mask completely. This accepts underscores rather than
imposing DNS-host syntax; remove authentication userinfo and retain
common query/path/signature checks. This is display-safety validation,
not bucket-creation policy. HTTP/S3 host validation remains strict. [GCS
naming rules](https://docs.cloud.google.com/storage/docs/buckets). |
| Resolved S3 streaming audit inputs | Snapshot task-selected files;
sanitize each singleton location independently, then assemble the
existing escaped batch syntax. Preserve selected filenames in final
success/failure/notification audit events, including tested literal
commas, braces, brackets, backslashes, spaces, hashes, percent text and
plus signs. Already-decoded selected keys treat `#` literally, including
in query-shaped suffixes; temporary URI encoding is only for validation.
Native path text is already decoded, so literal `%`, `%HH` and `+` are
preserved without another decoding or URI-encoding-layer check. Native
query-shaped suffixes preserve non-secret separator spelling, empty
components and raw values. Whole-suffix temporary encoding is only for
URI validation; names/signatures retain shared rules, while value
inspection checks raw and at most three percent-decoded views (including
form spaces) and masks residual encoding. Matrix/nested/list-shape path
guards and unknown-name masking remain. Ordinary URL fragments still
disappear. Query credentials/signatures retain their common policy. Any
signed/unreliable location masks the entire batch. Apply current name
rules and sanitize all other TVF properties at emission; execution
inputs remain unchanged. Release temporary map/list snapshots on the
worker after synchronous emission, including failure and early
cancellation. This exception is internal and does not admit untrusted
catalog/SQL URI-list strings. |
| Azure storage locations | For `abfs`, `abfss`, `wasb`, and `wasbs`
(case-insensitive), retain `container@host` after validating the raw
container with the existing `AzureUri` grammar: one character for
compatibility, or 3–63 lowercase ASCII letters/digits/hyphens, beginning
and ending with a letter/digit. Missing, encoded, malformed or
password-bearing containers mask the whole URI. Path/query checks and
signed-URL masking still apply. |
| URL query credentials | Decode parameter names, process duplicates and
both `&`/`;` separators, and mask values whose names match
permanent/configured rules or contain
`password/passwd/pwd/secret/token/credential`,
access/API/account/private/auth/app/application key variants, or
`authorization`; exact `auth` and `key` are also protected. Ordinary URL
query separators render as `&`; native selected-key suffixes retain
their separators and empty components; decoded names must use ASCII
letters/digits, dot, underscore, tilde, or hyphen. |
| Signed URLs | A decoded query name containing `signature`, or a
delimited `sig`/`sas` component, masks the entire URL, including
AWS/GCS/OSS/CloudFront signatures and Azure SAS. |
| Unreliable address parsing | For ordinary URL/address inputs, unknown
schemes, opaque/invalid URLs, invalid host/port or escaping,
unrecognized query names, matrix path parameters, repeated encoding, and
nested connection strings in otherwise unclassified query values,
including whitespace/form-space-prefixed JDBC, mask completely. Outside
the structured streaming path above, any comma-containing URL masks
completely, including ordinary query commas; decoded paths containing
commas or nested `://` also mask completely. Valid plain host:port lists
remain visible. No raw-value or parser-exception fallback is logged. |
| All-FE configuration SQL | `ADMIN SET ALL FRONTENDS CONFIG` quotes
decoded names and values according to the forwarded `sql_mode`; regex
backslashes and quotes survive peer reparsing in default and
`NO_BACKSLASH_ESCAPES` modes. |
| Typed URI diagnostics | Iceberg/Paimon JDBC and REST URI fields,
including the shared `uri` alias, use `sensitive=true,
sensitiveInDiagnosticsOnly=true`: non-empty diagnostic values render as
`***`, empty values as `<empty>`. They do not export URI aliases into
the global secret-name registry; catalog output follows the value-aware
rules above. |
| Credential annotations | Access keys and every declared alias in S3,
MinIO, GCS, OSS, COS, OBS, Iceberg Glue and Iceberg REST now join
existing secret/token annotations; Ozone access keys and JDBC catalog
URLs remain protected. These declarations mask typed diagnostics and
contribute unconditional provider-sensitive names. These annotation
additions do not reclassify account names, OAuth modes/scopes or
credential-file paths; generic name rules can independently mask such
names. |

Permanent Hadoop families, matched case-insensitively:

| Namespace | Credential fields |
|---|---|
| `fs.s3.` / `fs.s3a.` and optional `bucket.<bucket>.` | `access.key`,
`secret.key`, `session.token`, `encryption.key`,
`server-side-encryption.key`, `proxy.password`; dotted bucket names are
supported. |
| `fs.azure.` | `account.key`, `sas`, `sas.fixed.token`,
`account.oauth2.client.secret`, `account.oauth2.refresh.token`,
`encryption.encoded.client-provided.key`, including account/container
suffixes. |
| `fs.adl.oauth2.` | `credential`, `refresh.token`. |
| `fs.oss.` | `accessKeyId`, `accessKeySecret`, `securityToken`. |
| `fs.cosn.` with optional `userInfo.` | `secretId`, `secretKey`. |
| `fs.obs.` | `access.key`, `secret.key`, `session.token`,
`security.token`. |

Masking uses `*XXX` in property output. Lineage continues omitting
name-classified secrets and sanitizes other values. Non-empty annotated
credentials render as `***` in typed diagnostics. The retained
`mc.session_token` declaration does not add token authentication to the
current binder.

- `run-fe-ut.sh` passes all 565 tests in 47 selected classes locally:
masking/audit/lineage, configuration, metastore/filesystem holders,
actual provider registration, security/metadata/plugin surfaces,
dispatch, S3 offsets, ADBC paths, audit publication and config SQL
roundtrips. Coverage includes URL lists, encoded/duplicate/signed URLs,
5,001-host lists, dynamic rules and unchanged connection values. FE
Checkstyle passes.
- Extended the P0/nonConcurrent SQL audit suite with SHOW, `catalogs()`,
and persisted CREATE/ALTER assertions. It was not executed locally; the
regular P0 configuration includes it, while cloud P0 skips nonConcurrent
suites.

| CI check | Evidence |
|---|---|
| Initial policy/annotation baselines | Before the policy change, 8 of 9
new tests expose credentials; the safe-endpoint control passes. Before
the JDBC annotation, 2 of 18 tests fail. S3/Iceberg annotation tests
reproduce 5 failures; Paimon separately reproduces 2. The multi-URL
baseline exposes its later password. |
| Configuration trimming | A targeted test reproduces a regex accepted
before trimming that becomes invalid when stored. |
| Azure container regression | Before the fix, 18 tests/2 classes
reproduce 5 assertion failures: container loss in property display,
token-query URLs, CREATE/ALTER audit and lineage, plus malformed
authority passing through. New cases cover all four schemes, uppercase
scheme, container length/character boundaries, encoded/password-bearing
authority, query credentials and SAS signatures. The final expanded FE
run passes all 565 tests/47 classes; the existing AzureUri parser suite
is included. |
| Existing FE integration tests | The previous head reproduces all 7 CI
failures in 39 tests/4 classes. Provider fixtures use opaque names to
prove admission independently of the generic regex. Final streaming
audit assertions now require resolved batches, replacing the incomplete
expectation that their URIs should be hidden. Malformed hosts and
CREATE/ALTER JOB JDBC URLs remain masked. |
| Location compatibility | Before this follow-up, 37 tests/3 classes
reproduce 9 failures across final streaming events, local paths and
lineage. A separate renderer probe reproduces literal-filename loss
before its fix and passes afterward. Final tests cover one/multiple
files, failed tasks, notifications, signed/embedded credentials, literal
filenames, runtime rule changes, local/file URI rejection boundaries and
ViewFS. |
| Native locations and snapshot lifetime | Actual formatter probe
reproduces three valid native locations masking; five focused methods
reproduce five assertion failures in property/lineage and successful,
failed and canceled task snapshot ownership. Added positive native
audit/lineage cases, credential/signature/opaque/invalid-S3 controls and
post-run release assertions. Final repository FE run passes 565 tests/47
classes; the same five focused methods and the actual native/literal
renderer probes pass; Checkstyle passes. |
| Literal hash identities | Before the fix, the actual final renderer
collapses two selected hash keys to identical names. Before the fix, six
focused methods execute: four expected
hash/notification/credential/signature assertion failures and two
existing controls pass. Tests require distinct hashes for one/multiple
selected files on success/failure, notifications and query-shaped
suffixes; ordinary URI fragment removal remains covered. Final FE run
passes 565 tests/47 classes; Checkstyle and all original probes pass.
Before its fix, a self-review probe initializes the pinned Hadoop
ViewFileSystem with mount_table but observes MASK in display;
named-ViewFS property/audit/lineage and malformed/encoded/port/signature
controls now cover the repaired authority branch. |
| Decoded native percent paths | Before the fix, the actual final
renderer masks a batch containing100%.csv; four focused methods
reproduce two percent failures with two existing controls passing. Tests
add native percent/nonhex/%HH/repeated-looking/plus identities for
one/multiple files, success/failure and notifications, with generic URI
negative controls. Final repository FE run passes 565 tests/47 classes;
the same percent renderer probe and four focused methods pass.
Checkstyle passes. |
| Independent local review | Qualified gpt-6-astra/xhigh lead and
coverage reviewers approve exact
head5a39cd98f66872ce9502f636d617bdae565ca5c5:59 changed files,17
checkpoints,0 findings/regressions,one-round convergence. [Commit-bound
PASS
receipt](apache#70705 (comment)).
Static review is separate from the author-run tests above; cluster
SQL/multi-FE RPC remain unverified. |
| Native suffix spelling and inspection | Before repair, six focused
methods produce four identity/credential/opaque-JDBC failures and two
passing controls. Cases cover separator/empty-component identity,
percent/space/plus/encoded-looking values, final
success/failure/notification events, masked values with preserved
non-secret syntax, and encoded/double/deep nested URLs beside malformed
native percent text. A separate form-space JDBC guard fails before its
repair. Final repository FE run passes 565 tests/47 classes; all seven
focused identity/security/control methods and independent Checkstyle
pass. |
| GCP metadata | Identity roundtrips run with the supplementary pattern
disabled using `(?!)`; permanent HMAC keys remain masked. A separate
credential-keyword test checks that `gs.credential_provider_type` is
masked, matching the default heuristic's conservative treatment of
metadata names. The original pattern is restored after each test. |
| Gitleaks 8.30.0 | The Gitleaks job scans the full PR commit range and
misclassifies two adjacent Hadoop property-name literals as API-key
values. The same scan reproduces 2 findings before the config fix and 0
after it. A generic-api-key exception requires both the exact test path
and one of two exact synthetic property names. |
| All-FE regex forwarding | Before the serializer fix, 2 of 9
admin-config tests fail: the peer exposes `custom.pin1`, and the regex
loses its backslash. After the fix, all 9 pass; actual
parser/serializer/Env application plus masking and a literal matrix
cover both SQL modes and command scopes. Peer application is simulated
in-process, without multi-FE RPC. |
| Exception boundaries | Two fixture-name occurrences in another file
and an unrelated synthetic API-key value in the allowed file remain
detected; only the two intended occurrences are ignored. |

The new defaulted `ConnectorProperty.sensitiveInDiagnosticsOnly`
metadata prevents shared URI aliases from hiding every REST endpoint.
Connector/metastore SPI signatures and baselines are unchanged.
Free-text secrets, SDK containers and unrelated logging remain outside
scope.

External data source displays and audit property output now mask JDBC
connection strings, native SDK/Hadoop credentials, credential-like
custom properties, and URL authentication components. The new FE
configuration `datasource_sensitive_property_pattern` adjusts extra name
matching without disabling permanent credential rules.

- Behavior changed: Yes (see Details).
- Does this need documentation: Yes (document the FE config and
catalog-output rules in apache/doris-website; detailed rules are
included above).
- Pre-submission status: Partially verified: SQL regression and multi-FE
RPC not executed locally.

- Tool: Codex (GPT-6).
- Generated: Production changes, tests, and this description.
- Human review: not stated.
- Prompts: Mask MaxCompute/Ozone credentials, extend shared
JDBC/URL/SDK/Hadoop/custom-name rules, then complete sensitive
annotations and address review findings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants