Skip to content

[fix](catalog) Mask connector catalog secrets and the ALTER CATALOG audit text - #70338

Merged
morningman merged 4 commits into
apache:masterfrom
morningman:b2m-t38c-connector-sensitive-keys
Nov 17, 2026
Merged

morningman merged 4 commits into
apache:masterfrom
morningman:b2m-t38c-connector-sensitive-keys

Conversation

@morningman

@morningman morningman commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Background

SHOW CREATE CATALOG, SHOW CATALOG, the catalogs() table function and the audit text of CREATE CATALOG replace a property value with *XXX when DatasourcePrintableMap.isSensitiveKey matches its key. Until now the keys came from a list in fe-core and from the keys filesystem plugins report at startup. A connector plugin marks its secret properties sensitive = true, but that mark only masks the connector's own log lines. A connector tells the engine about its security-relevant properties through ConnectorProvider#securitySurface().

What problem does this PR solve?

Issue Number: None
Related PR: #69588 (added the connector security surface this extends), #45164 (introduced the unmasked ALTER CATALOG audit text), #27115 (masked it for the statement #45164 replaced), #59502 (added iceberg.jdbc.password), #54523 (added the Paimon REST DLF keys), #65730 (branch-4.1's Lance catalog, whose REST secrets the Lance port will declare on this surface), #70366 (fixed the shared Unicode SQL rewrite used by this PR's ALTER masking), #70327 (added MongoDB credentials to the engine masking floor)
PR Type: Bugfix

Problem Summary:

Catalog secrets that only a connector knows are on no masking list, so SHOW CREATE CATALOG and the other renderings print them in clear: iceberg.jdbc.password, paimon.jdbc.password, the Paimon REST DLF key pair, mc.access_key, and credentials passed through under trino. or adbc.. Separately, ALTER CATALOG ... SET PROPERTIES is written to the audit log unmasked, whatever the key. Each connector now declares its secrets on its security surface, taken from its sensitive marks, and the surface can also declare a namespace of secret keys for options passed through unread; Fluss's lake options were hard-coded in fe-core for that reason. The engine masks the union, with fe-core's own list kept as the floor. ALTER CATALOG is masked like CREATE CATALOG.

Details

  • Change map: 45 files, +1205 −81 over four commits: production code +384 −51, tests +807 −26, the connector README +13 −3, the plugin API version in fe/fe-connector/pom.xml (31.0 to 32.0). The first commit adds secret keys to the surface (reviewed alone before). The second does the rest, the third keeps a surface that fails in the connector's own ServiceLoader from stopping FE, and the fourth aligns the newly added MongoDB provider and tests ALTER masking with supplementary characters:
    1. Key namespaces on the SPI: withSensitiveKeyPrefix and SensitiveKeyPrefix.covers, which holds the matching rule; a collection form of withSensitiveKeys (ConnectorSecuritySurface).
    2. Engine: isSensitiveKey matches registered namespaces, the Fluss rule becomes one of them; ConnectorPluginManager registers them and reads every surface before it publishes a provider, skipping a provider whose surface throws.
    3. Connectors: every provider declares its secrets; MetaStoreProviders.sensitivePropertyKeys() gives the union of a plugin's metastore backends; IcebergJdbcMetaStoreProvider reports its keys like its siblings; the keytab paths lose their sensitive mark. MongoDB also declares its two annotated secrets, preserving its SSRF endpoint and the engine fallback.
    4. ALTER CATALOG audit masking (+16).
  • Frequency: Always. Create or alter a catalog that sets one of the keys above, then run SHOW CREATE CATALOG, SHOW CATALOG <name> or select * from catalogs(), or read the audit log after an ALTER CATALOG ... SET PROPERTIES.
  • Root cause: isSensitiveKey consulted only fe-core's list and the filesystem providers' keys. A connector's sensitive marks fed only toMaskedString; MetaStoreProvider.sensitivePropertyKeys() existed for this, but nothing called it, and the Iceberg JDBC backend did not implement it. For ALTER CATALOG, AlterCatalogPropertiesCommand does not implement NeedAuditEncryption and LogicalPlanBuilderForEncryption has no visitAlterCatalogProperties, so AuditLogHelper records the original text; the statement it replaced in [Enhancement] (nereids)implement alterCatalogPropertiesCommand in ner… #45164 was masked by [enhancement](audit) hide password and other sensitive information in log and audit log #27115.
  • Why existing tests missed it: Unit tests: DatasourcePrintableMapTest checks fe-core's own keys, the provider surface tests checked only the SSRF and driver_url keys, and EncryptSQLTest and RepositoryAuditEncryptionTest cover CREATE CATALOG, repositories and resources but not ALTER CATALOG. Regression: audit/test_external_catalog_credential_masking creates only Iceberg REST catalogs, whose keys are on fe-core's list, and never alters one.
  • Fix: The engine must not name a connector's properties, so the connectors declare their secrets, from the same sensitive marks that mask their logs; jdbc and es declare both spellings their legacy prefix allows, and trino and adbc declare the namespace they pass through, a key there being a secret when its rest names key, secret, password, token or credential (also authorization for ADBC). fe-core keeps the connector keys it lists, so a catalog whose plugin is not loaded masks what it masked before. A provider whose securitySurface() throws at startup is skipped, as a filesystem provider is, instead of stopping FE; that includes the ServiceConfigurationError a ServiceLoader throws when a descriptor names a backend it cannot load, which is how the Hive, Iceberg and Paimon surfaces fail, since they read their metastore backends' keys through one.
  • Other paths and branches: Fixed here: every rendering above and FE's statement logging, which share isSensitiveKey and NeedAuditEncryption. Not covered, since a key name cannot express them safely: raw Iceberg SDK keys copied through (token, credential), Paimon options re-keyed from paimon.*, Hadoop fs.* keys, and secrets inside otherwise unmarked URLs. The ALTER CATALOG gap is on branch-4.0, 4.1 and 4.2 (from [Enhancement] (nereids)implement alterCatalogPropertiesCommand in ner… #45164); branch-3.1 still uses the masked statement. branch-4.1 and 4.2 also print the connector keys above in clear; without the connector SPI their fix differs and is tracked separately.
  • Behavior change: The namespaces also mask non-secrets whose names carry those words, such as trino.hive.s3.aws-access-key or a keystore path. Keytab paths, which no release masks, are no longer masked in connector log lines: marked sensitive, hadoop.kerberos.keytab would be masked in every storage vault and resource.

Testing

The original local runs (macOS) used master f5c993f2c94 plus this change:

  • Regression audit/test_external_catalog_credential_masking, extended with an Iceberg JDBC catalog: SHOW CREATE CATALOG masks iceberg.jdbc.password, and the audit texts of its CREATE CATALOG and of an ALTER CATALOG that sets the password and s3.secret_key hold only *XXX. Against the local cluster's FE without this change it fails at the first new check, SHOW CREATE CATALOG printing the password; with a FE built from this change it passes.
  • fe-connector-spi: all 160 tests, with the refreshed surface baseline (+4 lines); the metastore modules: all tests; ten connector modules: 29 classes, 511 tests, including each connector's surface test, which checks real key names.
  • fe-core: 26 classes, 341 tests, including ConnectorPluginManagerTest, DatasourcePrintableMapTest, EncryptSQLTest and the audit and plugin gate tests; 14 of them again after the last change to registration, and 7 classes, 76 tests, after the third commit. Its two new ConnectorPluginManagerTest cases, a plugin directory whose lib/ holds a jar with a service descriptor naming a missing metastore-style backend (the plugin next to it must still load) and the same descriptor on the classpath, fail without the third commit with that ServiceConfigurationError escaping loadPlugins and loadBuiltins, and pass with it.
  • Twenty-two mutations, each caught by its test: for example, reverting either half of the ALTER CATALOG fix (EncryptSQLTest sees the statement in clear), matching a marker anywhere in the key, an empty metastore union, re-marking a keytab, or dropping ServiceConfigurationError from either startup catch (each fails only its own new case).

Rebased onto master 93c16ee2ca1 on 2026-11-16. Post-rebase local verification:

  • bash run-fe-ut.sh --run 'org.apache.doris.connector.spi.*Test,ConnectorPluginManagerTest,DatasourcePrintableMapTest,EncryptSQLTest', with CUSTOM_MVN appending -Dcheckstyle.skip=false: BUILD SUCCESS across all 90 reactor modules; all 141 selected tests passed across 22 classes, including the inherited supplementary-character audit cases. Checkstyle reported no violations.
  • git diff --check upstream-apache/master...HEAD: passed. git range-diff confirms the replayed patches are unchanged apart from adapting the connector API version and its test to 32.0.
  • Regression tests and a complete BE/FE build were not rerun locally after this rebase; run buildall is requested in CI.

Follow-up local verification on the rebased branch plus the MongoDB declaration and audit tests (2026-11-16):

  • run-fe-ut.sh --run 'org.apache.doris.connector.spi.*Test,org.apache.doris.connector.mongodb.*Test,ConnectorPluginManagerTest,DatasourcePrintableMapTest,EncryptSQLTest', with Checkstyle enabled: all 176 selected tests in 28 classes passed (SPI 93, MongoDB 35, fe-core 48), with no skipped tests; the 90-module reactor completed successfully.
  • The strengthened MongoProviderTest fails without the provider declaration (expected the two MongoDB secret keys, received an empty set), and passes with it. A separate targeted revert confirms the assertion catches the missing declaration.
  • The new ALTER CATALOG assertions cover supplementary characters within a secret, in a preceding SQL comment, and in a retained non-secret value, with two masked properties. EncryptSQLTest#testEncryption passes on the candidate and fails at the new ALTER assertion when only BaseViewInfo.rewriteSql is restored to its pre-[fix](nereids) Fix SQL masking and view rewrites after supplementary characters #70366 implementation: the audit text has an extra trailing fragment.
  • Full cluster regression and a standalone FE/BE build were not rerun for this follow-up.

Notes for Reviewers

  • SensitiveKeyPrefix.covers lives on the SPI so that a connector's test can check its declaration against real key names and the engine applies the same rule; the Fluss floor in fe-core uses it too.
  • The entries both fe-core and a connector declare are deliberate: the floor is frozen, as the comment in DatasourcePrintableMap says. MongoDB was already masked by [feature](mongodb) Add native catalog, reader and BSON SerDe #70327; its added declaration makes the provider follow the same contract as the other connectors.
  • The connector plugin API advances from 31.0 to 32.0 for the added security-surface methods. Third-party connector plugins built against 31.x must be rebuilt; the in-tree plugins are built with FE. Hudi declares nothing: it owns no catalog properties.
  • The base includes [fix](nereids) Fix SQL masking and view rewrites after supplementary characters #70366, so ALTER CATALOG masking uses the shared rewrite that converts parser code-point spans to Java string offsets, including supplementary characters.

Release note

SHOW CREATE CATALOG, SHOW CATALOG, the catalogs() table function and the audit log now mask iceberg.jdbc.password, paimon.jdbc.password, paimon.rest.dlf.access-key-id, paimon.rest.dlf.access-key-secret, mc.access_key, and the trino.* and adbc.* properties whose names carry key, secret, password, token or credential (authorization too for adbc.*). ALTER CATALOG ... SET PROPERTIES statements are masked in the audit log like CREATE CATALOG. Third-party connector plugins built against API 31.x must be rebuilt for 32.0.

Check List (For Author)

  • Behavior changed: Yes (see Details)
  • Does this need documentation: No
  • Pre-submission status: Ready

AI Disclosure

  • Tool: Claude Code (Claude Opus 5.5); OpenAI Codex
  • Generated: Claude Code wrote the original code, tests, and description. Codex rebased the commits, adapted the connector API version and its test, added the MongoDB declaration and ALTER CATALOG supplementary-character tests, and updated this description.
  • Human review: not stated
  • Prompts: The author requested a generic connector surface, prefix rules, declarations for every connector, and masking of their union with the engine floor. They removed sensitive marks from keytab paths, added ALTER CATALOG masking, and fixed startup failure from a connector's ServiceLoader. After review, they chose a separate shared Unicode fix, then requested MongoDB alignment and supplementary-character audit coverage here.

@hello-stephen

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?

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review recovery stopped: shared time budget or helper timeout exhausted
Workflow run: https://github.com/apache/doris/actions/runs/42183157017

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17594	5134	5076	5076
q2	2143	306	254	254
q3	10247	1426	844	844
q4	4676	467	346	346
q5	7433	817	543	543
q6	193	191	155	155
q7	750	794	607	607
q8	9267	1353	1083	1083
q9	5555	4231	4222	4222
q10	6827	1292	1049	1049
q11	427	250	228	228
q12	651	401	280	280
q13	18115	3606	3084	3084
q14	287	274	243	243
q15	q16	723	708	671	671
q17	1220	762	581	581
q18	7112	6217	6131	6131
q19	1115	959	594	594
q20	383	347	229	229
q21	5397	2169	2289	2169
q22	359	296	255	255
Total cold run time: 100474 ms
Total hot run time: 28644 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5639	5627	5601	5601
q2	695	572	538	538
q3	5183	5404	4991	4991
q4	2024	2176	1546	1546
q5	5301	5199	5901	5199
q6	293	198	146	146
q7	2391	2123	1844	1844
q8	3135	2913	2792	2792
q9	8153	8062	8091	8062
q10	3704	3670	3309	3309
q11	611	436	416	416
q12	699	682	556	556
q13	3656	4009	3264	3264
q14	309	303	283	283
q15	q16	716	747	685	685
q17	8436	7621	7106	7106
q18	12959	12203	12969	12203
q19	913	801	791	791
q20	2151	2143	1923	1923
q21	5710	4765	4667	4667
q22	517	482	408	408
Total cold run time: 73195 ms
Total hot run time: 66330 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 154111 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 44ed6b1ec5387a23cee6b554c88a1bf137f2d137, data reload: false

query5	4314	528	407	407
query6	425	205	186	186
query7	4809	425	233	233
query8	323	168	154	154
query9	8800	3190	3200	3190
query10	501	315	260	260
query11	6047	3877	3588	3588
query12	149	91	88	88
query13	1246	434	343	343
query14	6119	3929	3654	3654
query14_1	3430	3422	3395	3395
query15	216	207	183	183
query16	949	417	398	398
query17	874	665	530	530
query18	2427	434	328	328
query19	203	169	163	163
query20	82	81	82	81
query21	206	124	109	109
query22	12998	12964	12869	12869
query23	13371	12795	12484	12484
query23_1	12559	12522	12489	12489
query24	7366	821	469	469
query24_1	481	479	472	472
query25	522	400	342	342
query26	1265	263	136	136
query27	2759	440	275	275
query28	4611	2044	2043	2043
query29	1569	587	444	444
query30	300	215	180	180
query31	1005	923	812	812
query32	149	89	88	88
query33	522	294	234	234
query34	907	860	508	508
query35	724	749	642	642
query36	804	826	753	753
query37	128	93	83	83
query38	1801	1731	1631	1631
query39	800	798	752	752
query39_1	746	734	740	734
query40	214	121	97	97
query41	65	62	60	60
query42	93	82	85	82
query43	345	361	309	309
query44	1301	713	700	700
query45	187	177	160	160
query46	845	964	560	560
query47	2856	2873	2778	2778
query48	294	312	220	220
query49	581	421	301	301
query50	700	280	242	242
query51	10723	10453	10394	10394
query52	79	79	71	71
query53	186	204	155	155
query54	253	191	185	185
query55	72	65	62	62
query56	221	228	219	219
query57	1704	1645	1539	1539
query58	290	270	257	257
query59	2234	2270	1963	1963
query60	282	243	233	233
query61	151	151	146	146
query62	380	328	280	280
query63	188	158	161	158
query64	2741	941	777	777
query65	3329	3262	3261	3261
query66	1755	436	302	302
query67	22701	22696	22574	22574
query68	2960	1030	632	632
query69	388	288	245	245
query70	856	769	767	767
query71	303	237	218	218
query72	2838	2539	2514	2514
query73	529	528	296	296
query74	4610	4537	4368	4368
query75	2355	2286	1917	1917
query76	2343	1008	573	573
query77	337	367	277	277
query78	9818	9836	9236	9236
query79	899	842	532	532
query80	538	420	328	328
query81	519	323	268	268
query82	205	137	110	110
query83	195	200	183	183
query84	285	116	105	105
query85	756	421	374	374
query86	292	240	232	232
query87	1984	2004	1796	1796
query88	3717	2768	2755	2755
query89	319	276	246	246
query90	1914	173	167	167
query91	163	159	133	133
query92	104	91	88	88
query93	1007	995	581	581
query94	562	312	285	285
query95	571	332	290	290
query96	683	497	241	241
query97	2438	2438	2343	2343
query98	161	151	149	149
query99	759	775	669	669
Total cold run time: 236310 ms
Total hot run time: 154111 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.10	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.11	0.09
query5	0.24	0.25	0.25
query6	1.18	0.71	0.69
query7	0.04	0.01	0.01
query8	0.05	0.03	0.04
query9	0.39	0.35	0.36
query10	0.58	0.57	0.60
query11	0.19	0.14	0.14
query12	0.18	0.14	0.14
query13	0.50	0.50	0.48
query14	1.02	1.00	1.02
query15	0.63	0.61	0.60
query16	0.36	0.34	0.36
query17	1.16	1.11	1.11
query18	0.21	0.19	0.20
query19	2.15	1.97	2.00
query20	0.02	0.02	0.01
query21	15.46	0.19	0.14
query22	4.80	0.06	0.05
query23	16.29	0.33	0.12
query24	1.10	0.21	0.17
query25	0.11	0.05	0.05
query26	0.74	0.22	0.16
query27	0.04	0.03	0.04
query28	3.64	0.86	0.37
query29	12.50	4.15	3.26
query30	0.28	0.13	0.10
query31	2.77	0.56	0.34
query32	3.22	0.61	0.50
query33	3.22	3.17	3.19
query34	15.55	4.02	3.43
query35	3.37	3.35	3.34
query36	0.56	0.43	0.42
query37	0.10	0.06	0.06
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.09	0.04	0.02
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 95.07 s
Total hot run time: 24.13 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (3/3) 🎉
Increment coverage report
Complete coverage report

@morningman morningman changed the title [improvement](catalog) Let connector plugins declare secret catalog properties to mask [fix](catalog) Mask connector catalog secrets and the ALTER CATALOG audit text Nov 6, 2026
@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 42 changed paths at b0bfd3c. One new P2 finding: eager security-surface discovery does not isolate nested metastore ServiceLoader failures, so one broken connector can prevent FE startup. No P0/P1 findings or existing blocking comments were confirmed.

Critical checkpoint conclusions:

Checkpoint Conclusion
Goal and proof Connector declarations reach SHOW CREATE CATALOG, SHOW CATALOG, catalogs(), and CREATE/ALTER audit/log masking. Unit and audit regression coverage was inspected; execution was outside this static review.
Scope and reuse Focused rendering change using existing annotations, the security surface, and NeedAuditEncryption; no connector property parsing added to generic engine paths.
Concurrency and locks Normal registration runs before catalog replay/request access. New prefix reads use copy-on-write snapshots and immutable rules; no new threads, blocking IO under metadata locks, or lock-order changes.
Lifecycle and static initialization Provider-owned loaders and normal package dependencies are consistent. The inline P2 covers uncaught ServiceConfigurationError during newly eager metastore initialization.
Configuration No new configuration or dynamic-update requirement.
Compatibility Connector API major 31.0 matches the resource, manifests and test; plugin surface baseline includes additions. Storage and FE/BE protocols are unchanged.
Thrift and protobuf No changes.
Parallel paths Reviewed exact aliases, metastore flavors, pass-through prefixes, all three catalog renderings, CREATE/ALTER audit, statement logging, forwarding and multi-statement dispatch. Legacy masking floor is preserved.
Conditional logic Required ALTER property spans follow from grammar. Case-insensitive prefix/suffix rules match the declared behavior; keytab properties contain paths.
Test coverage Positive/negative aliases, namespace matching, immutability, registration/isolation and persisted audit checks are present. The new exception fixture misses ServiceConfigurationError, as noted inline.
Changed expected results No result files changed; added audit assertions use known placeholders and check masking plus retained nonsecret values. No generated test result is claimed.
Observability Skip logs identify providers/plugins; the reported exception currently bypasses them. No additional metrics are needed for this startup/rendering change.
Transactions and persistence Catalog journaling, replay, failover and persisted credential values are unchanged; startup registration also applies masking to historical catalogs.
Data writes and atomicity Table writes, committed-data visibility, delete bitmaps and crash recovery are unaffected.
FE/BE variables None added.
Performance Exact-key lookup and a small startup-defined prefix scan remain outside row-processing hot paths; no material regression established.
Other concerns No further substantiated issue after the final recheck.

No additional user focus was supplied. Existing inline threads were empty and the finding was deduplicated across reviewers. The PR's disclosed limits for arbitrary SDK/re-keyed/fs.* options and secrets embedded in URLs remain outside its declared masking coverage. Review coverage is complete with no unresolved candidates. Review converged after two rounds.

Validation was static source, test, dependency and control-flow inspection only. No builds, tests, benchmarks, runtime plugin loading or source edits were performed.

Review converged after 2 round(s).

ConnectorSecuritySurface securitySurface;
try {
securitySurface = provider.securitySurface();
} catch (RuntimeException | LinkageError e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Catch ServiceConfigurationError during eager surface discovery

An otherwise valid connector directory with a stale metastore service descriptor, or a backend whose constructor fails, now prevents FE startup. Iceberg/Paimon/Hive securitySurface() calls MetaStoreProviders.sensitivePropertyKeys(), whose static initializer runs ServiceLoader; those lookup/instantiation failures throw ServiceConfigurationError, an Error outside both RuntimeException and LinkageError. It escapes this catch through Env.initConnectorPluginManager() before image loading, defeating the documented per-plugin skip behavior. Previously these nested backends were discovered during catalog validation/access rather than directory registration. Catch ServiceConfigurationError here and at the new builtin surface boundary, and cover a failing nested loader; the added IllegalStateException fixture does not exercise this case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ae2cebe. Confirmed against the code: the Hive, Iceberg and Paimon surfaces call MetaStoreProviders.sensitivePropertyKeys(), whose static initializer iterates a ServiceLoader over the plugin's jars. A descriptor naming a backend that cannot be loaded throws ServiceConfigurationError, an Error a static initializer rethrows unwrapped, so it escaped this RuntimeException | LinkageError catch and the builtin path's RuntimeException catch, and Env.initConnectorPluginManager() catches nothing: a stale jar in a connector's lib/ stopped FE at startup, where before this PR only that connector's catalogs failed. Both catches now include ServiceConfigurationError (the builtin one matches the construction catch above it), so the provider is skipped and logged like any other surface failure.

ConnectorPluginManagerTest#pluginWhoseSecuritySurfaceFailsInItsOwnServiceLoaderIsSkippedNotFatal (a plugin directory whose lib/ jar names a missing backend; the plugin next to it still loads) and #classpathProviderWhoseSecuritySurfaceFailsInItsOwnServiceLoaderIsSkippedNotFatal fail on b0bfd3c with that error and pass now; dropping it from either catch fails only that path's case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The mechanism is right, but it exists only on a broken test classpath, so I'm keeping the builtin catch as it is.

In production Hive, Iceberg and Paimon are never builtins: fe-core depends on them in test scope only, and FE loads them from plugins/connector/, one loader per plugin. MetaStoreProviders is not on FE's classpath (fe-core does not depend on fe-connector-metastore-spi), so each plugin defines its own copy, a failed static initializer cannot reach another provider, and the directory path's catch already includes LinkageError.

The two catches follow FileSystemPluginManager: its loadBuiltins catches RuntimeException around a provider's sensitivePropertyKeys(), and its directory path adds LinkageError. On the classpath, a descriptor naming a missing backend is a build defect, and a LinkageError there already stops startup elsewhere, for example from ServiceLoader's hasNext() when a provider class does not link. Here the first provider is skipped and logged, and the second stops startup with a NoClassDefFoundError naming the class whose initializer failed, which points at the defect.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17572	5202	5057	5057
q2	2120	304	245	245
q3	10267	1408	813	813
q4	4678	457	338	338
q5	7438	803	517	517
q6	187	189	159	159
q7	755	795	592	592
q8	9258	1367	1102	1102
q9	5542	4178	4165	4165
q10	6805	1298	1017	1017
q11	434	244	227	227
q12	630	398	273	273
q13	18128	3657	3069	3069
q14	275	276	241	241
q15	q16	727	718	668	668
q17	1204	759	586	586
q18	6974	6176	6100	6100
q19	1110	975	614	614
q20	402	340	221	221
q21	5473	2482	2399	2399
q22	382	320	274	274
Total cold run time: 100361 ms
Total hot run time: 28677 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5958	5920	6081	5920
q2	744	606	602	602
q3	5584	5830	5336	5336
q4	1999	2125	1541	1541
q5	5757	5793	5666	5666
q6	238	211	146	146
q7	2250	1977	1756	1756
q8	2956	2651	2721	2651
q9	7949	7488	7437	7437
q10	3611	3651	3116	3116
q11	570	404	384	384
q12	670	673	511	511
q13	3328	3569	3012	3012
q14	283	292	260	260
q15	q16	655	682	621	621
q17	7659	6993	6869	6869
q18	12983	12193	12937	12193
q19	958	838	821	821
q20	2127	2142	1906	1906
q21	5651	4576	4629	4576
q22	484	458	404	404
Total cold run time: 72414 ms
Total hot run time: 65728 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 153854 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 b0bfd3c1b10d83e6a4598af164544d695d8dc3ce, data reload: false

query5	4320	519	387	387
query6	430	223	197	197
query7	4811	427	232	232
query8	315	160	148	148
query9	8790	3187	3183	3183
query10	465	312	260	260
query11	6056	3883	3568	3568
query12	152	94	89	89
query13	1262	436	326	326
query14	6139	3918	3756	3756
query14_1	3412	3425	3425	3425
query15	206	199	181	181
query16	916	432	391	391
query17	851	652	527	527
query18	2414	414	304	304
query19	191	168	137	137
query20	84	83	82	82
query21	210	129	105	105
query22	12960	12927	12820	12820
query23	13540	13010	12467	12467
query23_1	12601	12711	12523	12523
query24	7351	831	479	479
query24_1	496	491	480	480
query25	528	426	362	362
query26	1258	261	140	140
query27	2762	437	278	278
query28	4624	2044	2047	2044
query29	1586	597	475	475
query30	294	220	181	181
query31	1023	925	819	819
query32	143	94	90	90
query33	529	304	234	234
query34	928	855	506	506
query35	729	754	654	654
query36	820	800	750	750
query37	129	95	88	88
query38	1763	1739	1639	1639
query39	801	793	743	743
query39_1	729	722	743	722
query40	228	119	98	98
query41	71	68	68	68
query42	89	91	86	86
query43	341	359	315	315
query44	1321	708	713	708
query45	183	184	163	163
query46	845	964	566	566
query47	2638	2933	2840	2840
query48	338	313	225	225
query49	575	400	296	296
query50	681	274	211	211
query51	10791	10405	10645	10405
query52	83	80	69	69
query53	186	212	156	156
query54	224	215	189	189
query55	77	64	62	62
query56	236	203	227	203
query57	1656	1626	1587	1587
query58	289	268	262	262
query59	2154	2219	2033	2033
query60	276	250	217	217
query61	150	146	147	146
query62	390	340	282	282
query63	184	162	166	162
query64	2738	962	761	761
query65	3326	3250	3279	3250
query66	1766	420	291	291
query67	22730	22538	22446	22446
query68	3092	1002	616	616
query69	417	292	261	261
query70	836	770	774	770
query71	308	243	212	212
query72	2800	2584	2274	2274
query73	520	525	295	295
query74	4617	4500	4317	4317
query75	2338	2293	1942	1942
query76	2340	1006	606	606
query77	355	374	270	270
query78	10020	9629	9132	9132
query79	974	843	529	529
query80	1107	421	332	332
query81	582	319	263	263
query82	588	138	113	113
query83	313	199	193	193
query84	304	123	101	101
query85	854	416	377	377
query86	379	240	227	227
query87	2018	1969	1873	1873
query88	3788	2783	2776	2776
query89	323	285	242	242
query90	1930	171	167	167
query91	166	150	124	124
query92	88	92	88	88
query93	1005	991	577	577
query94	564	284	267	267
query95	566	319	301	301
query96	690	490	247	247
query97	2497	2429	2333	2333
query98	160	147	153	147
query99	767	764	673	673
Total cold run time: 238098 ms
Total hot run time: 153854 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.26	0.08	0.08
query4	1.62	0.09	0.10
query5	0.23	0.24	0.24
query6	1.17	0.69	0.67
query7	0.04	0.01	0.00
query8	0.05	0.03	0.04
query9	0.39	0.34	0.31
query10	0.61	0.57	0.57
query11	0.20	0.14	0.14
query12	0.17	0.15	0.15
query13	0.49	0.48	0.48
query14	1.03	1.01	1.00
query15	0.62	0.62	0.61
query16	0.34	0.33	0.34
query17	1.14	1.10	1.12
query18	0.22	0.17	0.17
query19	2.08	2.00	1.93
query20	0.02	0.02	0.01
query21	15.42	0.18	0.13
query22	4.89	0.06	0.05
query23	16.29	0.32	0.13
query24	1.12	0.25	0.16
query25	0.10	0.05	0.03
query26	0.73	0.20	0.15
query27	0.04	0.03	0.03
query28	3.75	0.81	0.35
query29	12.50	4.19	3.24
query30	0.28	0.13	0.10
query31	2.77	0.54	0.32
query32	3.22	0.59	0.50
query33	3.18	3.20	3.18
query34	15.43	4.00	3.37
query35	3.34	3.32	3.33
query36	0.57	0.43	0.42
query37	0.10	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.03	0.04
query40	0.18	0.15	0.14
query41	0.09	0.03	0.03
query42	0.03	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 94.93 s
Total hot run time: 23.8 s

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 43 changed paths at ae2cebe. One new P1 finding: the newly enabled ALTER CATALOG masking uses code-point token positions as UTF-16 substring offsets and leaves plaintext credential suffixes in audit and FE statement logs. This prevents the intended complete masking fix for accepted supplementary-Unicode SQL.

The inspected flow is:

provider -> securitySurface -> startup masking union -> SHOW CREATE / SHOW CATALOG / catalogs()
ALTER CATALOG -> NeedAuditEncryption -> property spans -> rewriteSql -> audit / FE logs

Critical checkpoint conclusions:

Checkpoint Conclusion
Goal and proof Connector-declared secrets reach the three catalog renderings and CREATE/ALTER logging. The inline P1 identifies the Unicode gap in the new ALTER path. Added unit and audit regression cases cover ASCII behavior; no execution is claimed.
Scope, clarity and reuse Focused masking change reusing property annotations, the existing security surface and NeedAuditEncryption. Generic engine paths gain no connector-specific property parsing.
Concurrency and locks Production registration occurs before image/replay/catalog access. Prefix rules use copy-on-write snapshots and immutable descriptors. No new thread, metadata-lock IO, nested lock order or supported production read/write race was identified.
Lifecycle and static initialization Metastore discovery explicitly uses the defining plugin loader. Directory failures discard/close handles before routing publication; providers and masking descriptors otherwise live for FE lifetime. Both startup ServiceConfigurationError boundaries now catch the failure reported in the existing thread.
Configuration and dynamic updates No new configuration or dynamic-update requirement.
Compatibility and rolling upgrades SPI major and test pin both move from 30.0 to 31.0; the plugin API baseline records the additions. Legacy masking floor is retained. No durable format or FE/BE protocol changes.
Thrift and protobuf No changes.
Parallel paths Checked aliases, metastore flavors, pass-through prefixes, all three catalog renderings, CREATE/ALTER audit, FE statement logging, forwarding and multi-statement dispatch. Shared rewrite index units cause the inline finding.
Conditional logic ALTER property lists are mandatory in the grammar. Namespace matching is case-insensitive and checks only the suffix after the declared prefix. Keytab annotations removed here name paths; keytab-content masking remains.
Test coverage Inspected positive/negative aliases, prefix boundaries, immutability, admitted/refused providers, ADBC discovery isolation, actual nested ServiceLoader failure fixtures and persisted audit assertions. Supplementary Unicode values/comments are missing.
Changed expected results No golden result files changed. Added assertions match ASCII masking and retained nonsecret values; they do not establish Unicode correctness. Result generation and author-reported test runs were not verified by execution.
Observability Skip logs identify provider/plugin failures. The Unicode leak is a successful string rewrite, so existing exception fallback cannot detect it. No additional metric is needed for this startup/rendering change.
Transactions and persistence Catalog journaling/replay/failover and stored credentials are unchanged. Startup registration applies masks to historical catalogs.
Data writes and atomicity Table writes, committed-data visibility, version consistency, delete bitmaps and crash recovery are unaffected. No BE allocation/ownership change.
FE/BE variables None added.
Performance Small startup-defined prefix scans and exact-key lookups run in rendering paths; no new IO or row-processing hot-path work. No material performance defect substantiated.
Other concerns No further substantiated issue after full-scope and missed-case rechecks.

Existing thread 4492689479 is independently confirmed addressed at this head: both relevant catches include ServiceConfigurationError, and the new classpath/directory fixtures exercise a missing nested backend. It is not duplicated. No existing P0/P1 comments remain to carry forward. No additional user review focus was supplied.

The PR's disclosed limits for arbitrary raw/re-keyed SDK options, fs.* options and secrets embedded in URLs remain outside its declared masking coverage. Static review coverage is complete with no unresolved candidates or risk questions. Review converged after two rounds.

Validation was static source, test, dependency and control-flow inspection, with a standalone character-index calculation for the inline example. No Doris builds/tests, benchmarks, runtime plugin loading, submodule initialization or source edits were performed.

Review converged after 2 round(s).

public LogicalPlan visitAlterCatalogProperties(DorisParser.AlterCatalogPropertiesContext ctx) {
DorisParser.PropertyItemListContext properties = ctx.propertyItemList();
encryptProperty(visitPropertyItemList(properties), properties.start.getStartIndex(),
properties.stop.getStopIndex());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Convert code-point spans before slicing the original SQL

The new ALTER masking path passes ANTLR offsets directly to BaseViewInfo.rewriteSql, which slices a Java String using UTF-16 offsets. CaseInsensitiveStream.fromString uses a code-point stream whenever the SQL contains a supplementary character, so the replacement ends early and copies part of the original credential back into the result. For example, ALTER CATALOG ctl SET PROPERTIES("password"="😀😀😀😀😀😀😀secret") produces ALTER CATALOG ctl SET PROPERTIES("password" = "*XXX"secret"): the entire ASCII suffix remains in the audit and FE statement logs, without an exception to trigger their fallback. Supplementary characters in an earlier SQL comment can expose an otherwise ASCII password too. Convert both token boundaries to UTF-16 positions (including the exclusive end) before rewriting, and cover Unicode values/comments in the masking tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, confirmed. This is a defect the engine already had, not one this PR introduces: when a statement contains a supplementary character, the parser's token positions count code points, while BaseViewInfo.rewriteSql cuts the Java string by UTF-16 offsets. Every masking visitor in LogicalPlanBuilderForEncryption shares it (CREATE CATALOG, repositories, SET PASSWORD and the rest), and so does the rewriting of view and MTMV definitions; the ALTER CATALOG masking added here goes through the same rewriteSql.

It is fixed separately in #70366, which converts the positions at all five places that cut the original SQL and adds cases with emoji in values, in comments before the masked span, and across several replacements in one statement. Once that is merged, the ALTER CATALOG path in this PR gets the fix without a change here.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17586	5123	5310	5123
q2	2072	290	242	242
q3	10287	1365	814	814
q4	4678	465	336	336
q5	7438	785	519	519
q6	183	180	150	150
q7	728	778	594	594
q8	9241	1325	1063	1063
q9	5546	4163	4195	4163
q10	6814	1293	999	999
q11	418	242	219	219
q12	637	394	277	277
q13	18083	3552	2956	2956
q14	278	274	240	240
q15	q16	703	702	661	661
q17	1188	758	568	568
q18	6982	6139	6109	6109
q19	1105	950	587	587
q20	384	336	221	221
q21	5391	2207	2270	2207
q22	342	292	250	250
Total cold run time: 100084 ms
Total hot run time: 28298 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5593	5670	5608	5608
q2	703	565	532	532
q3	5218	5405	4955	4955
q4	1991	2146	1521	1521
q5	5255	5169	5568	5169
q6	251	202	155	155
q7	2281	2060	1906	1906
q8	3110	2741	2647	2647
q9	8049	8001	7951	7951
q10	3692	3894	3212	3212
q11	630	446	401	401
q12	716	693	536	536
q13	3498	3824	3334	3334
q14	319	311	295	295
q15	q16	706	702	646	646
q17	8333	7091	6853	6853
q18	12999	12149	12839	12149
q19	896	794	804	794
q20	2139	2122	1935	1935
q21	5621	4559	4666	4559
q22	506	434	405	405
Total cold run time: 72506 ms
Total hot run time: 65563 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 153663 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 ae2cebe750f695b3a64abf1893c65982a67cf29f, data reload: false

query5	4305	516	400	400
query6	422	203	189	189
query7	4803	430	238	238
query8	313	163	147	147
query9	8774	3212	3207	3207
query10	483	313	269	269
query11	6037	3853	3532	3532
query12	150	93	89	89
query13	1262	459	348	348
query14	6122	3950	3657	3657
query14_1	3410	3394	3395	3394
query15	204	202	186	186
query16	941	438	413	413
query17	864	657	570	570
query18	2423	436	293	293
query19	192	158	122	122
query20	83	83	78	78
query21	207	122	102	102
query22	12884	12884	12739	12739
query23	13412	12827	12467	12467
query23_1	12549	12430	12531	12430
query24	7362	804	474	474
query24_1	474	471	477	471
query25	508	387	333	333
query26	1260	250	133	133
query27	2770	437	268	268
query28	4645	2068	2051	2051
query29	1549	576	443	443
query30	289	217	179	179
query31	1016	924	802	802
query32	144	88	86	86
query33	508	296	220	220
query34	870	839	489	489
query35	724	748	636	636
query36	819	852	742	742
query37	120	91	99	91
query38	1766	1700	1662	1662
query39	781	778	727	727
query39_1	725	729	743	729
query40	214	112	94	94
query41	65	63	59	59
query42	87	82	80	80
query43	338	357	315	315
query44	1303	701	706	701
query45	178	177	162	162
query46	837	977	568	568
query47	3018	2926	2577	2577
query48	317	318	235	235
query49	582	407	306	306
query50	697	278	216	216
query51	10806	10732	10479	10479
query52	79	84	70	70
query53	195	210	153	153
query54	240	246	197	197
query55	69	71	68	68
query56	242	202	214	202
query57	1648	1647	1559	1559
query58	281	277	257	257
query59	2098	2143	2008	2008
query60	287	240	204	204
query61	149	144	144	144
query62	382	329	279	279
query63	187	156	159	156
query64	2722	902	764	764
query65	3310	3271	3229	3229
query66	1765	428	290	290
query67	22618	22841	22700	22700
query68	2945	1017	628	628
query69	383	289	250	250
query70	863	759	779	759
query71	304	233	215	215
query72	2657	2686	2438	2438
query73	524	536	291	291
query74	4597	4528	4345	4345
query75	2349	2265	1901	1901
query76	2327	1012	600	600
query77	353	381	282	282
query78	9756	9650	9205	9205
query79	1011	864	541	541
query80	754	448	365	365
query81	554	307	264	264
query82	585	144	120	120
query83	301	215	189	189
query84	321	127	105	105
query85	939	440	366	366
query86	388	241	226	226
query87	1988	1943	1818	1818
query88	3727	2776	2790	2776
query89	333	284	243	243
query90	1897	167	164	164
query91	160	149	124	124
query92	99	92	87	87
query93	1006	1007	580	580
query94	543	303	291	291
query95	559	386	305	305
query96	703	490	237	237
query97	2485	2445	2342	2342
query98	165	154	147	147
query99	768	767	653	653
Total cold run time: 236925 ms
Total hot run time: 153663 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.04	0.05
query3	0.26	0.09	0.08
query4	1.60	0.10	0.10
query5	0.25	0.23	0.24
query6	1.16	0.68	0.68
query7	0.04	0.01	0.00
query8	0.06	0.03	0.03
query9	0.40	0.35	0.35
query10	0.56	0.58	0.63
query11	0.19	0.14	0.14
query12	0.18	0.14	0.14
query13	0.50	0.49	0.48
query14	1.02	1.00	1.01
query15	0.61	0.59	0.60
query16	0.34	0.34	0.34
query17	1.16	1.16	1.16
query18	0.21	0.17	0.18
query19	2.13	2.04	2.02
query20	0.02	0.01	0.01
query21	15.41	0.20	0.13
query22	4.83	0.05	0.05
query23	16.30	0.30	0.12
query24	1.07	0.23	0.19
query25	0.10	0.04	0.04
query26	0.84	0.21	0.16
query27	0.04	0.03	0.03
query28	3.73	0.78	0.35
query29	12.53	4.16	3.23
query30	0.28	0.12	0.10
query31	2.77	0.55	0.32
query32	3.23	0.59	0.51
query33	3.28	3.24	3.26
query34	15.32	3.99	3.40
query35	3.34	3.30	3.31
query36	0.54	0.43	0.42
query37	0.10	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.15	0.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 94.92 s
Total hot run time: 24.08 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 94.44% (34/36) 🎉
Increment coverage report
Complete coverage report

…n its own ServiceLoader

### Background

FE reads every connector provider's security surface at startup, before it publishes the provider, and skips a provider whose surface throws, so that one broken plugin directory does not stop FE. The Hive, Iceberg and Paimon providers build theirs from their metastore backends' secret keys, which `MetaStoreProviders` collects in a static initializer that runs a `ServiceLoader` over the backends the plugin's jars register.

### What problem does this PR solve?

Issue Number: None
Related PR: None
PR Type: Bugfix

Problem Summary:

A `ServiceLoader` that cannot load a backend its descriptors name throws `ServiceConfigurationError`, an `Error` that is neither a `RuntimeException` nor a `LinkageError`, and a static initializer rethrows an `Error` as it is. The plugin directory path caught only those two and the classpath path only `RuntimeException`, so a descriptor naming a backend that is not there, such as one in a jar an earlier release left in a connector's `lib/`, stopped FE at startup; before the previous commit, which reads the surfaces at startup, it failed only that connector's catalogs. Both paths now skip the provider on a `ServiceConfigurationError` as well, and the plugins next to it still load.

### Release note

None

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morningman
morningman force-pushed the b2m-t38c-connector-sensitive-keys branch from b1fcc69 to 9abe6cc Compare November 16, 2026 13:23
@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review setup stopped before context preparation ran; inspect the first failed or cancelled setup step.
Workflow run: https://github.com/apache/doris/actions/runs/43875540650

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

…udit text

### Background

SHOW CREATE CATALOG, SHOW CATALOG, the `catalogs()` table function and the audit text of CREATE CATALOG replace a property value with `*XXX` when `DatasourcePrintableMap.isSensitiveKey` matches its key. Until now the keys came from a list in fe-core and from the keys filesystem plugins report at startup. A connector plugin marks its secret properties `sensitive = true`, but that mark only masks the connector's own log lines. A connector tells the engine about its security-relevant properties through `ConnectorProvider#securitySurface()`.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#69588 (added the connector security surface this extends), apache#45164 (introduced the unmasked ALTER CATALOG audit text), apache#27115 (masked it for the statement apache#45164 replaced), apache#59502 (added `iceberg.jdbc.password`), apache#54523 (added the Paimon REST DLF keys), apache#65730 (branch-4.1's Lance catalog, whose REST secrets the Lance port will declare on this surface), apache#70366 (fixed the shared Unicode SQL rewrite used by this PR's ALTER masking), apache#70327 (added MongoDB credentials to the engine masking floor)
PR Type: Bugfix

Problem Summary:

Catalog secrets that only a connector knows are on no masking list, so SHOW CREATE CATALOG and the other renderings print them in clear: `iceberg.jdbc.password`, `paimon.jdbc.password`, the Paimon REST DLF key pair, `mc.access_key`, and credentials passed through under `trino.` or `adbc.`. Separately, `ALTER CATALOG ... SET PROPERTIES` is written to the audit log unmasked, whatever the key. Each connector now declares its secrets on its security surface, taken from its `sensitive` marks, and the surface can also declare a namespace of secret keys for options passed through unread; Fluss's lake options were hard-coded in fe-core for that reason. The engine masks the union, with fe-core's own list kept as the floor. ALTER CATALOG is masked like CREATE CATALOG.

### Details

- **Change map:** 45 files, +1205 −81 over four commits: production code +384 −51, tests +807 −26, the connector README +13 −3, the plugin API version in `fe/fe-connector/pom.xml` (31.0 to 32.0). The first commit adds secret keys to the surface (reviewed alone before). The second does the rest, the third keeps a surface that fails in the connector's own `ServiceLoader` from stopping FE, and the fourth aligns the newly added MongoDB provider and tests ALTER masking with supplementary characters:
  1. Key namespaces on the SPI: `withSensitiveKeyPrefix` and `SensitiveKeyPrefix.covers`, which holds the matching rule; a collection form of `withSensitiveKeys` (`ConnectorSecuritySurface`).
  2. Engine: `isSensitiveKey` matches registered namespaces, the Fluss rule becomes one of them; `ConnectorPluginManager` registers them and reads every surface before it publishes a provider, skipping a provider whose surface throws.
  3. Connectors: every provider declares its secrets; `MetaStoreProviders.sensitivePropertyKeys()` gives the union of a plugin's metastore backends; `IcebergJdbcMetaStoreProvider` reports its keys like its siblings; the keytab paths lose their `sensitive` mark. MongoDB also declares its two annotated secrets, preserving its SSRF endpoint and the engine fallback.
  4. ALTER CATALOG audit masking (+16).
- **Frequency:** Always. Create or alter a catalog that sets one of the keys above, then run SHOW CREATE CATALOG, SHOW CATALOG `<name>` or `select * from catalogs()`, or read the audit log after an ALTER CATALOG ... SET PROPERTIES.
- **Root cause:** `isSensitiveKey` consulted only fe-core's list and the filesystem providers' keys. A connector's `sensitive` marks fed only `toMaskedString`; `MetaStoreProvider.sensitivePropertyKeys()` existed for this, but nothing called it, and the Iceberg JDBC backend did not implement it. For ALTER CATALOG, `AlterCatalogPropertiesCommand` does not implement `NeedAuditEncryption` and `LogicalPlanBuilderForEncryption` has no `visitAlterCatalogProperties`, so `AuditLogHelper` records the original text; the statement it replaced in apache#45164 was masked by apache#27115.
- **Why existing tests missed it:** Unit tests: `DatasourcePrintableMapTest` checks fe-core's own keys, the provider surface tests checked only the SSRF and driver_url keys, and `EncryptSQLTest` and `RepositoryAuditEncryptionTest` cover CREATE CATALOG, repositories and resources but not ALTER CATALOG. Regression: `audit/test_external_catalog_credential_masking` creates only Iceberg REST catalogs, whose keys are on fe-core's list, and never alters one.
- **Fix:** The engine must not name a connector's properties, so the connectors declare their secrets, from the same `sensitive` marks that mask their logs; jdbc and es declare both spellings their legacy prefix allows, and trino and adbc declare the namespace they pass through, a key there being a secret when its rest names `key`, `secret`, `password`, `token` or `credential` (also `authorization` for ADBC). fe-core keeps the connector keys it lists, so a catalog whose plugin is not loaded masks what it masked before. A provider whose `securitySurface()` throws at startup is skipped, as a filesystem provider is, instead of stopping FE; that includes the `ServiceConfigurationError` a `ServiceLoader` throws when a descriptor names a backend it cannot load, which is how the Hive, Iceberg and Paimon surfaces fail, since they read their metastore backends' keys through one.
- **Other paths and branches:** Fixed here: every rendering above and FE's statement logging, which share `isSensitiveKey` and `NeedAuditEncryption`. Not covered, since a key name cannot express them safely: raw Iceberg SDK keys copied through (`token`, `credential`), Paimon options re-keyed from `paimon.*`, Hadoop `fs.*` keys, and secrets inside otherwise unmarked URLs. The ALTER CATALOG gap is on branch-4.0, 4.1 and 4.2 (from apache#45164); branch-3.1 still uses the masked statement. branch-4.1 and 4.2 also print the connector keys above in clear; without the connector SPI their fix differs and is tracked separately.
- **Behavior change:** The namespaces also mask non-secrets whose names carry those words, such as `trino.hive.s3.aws-access-key` or a keystore path. Keytab paths, which no release masks, are no longer masked in connector log lines: marked `sensitive`, `hadoop.kerberos.keytab` would be masked in every storage vault and resource.

### Testing

The original local runs (macOS) used master `f5c993f2c94` plus this change:

- Regression `audit/test_external_catalog_credential_masking`, extended with an Iceberg JDBC catalog: SHOW CREATE CATALOG masks `iceberg.jdbc.password`, and the audit texts of its CREATE CATALOG and of an ALTER CATALOG that sets the password and `s3.secret_key` hold only `*XXX`. Against the local cluster's FE without this change it fails at the first new check, SHOW CREATE CATALOG printing the password; with a FE built from this change it passes.
- fe-connector-spi: all 160 tests, with the refreshed surface baseline (+4 lines); the metastore modules: all tests; ten connector modules: 29 classes, 511 tests, including each connector's surface test, which checks real key names.
- fe-core: 26 classes, 341 tests, including `ConnectorPluginManagerTest`, `DatasourcePrintableMapTest`, `EncryptSQLTest` and the audit and plugin gate tests; 14 of them again after the last change to registration, and 7 classes, 76 tests, after the third commit. Its two new `ConnectorPluginManagerTest` cases, a plugin directory whose `lib/` holds a jar with a service descriptor naming a missing metastore-style backend (the plugin next to it must still load) and the same descriptor on the classpath, fail without the third commit with that `ServiceConfigurationError` escaping `loadPlugins` and `loadBuiltins`, and pass with it.
- Twenty-two mutations, each caught by its test: for example, reverting either half of the ALTER CATALOG fix (`EncryptSQLTest` sees the statement in clear), matching a marker anywhere in the key, an empty metastore union, re-marking a keytab, or dropping `ServiceConfigurationError` from either startup catch (each fails only its own new case).

Rebased onto master `93c16ee2ca1` on 2026-11-16. Post-rebase local verification:

- `bash run-fe-ut.sh --run 'org.apache.doris.connector.spi.*Test,ConnectorPluginManagerTest,DatasourcePrintableMapTest,EncryptSQLTest'`, with `CUSTOM_MVN` appending `-Dcheckstyle.skip=false`: BUILD SUCCESS across all 90 reactor modules; all 141 selected tests passed across 22 classes, including the inherited supplementary-character audit cases. Checkstyle reported no violations.
- `git diff --check upstream-apache/master...HEAD`: passed. `git range-diff` confirms the replayed patches are unchanged apart from adapting the connector API version and its test to 32.0.
- Regression tests and a complete BE/FE build were not rerun locally after this rebase; `run buildall` is requested in CI.

Follow-up local verification on the rebased branch plus the MongoDB declaration and audit tests (2026-11-16):

- `run-fe-ut.sh --run 'org.apache.doris.connector.spi.*Test,org.apache.doris.connector.mongodb.*Test,ConnectorPluginManagerTest,DatasourcePrintableMapTest,EncryptSQLTest'`, with Checkstyle enabled: all 176 selected tests in 28 classes passed (SPI 93, MongoDB 35, fe-core 48), with no skipped tests; the 90-module reactor completed successfully.
- The strengthened `MongoProviderTest` fails without the provider declaration (expected the two MongoDB secret keys, received an empty set), and passes with it. A separate targeted revert confirms the assertion catches the missing declaration.
- The new ALTER CATALOG assertions cover supplementary characters within a secret, in a preceding SQL comment, and in a retained non-secret value, with two masked properties. `EncryptSQLTest#testEncryption` passes on the candidate and fails at the new ALTER assertion when only `BaseViewInfo.rewriteSql` is restored to its pre-apache#70366 implementation: the audit text has an extra trailing fragment.
- Full cluster regression and a standalone FE/BE build were not rerun for this follow-up.

### Notes for Reviewers

- `SensitiveKeyPrefix.covers` lives on the SPI so that a connector's test can check its declaration against real key names and the engine applies the same rule; the Fluss floor in fe-core uses it too.
- The entries both fe-core and a connector declare are deliberate: the floor is frozen, as the comment in `DatasourcePrintableMap` says. MongoDB was already masked by apache#70327; its added declaration makes the provider follow the same contract as the other connectors.
- The connector plugin API advances from 31.0 to 32.0 for the added security-surface methods. Third-party connector plugins built against 31.x must be rebuilt; the in-tree plugins are built with FE. Hudi declares nothing: it owns no catalog properties.
- The base includes apache#70366, so ALTER CATALOG masking uses the shared rewrite that converts parser code-point spans to Java string offsets, including supplementary characters.

### Release note

SHOW CREATE CATALOG, SHOW CATALOG, the `catalogs()` table function and the audit log now mask `iceberg.jdbc.password`, `paimon.jdbc.password`, `paimon.rest.dlf.access-key-id`, `paimon.rest.dlf.access-key-secret`, `mc.access_key`, and the `trino.*` and `adbc.*` properties whose names carry `key`, `secret`, `password`, `token` or `credential` (`authorization` too for `adbc.*`). ALTER CATALOG ... SET PROPERTIES statements are masked in the audit log like CREATE CATALOG. Third-party connector plugins built against API 31.x must be rebuilt for 32.0.

### Check List (For Author)

- Behavior changed: Yes (see Details)
- Does this need documentation: No
- Pre-submission status: Ready

### AI Disclosure

- Tool: Claude Code (Claude Opus 5.5); OpenAI Codex
- Generated: Claude Code wrote the original code, tests, and description. Codex rebased the commits, adapted the connector API version and its test, added the MongoDB declaration and ALTER CATALOG supplementary-character tests, and updated this description.
- Human review: not stated
- Prompts: The author requested a generic connector surface, prefix rules, declarations for every connector, and masking of their union with the engine floor. They removed sensitive marks from keytab paths, added ALTER CATALOG masking, and fixed startup failure from a connector's ServiceLoader. After review, they chose a separate shared Unicode fix, then requested MongoDB alignment and supplementary-character audit coverage here.
@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Review setup stopped before context preparation ran; inspect the first failed or cancelled setup step.
Workflow run: https://github.com/apache/doris/actions/runs/43880814316

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@morningman

Copy link
Copy Markdown
Contributor Author

Local pipeline review — ✅ PASS

schema: doris-repo-review/v1
status: PASS
pr: apache/doris#70338
commit: ab5d64aa529cf5d0a102cb2dfd56e2feba0fe592
base: 5e85976d4c58d5528cb49d3ef677d5e695c2a36d
reviewed_at: 2026-11-17T10:58+08:00
reviewer: morningman
model: gpt-6.1-sol
effort: xhigh
findings: {blocker: 0, major: 0, minor: 1, nit: 0}
rounds: 1
converged: true

Notes for maintainers

  • F-01 (Minor, test-coverage; Regression: no) fe/fe-connector/fe-connector-spi/src/main/java/org/apache/doris/connector/spi/ConnectorSecuritySurface.java:173-179: add the public SensitiveKeyPrefix type to the frozen plugin API inventory so prefix(), markers() and covers(String) are checked. Current masking behavior and the API 32.0 bump are intact.
  • Review covered all 45 changed files and converged in round 1; builds and tests were not run during this read-only review.

Reviewed locally with the doris-repo-review pipeline. Repository policy may accept this receipt for the matching commit; it is not a human Apache approval.

@924060929 924060929 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the FE changes and the related startup, catalog rendering, and audit SQL masking paths. No additional blocking issues found. No local builds or tests were run during this review. Compile, FE UT, P0, external, and nonconcurrent CI checks passed; the performance check is failing and its cause has not been verified.

@morningman
morningman merged commit 0744a64 into apache:master Nov 17, 2026
36 of 38 checks passed
OIiveirra added a commit to OIiveirra/doris that referenced this pull request Nov 17, 2026
### Background

The spatial PR extends the connector SPI. Upstream master independently added secret-property declarations to that SPI and advanced the connector API to the same major.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#69032, apache#70338 (upstream connector API change)
PR Type: Build/CI/Chore

Problem Summary:

Merge master 9b5352b into the spatial branch while retaining both SPI surfaces. Resolve the API-32 version collision by advancing the merged spatial contract to API 33 and checking that pre-spatial API-32 plugins are rejected.

### Details

- **Change map:** Merge upstream master; manually reconcile only the connector parent POM, its recorded-surface version test, and the engine plugin-version wiring test. Other changes retain the upstream merge result.
- **Affected:** Connector plugin API version declaration and its two version tests.
- **Developer and release impact:** In-tree connectors share API 33; third-party connector plugins need the spatial API contract. Preserve both the spatial and upstream secret-property surface baselines.
- **License and third-party:** No additional dependency or license change beyond the upstream merge.
- **Rollback:** Revert this merge while retaining its first parent if necessary.

### Testing

- The personal standard FE UT wrapper passed all 291 tests in 39 classes: the complete connector SPI suite, IcebergWritePlanProviderTest and PluginApiVersionWiringTest; zero failures, errors or skips.
- The personal standard BE UT wrapper compiled the merged ASAN sources and passed all 292 tests in eight Iceberg, table-reader and cache suites; zero failures or skips. Local UT GLIBC_COMPATIBILITY=OFF; task-owned dependency adapter restored.
- The initial BE run had three fixture-setup failures from inaccessible shared temporary directories. The same selection passed with a private TMPDIR, without source changes or changing those directories.
- Clang-format16 checked 5145 files; build hygiene and full FE reactor CheckStyle passed. Code whitespace checks passed; generated regression golden formatting was preserved.
- Complete product rebuild, SQL regression, full unit-test matrix and a new full PR review were not run for this merge.

### Release note

None.

### Check List (For Author)

- Behavior changed: Yes, connector API advances to 33 to distinguish the merged spatial contract from upstream API 32.
- Does this need documentation: No
- Pre-submission status: Partially verified: targeted merge checks passed; complete community CI remains separate.

### AI Disclosure

- Tool: OpenAI Codex (GPT-6).
- Generated: The merge conflict resolution, API-version test adjustments and this message.
- Human review: Pending author review.
Owen-CH-Leung added a commit to qube-rt/apache-doris that referenced this pull request Nov 17, 2026
…VARBINARY_COLUMN

### What problem does this PR solve?

Issue Number: None
Related PR: apache#70338 (bumped the major to 32.0 for the catalog secret surface)
PR Type: Build/CI/Chore

Problem Summary: apache#70338 landed after this branch was written and also took the
plugin API major from 31.0 to 32.0, for its own SPI change. Rebasing left
SUPPORTS_VARBINARY_COLUMN sharing that major, and the merge conflict was in
ConnectorPluginSurfaceTest. fe/fe-connector/pom.xml says every SPI surface
change gets its own major, so this moves it to 33.0. It supersedes the
"31.0 to 32.0" in the previous commit's description.

### Details

- **Affected:** connector.plugin.api.version in fe/fe-connector/pom.xml and the
  matching assertion and comment in ConnectorPluginSurfaceTest.
- **Developer and release impact:** connector plugins built against API 32.x
  need a rebuild.
- **License and third-party:** None
- **Rollback:** revert with the previous commit.

### Testing

ConnectorPluginSurfaceTest passes locally in the apache/doris build-env
container.

### Release note

None

### Check List (For Author)

- Behavior changed: No
- Does this need documentation: No
- Pre-submission status: Ready

### AI Disclosure

- Tool: Claude Code (Claude Opus)
- Generated: this commit and its description
- Human review: pending
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Nov 18, 2026
### Background

External catalogs retain connection properties for connector use. 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)
PR Type: Bugfix

Problem Summary:

Name-only matching exposes credentials in JDBC strings, URL components, SDK/Hadoop properties and custom names. Apply one value-aware display policy plus a dynamic FE-local name regex, without disabling permanent rules. The diff includes shared output routing, regex validation, diagnostic masking and tests.

One exercised `uri` value illustrates the difference:

| 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: +232/-18; tests: +445/-22; no generated output, docs, build files, or submodule pins. Most added lines are tests. The production parts are the shared name/value policy and output routing (about 200 added lines), validated dynamic configuration (about 20), and provider declarations/diagnostic masking (about 10).
- **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` and catalog metadata checked registered names without inspecting values. MaxCompute session tokens, Ozone access keys, and JDBC diagnostic URLs were also missing sensitive declarations.
- **Why existing tests missed it:** `DatasourcePrintableMapTest` and `test_external_catalog_credential_masking` covered enumerated keys, missing URL, Hadoop and generic-name cases. Existing Ozone/prefix visibility assertions are updated.
- **Fix:** Route catalog SHOW/TVF, audit properties and lineage through the same policy; retain provider metadata and protect typed JDBC diagnostics.
- **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, unsupported multi-host URL formats, 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. No raw-value or parser-exception fallback is logged. |

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 Ozone access keys and JDBC URLs render as `***` in their typed diagnostic strings. 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.
- `run-fe-ut.sh` passes all 94 tests in 10 selected classes locally, including `DatasourcePropertyMaskingTest`, `LineageCatalogPropertyMaskingTest`, and `ConfigTest`. Coverage includes encoded/duplicate/signed URLs, 5,001-host lists, dynamic rules, provider diagnostics, and unchanged connection values.
- 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.

### Notes for Reviewers

A shared `uri` alias requires value-aware handling to preserve REST endpoints. Arbitrary free-text secrets, SDK containers and unrelated logging are outside scope. Matching can conservatively hide keyword-bearing metadata and KMS IDs.

### 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 suite not executed locally.

### AI Disclosure

- Tool: Codex (GPT-6).
- Generated: Production changes, tests, and this description.
- Human review: not stated.
- Prompts: First mask MaxCompute session tokens and Ozone access keys, then extend the same PR to JDBC strings, URL credentials, native SDK/Hadoop properties, and configurable name rules.
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)
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: +274/-26; tests: +649/-50; no generated output, docs, build files, or submodule pins. Most added lines are tests. Production parts are shared name/value policy and output routing (about 210 added lines), validated dynamic configuration (about 20), 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` and catalog metadata checked registered names without inspecting values. Credential declarations were incomplete; URI parsing also treated later endpoints in URL lists as ordinary path text.
- **Why existing tests missed it:** `DatasourcePrintableMapTest` and `test_external_catalog_credential_masking` covered enumerated keys, missing URL, Hadoop and generic-name cases. Existing access-key/Ozone/prefix visibility assertions are updated; metastore URI diagnostics and multi-URL paths lacked coverage.
- **Fix:** Route catalog SHOW/TVF, audit properties and lineage through one policy; complete credential annotations and separate typed URI diagnostic masking from unconditional name registration.
- **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. |
| 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 354 tests in 32 selected classes locally: masking/audit/lineage, configuration, metastore/filesystem holders, actual provider registration, security/metadata/plugin surfaces and dispatch. 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.

### 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 suite 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 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)
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: +274/-26; tests: +649/-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 dynamic configuration (about 20), 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` and catalog metadata checked registered names without inspecting values. Credential declarations were incomplete; URI parsing also treated later endpoints in URL lists as ordinary path text.
- **Why existing tests missed it:** `DatasourcePrintableMapTest` and `test_external_catalog_credential_masking` covered enumerated keys, missing URL, Hadoop and generic-name cases. Existing access-key/Ozone/prefix visibility assertions are updated; metastore URI diagnostics and multi-URL paths lacked coverage.
- **Fix:** Route catalog SHOW/TVF, audit properties and lineage through one policy; complete credential annotations and separate typed URI diagnostic masking from unconditional name registration.
- **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. |
| 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 354 tests in 32 selected classes locally: masking/audit/lineage, configuration, metastore/filesystem holders, actual provider registration, security/metadata/plugin surfaces and dispatch. 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 linked failing 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. |
| 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. FE source/tests are unchanged by this CI-only fix. |

### 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 suite 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 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.
morningman added a commit that referenced this pull request Nov 18, 2026
…ogs and basic reads (#70681)

### Background

Lance datasets store schemas, versions and fragment lists in manifests.
FE reads those manifests to plan a query, and BE reads the fragments
through lance-c. Doris 4.1/4.2 provide Lance catalogs in fe-core; master
uses connector plugins and already has the BE reader (#69581) and legacy
image migration (#69575).

### What problem does this PR solve?

Issue Number: #70680
Related PR: #65730, #66581, #66597, #66805 (source read-path changes);
#70338 (secret masking), #70351 (TIMEV2 precision), #69581 (BE reader),
#69575 (legacy images)
PR Type: Feature

Problem Summary:

Master has no plugin serving the `lance` catalog type, so users cannot
query Lance catalogs after upgrading from 4.1/4.2. This ports the first
part of that read path: filesystem catalogs, static S3 credentials,
Arrow type mapping, basic scans and main-chain time travel. The plugin
also needs JNI packaging and resource management; other catalog types
keep their existing behavior.

### Details

- **Change map:** 57 files, +6732/-2: production code +3377, tests
+2974, generated test output +75, build/CI +306/-2. Production has four
parts: property binding and namespace lifetime; schema and version
resolution; S3 storage-option translation shared by FE/BE; fragment scan
planning. Tests cover those contracts, native datasets and a regression
suite. Packaging registers the module, plugin distribution, JNI
replacement and MinIO fixture.
- **Scope:** Local/file and S3 filesystem catalogs; `SHOW
DATABASES/TABLES`, `DESC`, `SELECT`, `FOR VERSION AS OF n`, and `FOR
TIME AS OF 'yyyy-MM-dd HH:mm:ss[.SSS]'`. REST catalogs fail explicitly
until the next PR, including first access to replayed REST catalogs.
Tags, branches, OSS warehouses, pushdown and writes are outside this PR.
S3 access without static AK/SK, including anonymous and credential-chain
access, fails explicitly. AssumeRole is also rejected, even when source
AK/SK are provided.
- **Design:** Follow the existing connector plugins, rather than add
Lance catalog classes to fe-core. The plugin opts into MVCC and memoizes
metadata per statement, so schema, fragments, statistics and BE ranges
use one immutable dataset version. Ordinary query pins retain their
schema across the engine schema-cache boundary; historical statistics
also apply the snapshot to unpinned handles. Time travel compares
manifest commit times at their original precision in the session time
zone. The final S3 endpoint fills both native endpoint coordinates after
namespace options are merged, preventing ambient AWS endpoint overrides
while preserving namespace service-endpoint precedence. Each fragment
becomes one scan range. An in-flight call count delays native resource
disposal after catalog retirement. Proposed in #70680, opened with this
PR; no community design discussion has taken place yet.
- **Usage:**

  ```sql
  CREATE CATALOG lance_s3 PROPERTIES (
      "type" = "lance",
      "warehouse" = "s3://warehouse/lance",
      "s3.endpoint" = "http://127.0.0.1:9000",
      "s3.access_key" = "admin",
      "s3.secret_key" = "password",
      "s3.region" = "us-east-1",
      "use_path_style" = "true"
  );
  SELECT count(*) FROM lance_s3.`default`.all_types FOR VERSION AS OF 1;
  SELECT count(*) FROM lance_s3.`default`.all_types
      FOR TIME AS OF '2026-07-30 10:11:50';
  ```

- **Default behavior:** Enabled by creating a Lance catalog.
`lance.conf` contains the optional
`lance_catalog_arrow_memory_limit_bytes`, default 256 MiB per catalog;
changes require an FE restart.
- **Compatibility:** Preserve the 4.1/4.2 property map and names. Legacy
catalogs use the existing image migration. The Arrow memory setting
moves from fe.conf to lance.conf; copy any customized value. `SHOW
CREATE TABLE` uses `ENGINE=lance`, as other plugins do. No Thrift or
persisted-metadata format changes. BE needs #69581; projecting Arrow
Null, Duration, JSON or bfloat16 fences out smooth-upgrade source BEs.
Newer catalog features remain unsupported during this staged port. Both
cloud and shared-nothing use this planning path; a cloud deployment was
not tested locally.
- **Persistence and failure handling:** Catalog metadata uses the
existing plugin catalog journal/image path; dataset contents are
read-only. The namespace opens lazily, avoiding storage I/O and JNI
loading during replay. Missing versions and unavailable native libraries
fail explicitly. Statement cleanup releases its metadata memo; dropping
or altering a catalog retires its client and closes resources after
active calls finish.
- **Security and privileges:** CREATE_PRIV permits catalog creation;
ALTER_PRIV is required to change its properties. FE and BE make outbound
HTTP requests to the configured S3 endpoint, an SSRF surface. The
provider declares S3-compatible endpoint aliases for the existing
CREATE/ALTER gate when `security_checker_class_name` is configured. REST
credential keys are declared for masking even though REST reads are
deferred. Build-time JNI replacement downloads fixed, checksum-pinned
Lance JNI and Apache Arrow Java source assets.
- **Follow-up plan:** REST/OSS and namespace-vended credentials;
predicate/LIMIT/COUNT pushdown, fragment grouping and scalar indexes;
then session/table caches and profile counters. Search TVFs, index
operations and tag/branch/managed versioning follow separately under
#70680.

### Testing

- Storage/JNI fixes at `536982b`, macOS arm64/JDK 17: all 81 Lance tests
in 14 classes passed, with no skips, through `run-fe-ut.sh --run` and a
scoped `CUSTOM_MVN` wrapper. Checkstyle was enabled and Maven build
cache disabled. Cases include role plus source keys, generic/service
endpoint precedence, explicit HTTP policy, and native HTTP requests
under unrelated AWS endpoint and credential variables.
- On the unfixed `b62c94c`, the same targeted Java tests produced 5
assertion failures across 14 tests with no skips. The native child
actually requested the unrelated endpoint at port 1. The real shell
helper also failed with JAVA_HOME unset; all three JDK-selection cases
pass with the fix.
- Shell packaging tests cover JAVA_HOME, selected JAVA, PATH-only
discovery, jar/platform isolation, checksum/version/runtime gates and
failure atomicity. The real Arrow JNI helper compiled with JAVA_HOME
unset, and the native HTTP test passed using that rebuilt library; JVM
library logs confirmed its path.
- External CI at `536982b` passed 809 of 810 tests. The AssumeRole
negative case failed because its private endpoint selected the MinIO
provider, whose HMAC-only validation ran before Lance. The fixture now
sets `provider=S3` for that catalog and keeps the exact Lance exception
assertion.
- Provider fixture fix, macOS arm64/JDK 17: `run-fe-ut.sh --run` with a
scoped `CUSTOM_MVN` wrapper passed 54 tests in
`LanceStorageOptionsTest`, `S3FileSystemProviderTest`,
`MinioFileSystemProviderTest` and `MinioFileSystemPropertiesTest`, with
no skips, Checkstyle enabled and Maven build cache disabled. A probe
extracted the baseline and candidate catalog properties from the Groovy
suite and used freshly compiled production providers and Lance options:
the baseline reproduced the MinIO rejection; the candidate retained the
role and reached the exact Lance AssumeRole rejection. Groovy parsing
and `git diff --check` passed. The complete SQL suite and full External
rerun remain pending at the new head.
- Earlier validation at `b62c94c` reported 78 Lance tests, 162 Connector
SPI tests and 16 foundation binding tests passing. Initial feature
validation reported 507 related FE tests, `build.sh --fe`, and the MinIO
regression with this worktree's compatible BE `33d48fcf6da`. Those runs
predate this follow-up and are not current cluster verification. A full
External rerun, cloud, current-master BE and Linux/glibc 2.17 execution
remain unverified at the new head.

### Notes for Reviewers

- The BE Lance reader does not consume `history_schema_info`. Omitting
it retains FileScannerV2's exact-name matching, which the reader tests
exercise.
- Native FE tests skip explicitly on hosts unable to load Lance or Arrow
C Data JNI. The External pipeline enables the MinIO fixture and runs the
new regression suite. Linux x86_64 deployment rebuilds Arrow C Data JNI
with the Doris C++ toolchain, statically links its C++ runtimes and
replaces only that jar entry. This build step needs a JDK, C++ compiler
and `readelf`; it honors JAVA_HOME or discovers java.home from the JVM
selected by env.sh, including PATH-only JDK installations; releases
targeting glibc 2.17 must use the corresponding Doris build environment.
Linux/CentOS 7 execution of this new build step remains untested
locally.
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.
morningman added a commit that referenced this pull request Nov 21, 2026
…70725)

### Background

Lance catalogs expose a namespace as Doris databases and tables. The FE
reads dataset manifests through the Lance Java SDK and passes the pinned
version and storage options to the BE's lance-c reader. Master now
serves filesystem namespaces through the Lance connector plugin;
released 4.1/4.2 versions also serve REST namespaces and OSS storage.

### What problem does this PR solve?

Issue Number: #70680
Related PR: #70681 (filesystem plugin foundation), #66581 (REST
namespace source), #66805 (vended storage options source), #67157 (OSS
source), #70338 (property masking), #70364 (endpoint checks with default
ports)
PR Type: Feature

Problem Summary:

This ports REST namespaces, namespace-vended credentials and OSS support
from branch-4.x to the master Lance plugin. Users can read tables
through a namespace service without configuring static dataset
credentials in Doris. The change also validates REST authentication and
headers, declares the new endpoint and secrets, and adds the REST
fixture and behavior tests. Filesystem catalogs keep their existing
defaults and checks.

Original authors: @zhangstar333 and @FANNG1.

### Details

- **Change map:** Production code +585/-76 lines; tests and fixtures
+2011/-48; generated regression output +20; pipeline configuration +3.
Most changed lines are tests or fixture infrastructure.

  | Part | Purpose | Approximate changed production lines |
  | --- | --- | --- |
| REST namespace access | Validate properties, select the namespace
client, request table credentials, and sanitize errors | 330 |
| OSS storage | Adapt OSS properties, refuse OSS-HDFS and unresolved
AssumeRole, canonicalize options, and isolate explicit identities | 206
|
| S3 option reconciliation | Validate merged credentials, reset a
missing replacement token, and reconcile endpoint addressing using
native boolean semantics | 125 |

- **Scope:** REST authentication supports `none`, `bearer` and
`api_key`, plus extra headers; ALTER can switch modes by clearing the
inactive credential with `""`; namespace-vended options override catalog
options for FE metadata and BE scans. OSS uses Lance's OpenDAL provider.
Declared-only and namespace-managed-version tables fail explicitly;
their version protocol belongs to a later phase.
- **Design:** Reuse the namespace and storage-provider contracts from
4.1/4.2 inside the existing plugin, without adding Lance branches to the
engine. The four-phase plan is tracked in #70680. Reading storage-latest
for managed tables was rejected because the namespace may not have
published that version; this phase refuses them instead. Credential
validation follows the catalog/vended merge so an endpoint-only catalog
can receive valid credentials. Reconcile inherited S3 endpoints with the
final addressing mode using object_store's boolean vocabulary; a
namespace value such as `on` must qualify the bucket just like `true`.
- **Usage:** With the external regression namespace fixture:

  ```sql
  CREATE CATALOG lance_rest PROPERTIES (
      "type" = "lance",
      "lance.catalog.type" = "rest",
      "lance.rest.uri" = "http://127.0.0.1:19102",
      "lance.rest.security.type" = "bearer",
      "lance.rest.bearer-token" = "doris-lance-rest-test-token",
      "s3.endpoint" = "http://127.0.0.1:19001",
      "s3.region" = "us-east-1",
      "use_path_style" = "true"
  );
  SELECT count(*), sum(row_id) FROM lance_rest.`default`.all_types;
  ```

The committed fixture returns `12, 78` without a static access key or
secret key in the catalog.
- **Default behavior:** `lance.catalog.type` remains `filesystem`; REST
authentication defaults to `none`. REST requires `lance.rest.uri` and
rejects `warehouse`. No new FE configuration or session variable is
introduced.
- **Compatibility:** Preserve the 4.1/4.2 property names and raw catalog
map. Catalog reconstruction and replay perform no native connection;
first use opens the namespace. No shared SPI, Thrift, Protobuf or
storage-format change; the plugin API stays at master's 34.0. Reads
retain the foundation's FE/BE compatibility checks. A downgrade needs a
version that already supports the chosen Lance namespace and storage
provider.
- **Security and privileges:** `lance.rest.uri` is a user-controlled
outbound HTTP/SSRF surface. Catalog creation requires scoped
`CREATE_PRIV`, endpoint changes require `ALTER_PRIV`, and reads require
`SELECT_PRIV`. Declare REST alongside all existing S3-compatible
endpoint aliases so the configured engine gate covers CREATE and ALTER.
Mask bearer/API-key values and credential-bearing extra headers; strip
them from provider errors. Existing engine audit handling is reused.
- **Follow-up plan:** Predicate/LIMIT/COUNT pushdown and caches remain
later phases of #70680; namespace-managed versioning remains a separate
follow-up.

### Testing

- With the review fixes, `run-fe-ut.sh --run
'org.apache.doris.connector.lance.*Test'` passed all 149 Lance tests
locally on macOS aarch64/JDK 17.0.19, with zero failures, errors or
skips. This includes pass-through credential redaction, merged OSS
credential-pair validation, REST authentication/header checks and actual
JNI REST/S3/OSS tests.
- On unchanged production at `5471c9ebe0e`, the three new tests failed
on the intended assertions: an echoed vended token remained visible and
incomplete OSS identities were accepted. Zero errors or skips. The fixed
cases also cover case variants, catalog-completed pairs and clearing
just one credential.
- At `ccbffd65cd3`, four control-byte tests ran through `run-fe-ut.sh`:
both rejection tests failed on missing exceptions; both legal-value
controls passed. Zero errors or skips. They cover CREATE/merged ALTER,
leading/interior/trailing controls, extra headers and both credentials.
- At `1365c0a4849`, 77 engine tests for catalog privileges, endpoint
gating, plugin registration and 4.1.5 replay passed; thirteen SPI tests
passed. Those engine and SPI paths have no later production changes in
this PR.
- At `1365c0a4849`, `test_lance_catalog_all_types` and
`test_lance_rest_catalog` passed on freshly built FE/ASAN BE using the
committed dataset and a local S3 substitute that validated SigV4. The
runner generated the REST output, whose shared blocks matched
branch-4.2; scoped CREATE/ALTER/SELECT privileges and SHOW CREATE
masking were verified there.
- The SQL regression now covers all six authentication transitions,
conflicting header-name case variants, and SQL control escapes in extra
headers and both credentials. These later SQL additions have not been
run against a local cluster; expected-output files are unchanged. The
External pipeline enables this suite and its fixture.

### Notes for Reviewers

- Mask runtime credentials including Azure/GCS aliases; validate OSS
pairs after merging and before authentication inference.
- The SSRF gate checks literal CREATE/ALTER endpoint properties at
statement time. Namespace-returned destinations remain trusted external
metadata under `threat-model.md`; this port adds no runtime FE/BE egress
policy. Both credential-handling defects also exist in the inspected
4.1/4.2 implementations and need separate adaptation.
- Reject C0 controls except HTAB, and DEL, in headers and both
credentials before Lance silently omits the header, potentially
selecting a server default. Preserve valid values. The CR/LF-only
4.1/4.2 validators need separate adaptation.
- Case-equivalent custom header names must agree; validation emits one
lowercase SDK header while preserving raw catalog properties. ALTER can
update the original spelling or all retained aliases together.
- An empty inactive REST credential clears its value during ALTER;
whitespace-only inactive credentials remain invalid.
- Keep the filesystem AssumeRole rejection and all endpoint aliases
added during the foundation review. Only the obsolete REST-rejection
regression assertion is removed.
- A complete vended S3 pair without a token clears the inherited
catalog/environment token; an explicitly vended token is preserved. The
4.x maintainers need the same fix.
- S3 reconciliation accepts the pinned object_store true/false spellings
and case variants, preserves namespace option values, and rejects
invalid booleans. OSS keeps its separate native grammar.
- Docker cannot read cached image blobs here. Full MinIO/Compose, remote
OSS and Linux runs are unverified; the External pipeline enables the
fixture.

Co-authored-by: zhangstar333 <zhangsida@selectdb.com>
Co-authored-by: FANNG <fanng@apache.org>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants