Repository navigation
[fix](config) fix admin set all frontends config - #55016
Merged
Merged
Conversation
cambyzju
requested review from
CalvinKirs,
dataroaring and
morningman
as code owners
August 19, 2025 13:08
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33756 ms |
Contributor
Author
|
run buildall |
zclllyybb
previously approved these changes
Aug 19, 2025
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 33921 ms |
TPC-DS: Total hot run time: 185833 ms |
ClickBench: Total hot run time: 32.63 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33997 ms |
TPC-DS: Total hot run time: 185176 ms |
ClickBench: Total hot run time: 31.83 s |
morrySnow
approved these changes
Aug 20, 2025
Contributor
|
PR approved by at least one committer and no changes requested. |
zclllyybb
approved these changes
Aug 20, 2025
morningman
approved these changes
Aug 20, 2025
cambyzju
added a commit
to cambyzju/incubator-doris
that referenced
this pull request
Aug 20, 2025
related pr: apache#54409 **What's the problem:** 1. `ADMIN SET ALL FRONTENDS CONFIG` command will forward to other FEs use new commnad `ADMIN SET FRONTEND CONFIG` 2. Then other FE if found `MasterOnly` config, will forward to this request to MASTER again **How to fix:** 1. `SET ALL FRONTENDS` forward to other FEs, still use the same command: `SET ALL FRONTENDS`; 2. while Env.setConfig for `SET ALL FRONTENDS` , do not forward again while is proxy;
cambyzju
added a commit
to cambyzju/incubator-doris
that referenced
this pull request
Aug 20, 2025
related pr: apache#54409 **What's the problem:** 1. `ADMIN SET ALL FRONTENDS CONFIG` command will forward to other FEs use new commnad `ADMIN SET FRONTEND CONFIG` 2. Then other FE if found `MasterOnly` config, will forward to this request to MASTER again **How to fix:** 1. `SET ALL FRONTENDS` forward to other FEs, still use the same command: `SET ALL FRONTENDS`; 2. while Env.setConfig for `SET ALL FRONTENDS` , do not forward again while is proxy;
morrySnow
pushed a commit
that referenced
this pull request
Aug 21, 2025
cambyzju
added a commit
to cambyzju/incubator-doris
that referenced
this pull request
Aug 21, 2025
16 tasks
Gabriel39
added a commit
to Gabriel39/incubator-doris
that referenced
this pull request
Nov 18, 2026
### Background External catalogs retain connector properties. Provider declarations feed the FE's masking registry; catalog display, catalog metadata, and audit SQL rendering use that registry. ### What problem does this PR solve? Issue Number: None Related PR: apache#70338 (provider-owned masking and ALTER CATALOG audit coverage), apache#70696 (overlapping metastore URI annotation fix), apache#55016 (all-FE configuration forwarding) PR Type: Bugfix Problem Summary: Name-only matching exposes JDBC/URL and SDK/Hadoop credentials. Apply one display policy plus a dynamic FE-local name regex, preserving permanent rules. The diff also completes diagnostic annotations and tests. An exercised `uri` value: | Before | After | |---|---| | `https://fixture:fixture-password@api.example.com/v1?region=east&token=fixture-token` | `https://api.example.com/v1?region=east&token=*XXX` | ### Details - **Change map:** Production code: +279/-28; tests: +710/-50; CI config: +9/-0; no generated/docs/submodule changes. Most added lines are tests. Production parts are shared name/value policy and output routing (about 210 added lines), validated configuration and SQL forwarding (about 30), and provider declarations/diagnostic masking (about 40). - **Frequency:** Always when a retained credential uses one of the uncovered names or connection formats; reproduced in property display and CREATE/ALTER audit rewriting. - **Root cause:** `DatasourcePrintableMap` checked names without inspecting values; credential declarations were incomplete. URI parsing accepted later endpoints as path text, and forwarded config SQL embedded decoded strings without escaping. - **Why existing tests missed it:** Property tests missed URL/Hadoop/custom-name cases; access-key assertions expected disclosure. Metastore URI diagnostics lacked coverage. Admin config and manager regression tests used numeric values, missing SQL escaping. - **Fix:** Share catalog/audit/lineage masking, complete credential annotations and distinguish diagnostic URIs; quote forwarded config strings using the session SQL mode. - **Other paths and branches:** Shared output callers inherit the rules. Cached branch-3.1/4.0/4.1/4.2 retain the parsing gap; only master changes. No single introducing PR was identified. - **Configs and defaults:** `datasource_sensitive_property_pattern` is FE-local, mutable and case-insensitive, defaulting to `password|passwd|secret|token|credential|access[._-]?key|api[._-]?key`. Startup/custom-file/runtime validation rejects invalid stored expressions without replacing the previous value. `(?!)` disables only the supplement; empty matches every name. Configure all serving FEs consistently. - **Behavior change:** Stored properties and connections are unchanged. Display is more conservative: keyword matches can hide metadata, and URLs can lose userinfo/fragments or normalize query separators. The complete masking rules are: | Input | Output rule | |---|---| | Existing exact sensitive keys and provider prefixes | Remain masked, independently of the configurable pattern. Existing hidden-property rules still omit their entries. | | Recognizable JDBC property names | Names ending in a JDBC `url`/`uri` component, including `jdbc_url`, `jdbc.jdbc_url`, `iceberg.jdbc.uri`, and `paimon.jdbc.uri`, mask completely. `connectionString`, `connection_string`, `connection-string`, and `connection.string` suffixes also mask completely. | | JDBC values under any name | Any trimmed value beginning with `jdbc:`, case-insensitively, masks completely, including a bare `uri` alias and opaque/driver-specific JDBC syntax. | | Native SDK credentials | Bare or dot/underscore/hyphen-delimited final components `token`, `credential`, or `credentials` mask completely. Registered aliases and the configurable pattern add coverage. | | Hadoop credentials | The built-in families below mask completely, including dynamic bucket/account names and names prefixed before `fs.`; they do not depend on the configurable pattern. Other credential-like names receive the default pattern's protection. | | Custom names | A match against the configured regex masks the entire value. Matching is a search, so the default protects `custom.password`, `clientSecret`, and `custom.accessKey`. It is unioned with every permanent rule. | | Ordinary addresses | Hostnames, IPv4, bracketed IPv6, optional numeric ports in 0–65535, and comma-separated host lists remain visible. Empty address values stay empty. | | URL selection | Sanitize properties ending in a delimited `uri/url/host/endpoint/address` component, including plural forms, and hierarchical `scheme://` values under other names. A name already classified sensitive takes precedence and masks completely. | | Supported URL schemes | `http`, `https`, `thrift`, `hdfs`, `s3`, `s3a`, `s3n`, `oss`, `cos`, `cosn`, `obs`, `gs`, `abfs`, `abfss`, `wasb`, `wasbs`. Preserve the host, port, ordinary path, and non-sensitive query parameters; remove all userinfo and the entire fragment. | | URL query credentials | Decode parameter names, process duplicates and both `&`/`;` separators, and mask values whose names match permanent/configured rules or contain `password/passwd/pwd/secret/token/credential`, access/API/account/private/auth/app/application key variants, or `authorization`; exact `auth` and `key` are also protected. Query separators render as `&`; decoded names must use ASCII letters/digits, dot, underscore, tilde, or hyphen. | | Signed URLs | A decoded query name containing `signature`, or a delimited `sig`/`sas` component, masks the entire URL, including AWS/GCS/OSS/CloudFront signatures and Azure SAS. | | Unreliable address parsing | Unknown schemes, opaque/invalid URLs, invalid host/port or escaping, unrecognized query names, matrix path parameters, repeated encoding, and nested connection strings in otherwise unclassified query values mask completely. Any comma-containing URL masks completely, including ordinary query commas; decoded paths containing commas or nested `://` also mask completely. Valid plain host:port lists remain visible. No raw-value or parser-exception fallback is logged. | | All-FE configuration SQL | `ADMIN SET ALL FRONTENDS CONFIG` quotes decoded names and values according to the forwarded `sql_mode`; regex backslashes and quotes survive peer reparsing in default and `NO_BACKSLASH_ESCAPES` modes. | | Typed URI diagnostics | Iceberg/Paimon JDBC and REST URI fields, including the shared `uri` alias, use `sensitive=true, sensitiveInDiagnosticsOnly=true`: non-empty diagnostic values render as `***`, empty values as `<empty>`. They do not export URI aliases into the global secret-name registry; catalog output follows the value-aware rules above. | | Credential annotations | Access keys and every declared alias in S3, MinIO, GCS, OSS, COS, OBS, Iceberg Glue and Iceberg REST now join existing secret/token annotations; Ozone access keys and JDBC catalog URLs remain protected. These declarations mask typed diagnostics and contribute unconditional provider-sensitive names. Non-secret account names, OAuth modes/scopes and credential-file paths are unchanged. | Permanent Hadoop families, matched case-insensitively: | Namespace | Credential fields | |---|---| | `fs.s3.` / `fs.s3a.` and optional `bucket.<bucket>.` | `access.key`, `secret.key`, `session.token`, `encryption.key`, `server-side-encryption.key`, `proxy.password`; dotted bucket names are supported. | | `fs.azure.` | `account.key`, `sas`, `sas.fixed.token`, `account.oauth2.client.secret`, `account.oauth2.refresh.token`, `encryption.encoded.client-provided.key`, including account/container suffixes. | | `fs.adl.oauth2.` | `credential`, `refresh.token`. | | `fs.oss.` | `accessKeyId`, `accessKeySecret`, `securityToken`. | | `fs.cosn.` with optional `userInfo.` | `secretId`, `secretKey`. | | `fs.obs.` | `access.key`, `secret.key`, `session.token`, `security.token`. | Masking uses `*XXX` in property output. Lineage continues omitting name-classified secrets and sanitizes other values. Non-empty annotated credentials render as `***` in typed diagnostics. The retained `mc.session_token` declaration does not add token authentication to the current binder. ### Testing - Before the policy change: 8 of 9 new property-policy tests fail because original credentials remain visible; the ordinary endpoint control passes. - Before the JDBC annotation: 2 of 18 JDBC tests fail on the URL declaration and diagnostic disclosure. - Configuration trimming: a targeted test reproduces accepting a regex that becomes invalid after storage trimming. - Annotation follow-up baseline: S3 and Iceberg execute with 5 failures; Paimon executes separately with 2 URI diagnostic failures. The multi-URL case fails because its later password remains visible. - `run-fe-ut.sh` passes all 367 tests in 35 selected classes locally: masking/audit/lineage, configuration, metastore/filesystem holders, actual provider registration, security/metadata/plugin surfaces, dispatch and config SQL roundtrips. Coverage includes URL lists, encoded/duplicate/signed URLs, 5,001-host lists, dynamic rules and unchanged connection values. FE Checkstyle passes. - Extended the P0/nonConcurrent SQL audit suite with SHOW, `catalogs()`, and persisted CREATE/ALTER assertions. It was not executed locally; the regular P0 configuration includes it, while cloud P0 skips nonConcurrent suites. | CI check | Evidence | |---|---| | Gitleaks 8.30.0 | The Gitleaks job scans the full PR commit range and misclassifies two adjacent Hadoop property-name literals as API-key values. The same scan reproduces 2 findings before the config fix and 0 after it. A generic-api-key exception requires both the exact test path and one of two exact synthetic property names. | | All-FE regex forwarding | Before the serializer fix, 2 of 9 admin-config tests fail: the peer exposes `custom.pin1`, and the regex loses its backslash. After the fix, all 9 pass; actual parser/serializer/Env application plus masking and a literal matrix cover both SQL modes and command scopes. Peer application is simulated in-process, without multi-FE RPC. | | Exception boundaries | Two fixture-name occurrences in another file and an unrelated synthetic API-key value in the allowed file remain detected; only the two intended occurrences are ignored. | ### Notes for Reviewers The new defaulted `ConnectorProperty.sensitiveInDiagnosticsOnly` metadata prevents shared URI aliases from hiding every REST endpoint. Connector/metastore SPI signatures and baselines are unchanged. Free-text secrets, SDK containers and unrelated logging remain outside scope. ### Release note External data source displays and audit property output now mask JDBC connection strings, native SDK/Hadoop credentials, credential-like custom properties, and URL authentication components. The new FE configuration `datasource_sensitive_property_pattern` adjusts extra name matching without disabling permanent credential rules. ### Check List (For Author) - Behavior changed: Yes (see Details). - Does this need documentation: Yes (document the FE config and catalog-output rules in apache/doris-website; detailed rules are included above). - Pre-submission status: Partially verified: SQL regression and multi-FE RPC not executed locally. ### AI Disclosure - Tool: Codex (GPT-6). - Generated: Production changes, tests, and this description. - Human review: not stated. - Prompts: Mask MaxCompute/Ozone credentials, extend shared JDBC/URL/SDK/Hadoop/custom-name rules, then complete sensitive annotations and address review findings.
Gabriel39
added a commit
that referenced
this pull request
Nov 20, 2026
…70705) ### Background External catalogs retain connector properties. Provider declarations feed the masking registry used by display, metadata and audit SQL. ### What problem does this PR solve? Issue Number: None Related PR: #70338 (provider-owned masking and ALTER CATALOG audit coverage), #70696 (overlapping metastore URI annotation fix), #55016 (all-FE configuration forwarding), #67489 (resolved streaming audit inputs) PR Type: Bugfix Problem Summary: Name-only matching exposes JDBC/URL and SDK/Hadoop credentials. Apply shared value-aware masking and a supplementary FE-local name regex, completing diagnostic annotations. An exercised `uri` value: | Before | After | |---|---| | `https://fixture:fixture-password@api.example.com/v1?region=east&token=fixture-token` | `https://api.example.com/v1?region=east&token=*XXX` | ### Details - **Change map:** Production: +514/-44 across 28 files; tests: +1237/-76 across 30; CI: +9/-0 in one. No generated/docs/submodule changes. Production covers shared masking, provider annotations, configuration forwarding and structured streaming audit rendering. - **Frequency:** Always when a retained credential uses one of the uncovered names or connection formats; reproduced in property display and CREATE/ALTER audit rewriting. - **Root cause:** `DatasourcePrintableMap` checked names without inspecting values; credential declarations were incomplete. Generic URI parsing also hid local files, ViewFS and resolved streaming batches; configuration forwarding lost SQL escapes. - **Why existing tests missed it:** Property tests missed format-specific locations; streaming assertions had accepted hidden final URIs. SQL audit tests missed these formats; existing ADBC metadata tests already require visible local paths. Admin tests missed string escaping. - **Fix:** Share catalog/audit/lineage masking, complete credential annotations and distinguish diagnostic URIs; preserve supported locations and independently sanitize selected streaming files at final audit emission; quote forwarded configuration strings correctly. - **Other paths and branches:** Shared output callers inherit the rules. Cached branch-3.1/4.0/4.1/4.2 retain the parsing gap; only master changes. No single introducing PR was identified. - **Configs and defaults:** `datasource_sensitive_property_pattern` is FE-local, mutable and case-insensitive, defaulting to `password|passwd|secret|token|credential|access[._-]?key|api[._-]?key`. Startup/custom-file/runtime validation rejects invalid stored expressions without replacing the previous value. `(?!)` disables only the supplement; empty matches every name. Configure all serving FEs consistently. - **Behavior change:** Stored properties and connections are unchanged. Display is more conservative: keyword matches can hide metadata, and URLs can lose userinfo/fragments or normalize query separators. The complete masking rules are: | Input | Output rule | |---|---| | Existing exact sensitive keys and provider prefixes | Remain masked, independently of the configurable pattern. Existing hidden-property rules still omit their entries. | | Recognizable JDBC property names | Names ending in a JDBC `url`/`uri` component, including `jdbc_url`, `jdbc.jdbc_url`, `iceberg.jdbc.uri`, and `paimon.jdbc.uri`, mask completely. `connectionString`, `connection_string`, `connection-string`, and `connection.string` suffixes also mask completely. | | JDBC values under any name | Any trimmed value beginning with `jdbc:`, case-insensitively, masks completely, including a bare `uri` alias and opaque/driver-specific JDBC syntax. | | Native SDK credentials | Bare or dot/underscore/hyphen-delimited final components `token`, `credential`, or `credentials` mask completely. Registered aliases and the configurable pattern add coverage. | | Hadoop credentials | The built-in families below mask completely, including dynamic bucket/account names and names prefixed before `fs.`; they do not depend on the configurable pattern. Other credential-like names receive the default pattern's protection. | | Custom names | A match against the configured regex masks the entire value. Matching is a search, so the default protects `custom.password`, `clientSecret`, and `custom.accessKey`. It is unioned with every permanent rule. | | Ordinary addresses | Hostnames, IPv4, bracketed IPv6, optional numeric ports in 0–65535, and comma-separated host lists remain visible. Empty address values stay empty. | | URL selection | Sanitize properties ending in a delimited `uri/url/host/endpoint/address` component, including plural forms, and hierarchical `scheme://` or `file:/`, `hdfs:/`, `viewfs:/` values under other names. A name already classified sensitive takes precedence and masks completely. | | Supported URL schemes | `http`, `https`, `thrift`, `hdfs`, `viewfs`, `file`, `s3`, `s3a`, `s3n`, `oss`, `cos`, `cosn`, `obs`, `gs`, `abfs`, `abfss`, `wasb`, `wasbs`. Preserve the host, port, ordinary path, and non-sensitive query parameters; remove authentication userinfo (Azure exception below) and the entire fragment. | | Local driver paths and file URIs | Recognized `driver_url` suffixes retain absolute POSIX paths, including spaces/Unicode; protocol-relative, control, query, fragment, userinfo, matrix or nested-URL syntax masks completely. Hierarchical `file:/absolute/path` and `file:///absolute/path` retain their spelling, require no authority, and use the common query/signature/fragment rules. Name/JDBC masking takes precedence. | | Native filesystem locations | `viewfs://mount-name/path` accepts validated ordinary-address authority syntax, including ASCII underscore mount names, with numeric-port checks; it names a logical mount table rather than requiring a DNS host. Hierarchical absolute `hdfs:/path`, `hdfs:///path` and `viewfs:///path` can omit authority and retain their slash form, using configured nameservice/default-mount semantics. GCS `gs://` authorities require 3–222 lowercase ASCII letters/digits/dots/underscores/hyphens, start/end with a letter/digit, and dot-separated components at most 63 characters; ports, escaping and other syntax mask completely. This accepts underscores rather than imposing DNS-host syntax; remove authentication userinfo and retain common query/path/signature checks. This is display-safety validation, not bucket-creation policy. HTTP/S3 host validation remains strict. [GCS naming rules](https://docs.cloud.google.com/storage/docs/buckets). | | Resolved S3 streaming audit inputs | Snapshot task-selected files; sanitize each singleton location independently, then assemble the existing escaped batch syntax. Preserve selected filenames in final success/failure/notification audit events, including tested literal commas, braces, brackets, backslashes, spaces, hashes, percent text and plus signs. Already-decoded selected keys treat `#` literally, including in query-shaped suffixes; temporary URI encoding is only for validation. Native path text is already decoded, so literal `%`, `%HH` and `+` are preserved without another decoding or URI-encoding-layer check. Native query-shaped suffixes preserve non-secret separator spelling, empty components and raw values. Whole-suffix temporary encoding is only for URI validation; names/signatures retain shared rules, while value inspection checks raw and at most three percent-decoded views (including form spaces) and masks residual encoding. Matrix/nested/list-shape path guards and unknown-name masking remain. Ordinary URL fragments still disappear. Query credentials/signatures retain their common policy. Any signed/unreliable location masks the entire batch. Apply current name rules and sanitize all other TVF properties at emission; execution inputs remain unchanged. Release temporary map/list snapshots on the worker after synchronous emission, including failure and early cancellation. This exception is internal and does not admit untrusted catalog/SQL URI-list strings. | | Azure storage locations | For `abfs`, `abfss`, `wasb`, and `wasbs` (case-insensitive), retain `container@host` after validating the raw container with the existing `AzureUri` grammar: one character for compatibility, or 3–63 lowercase ASCII letters/digits/hyphens, beginning and ending with a letter/digit. Missing, encoded, malformed or password-bearing containers mask the whole URI. Path/query checks and signed-URL masking still apply. | | URL query credentials | Decode parameter names, process duplicates and both `&`/`;` separators, and mask values whose names match permanent/configured rules or contain `password/passwd/pwd/secret/token/credential`, access/API/account/private/auth/app/application key variants, or `authorization`; exact `auth` and `key` are also protected. Ordinary URL query separators render as `&`; native selected-key suffixes retain their separators and empty components; decoded names must use ASCII letters/digits, dot, underscore, tilde, or hyphen. | | Signed URLs | A decoded query name containing `signature`, or a delimited `sig`/`sas` component, masks the entire URL, including AWS/GCS/OSS/CloudFront signatures and Azure SAS. | | Unreliable address parsing | For ordinary URL/address inputs, unknown schemes, opaque/invalid URLs, invalid host/port or escaping, unrecognized query names, matrix path parameters, repeated encoding, and nested connection strings in otherwise unclassified query values, including whitespace/form-space-prefixed JDBC, mask completely. Outside the structured streaming path above, any comma-containing URL masks completely, including ordinary query commas; decoded paths containing commas or nested `://` also mask completely. Valid plain host:port lists remain visible. No raw-value or parser-exception fallback is logged. | | All-FE configuration SQL | `ADMIN SET ALL FRONTENDS CONFIG` quotes decoded names and values according to the forwarded `sql_mode`; regex backslashes and quotes survive peer reparsing in default and `NO_BACKSLASH_ESCAPES` modes. | | Typed URI diagnostics | Iceberg/Paimon JDBC and REST URI fields, including the shared `uri` alias, use `sensitive=true, sensitiveInDiagnosticsOnly=true`: non-empty diagnostic values render as `***`, empty values as `<empty>`. They do not export URI aliases into the global secret-name registry; catalog output follows the value-aware rules above. | | Credential annotations | Access keys and every declared alias in S3, MinIO, GCS, OSS, COS, OBS, Iceberg Glue and Iceberg REST now join existing secret/token annotations; Ozone access keys and JDBC catalog URLs remain protected. These declarations mask typed diagnostics and contribute unconditional provider-sensitive names. These annotation additions do not reclassify account names, OAuth modes/scopes or credential-file paths; generic name rules can independently mask such names. | Permanent Hadoop families, matched case-insensitively: | Namespace | Credential fields | |---|---| | `fs.s3.` / `fs.s3a.` and optional `bucket.<bucket>.` | `access.key`, `secret.key`, `session.token`, `encryption.key`, `server-side-encryption.key`, `proxy.password`; dotted bucket names are supported. | | `fs.azure.` | `account.key`, `sas`, `sas.fixed.token`, `account.oauth2.client.secret`, `account.oauth2.refresh.token`, `encryption.encoded.client-provided.key`, including account/container suffixes. | | `fs.adl.oauth2.` | `credential`, `refresh.token`. | | `fs.oss.` | `accessKeyId`, `accessKeySecret`, `securityToken`. | | `fs.cosn.` with optional `userInfo.` | `secretId`, `secretKey`. | | `fs.obs.` | `access.key`, `secret.key`, `session.token`, `security.token`. | Masking uses `*XXX` in property output. Lineage continues omitting name-classified secrets and sanitizes other values. Non-empty annotated credentials render as `***` in typed diagnostics. The retained `mc.session_token` declaration does not add token authentication to the current binder. ### Testing - `run-fe-ut.sh` passes all 565 tests in 47 selected classes locally: masking/audit/lineage, configuration, metastore/filesystem holders, actual provider registration, security/metadata/plugin surfaces, dispatch, S3 offsets, ADBC paths, audit publication and config SQL roundtrips. Coverage includes URL lists, encoded/duplicate/signed URLs, 5,001-host lists, dynamic rules and unchanged connection values. FE Checkstyle passes. - Extended the P0/nonConcurrent SQL audit suite with SHOW, `catalogs()`, and persisted CREATE/ALTER assertions. It was not executed locally; the regular P0 configuration includes it, while cloud P0 skips nonConcurrent suites. | CI check | Evidence | |---|---| | Initial policy/annotation baselines | Before the policy change, 8 of 9 new tests expose credentials; the safe-endpoint control passes. Before the JDBC annotation, 2 of 18 tests fail. S3/Iceberg annotation tests reproduce 5 failures; Paimon separately reproduces 2. The multi-URL baseline exposes its later password. | | Configuration trimming | A targeted test reproduces a regex accepted before trimming that becomes invalid when stored. | | Azure container regression | Before the fix, 18 tests/2 classes reproduce 5 assertion failures: container loss in property display, token-query URLs, CREATE/ALTER audit and lineage, plus malformed authority passing through. New cases cover all four schemes, uppercase scheme, container length/character boundaries, encoded/password-bearing authority, query credentials and SAS signatures. The final expanded FE run passes all 565 tests/47 classes; the existing AzureUri parser suite is included. | | Existing FE integration tests | The previous head reproduces all 7 CI failures in 39 tests/4 classes. Provider fixtures use opaque names to prove admission independently of the generic regex. Final streaming audit assertions now require resolved batches, replacing the incomplete expectation that their URIs should be hidden. Malformed hosts and CREATE/ALTER JOB JDBC URLs remain masked. | | Location compatibility | Before this follow-up, 37 tests/3 classes reproduce 9 failures across final streaming events, local paths and lineage. A separate renderer probe reproduces literal-filename loss before its fix and passes afterward. Final tests cover one/multiple files, failed tasks, notifications, signed/embedded credentials, literal filenames, runtime rule changes, local/file URI rejection boundaries and ViewFS. | | Native locations and snapshot lifetime | Actual formatter probe reproduces three valid native locations masking; five focused methods reproduce five assertion failures in property/lineage and successful, failed and canceled task snapshot ownership. Added positive native audit/lineage cases, credential/signature/opaque/invalid-S3 controls and post-run release assertions. Final repository FE run passes 565 tests/47 classes; the same five focused methods and the actual native/literal renderer probes pass; Checkstyle passes. | | Literal hash identities | Before the fix, the actual final renderer collapses two selected hash keys to identical names. Before the fix, six focused methods execute: four expected hash/notification/credential/signature assertion failures and two existing controls pass. Tests require distinct hashes for one/multiple selected files on success/failure, notifications and query-shaped suffixes; ordinary URI fragment removal remains covered. Final FE run passes 565 tests/47 classes; Checkstyle and all original probes pass. Before its fix, a self-review probe initializes the pinned Hadoop ViewFileSystem with mount_table but observes MASK in display; named-ViewFS property/audit/lineage and malformed/encoded/port/signature controls now cover the repaired authority branch. | | Decoded native percent paths | Before the fix, the actual final renderer masks a batch containing100%.csv; four focused methods reproduce two percent failures with two existing controls passing. Tests add native percent/nonhex/%HH/repeated-looking/plus identities for one/multiple files, success/failure and notifications, with generic URI negative controls. Final repository FE run passes 565 tests/47 classes; the same percent renderer probe and four focused methods pass. Checkstyle passes. | | Independent local review | Qualified gpt-6-astra/xhigh lead and coverage reviewers approve exact head5a39cd98f66872ce9502f636d617bdae565ca5c5:59 changed files,17 checkpoints,0 findings/regressions,one-round convergence. [Commit-bound PASS receipt](#70705 (comment)). Static review is separate from the author-run tests above; cluster SQL/multi-FE RPC remain unverified. | | Native suffix spelling and inspection | Before repair, six focused methods produce four identity/credential/opaque-JDBC failures and two passing controls. Cases cover separator/empty-component identity, percent/space/plus/encoded-looking values, final success/failure/notification events, masked values with preserved non-secret syntax, and encoded/double/deep nested URLs beside malformed native percent text. A separate form-space JDBC guard fails before its repair. Final repository FE run passes 565 tests/47 classes; all seven focused identity/security/control methods and independent Checkstyle pass. | | GCP metadata | Identity roundtrips run with the supplementary pattern disabled using `(?!)`; permanent HMAC keys remain masked. A separate credential-keyword test checks that `gs.credential_provider_type` is masked, matching the default heuristic's conservative treatment of metadata names. The original pattern is restored after each test. | | Gitleaks 8.30.0 | The Gitleaks job scans the full PR commit range and misclassifies two adjacent Hadoop property-name literals as API-key values. The same scan reproduces 2 findings before the config fix and 0 after it. A generic-api-key exception requires both the exact test path and one of two exact synthetic property names. | | All-FE regex forwarding | Before the serializer fix, 2 of 9 admin-config tests fail: the peer exposes `custom.pin1`, and the regex loses its backslash. After the fix, all 9 pass; actual parser/serializer/Env application plus masking and a literal matrix cover both SQL modes and command scopes. Peer application is simulated in-process, without multi-FE RPC. | | Exception boundaries | Two fixture-name occurrences in another file and an unrelated synthetic API-key value in the allowed file remain detected; only the two intended occurrences are ignored. | ### Notes for Reviewers The new defaulted `ConnectorProperty.sensitiveInDiagnosticsOnly` metadata prevents shared URI aliases from hiding every REST endpoint. Connector/metastore SPI signatures and baselines are unchanged. Free-text secrets, SDK containers and unrelated logging remain outside scope. ### Release note External data source displays and audit property output now mask JDBC connection strings, native SDK/Hadoop credentials, credential-like custom properties, and URL authentication components. The new FE configuration `datasource_sensitive_property_pattern` adjusts extra name matching without disabling permanent credential rules. ### Check List (For Author) - Behavior changed: Yes (see Details). - Does this need documentation: Yes (document the FE config and catalog-output rules in apache/doris-website; detailed rules are included above). - Pre-submission status: Partially verified: SQL regression and multi-FE RPC not executed locally. ### AI Disclosure - Tool: Codex (GPT-6). - Generated: Production changes, tests, and this description. - Human review: not stated. - Prompts: Mask MaxCompute/Ozone credentials, extend shared JDBC/URL/SDK/Hadoop/custom-name rules, then complete sensitive annotations and address review findings.
wyxxxcat
pushed a commit
to wyxxxcat/doris
that referenced
this pull request
Nov 24, 2026
…pache#70705) External catalogs retain connector properties. Provider declarations feed the masking registry used by display, metadata and audit SQL. Issue Number: None Related PR: apache#70338 (provider-owned masking and ALTER CATALOG audit coverage), apache#70696 (overlapping metastore URI annotation fix), apache#55016 (all-FE configuration forwarding), apache#67489 (resolved streaming audit inputs) PR Type: Bugfix Problem Summary: Name-only matching exposes JDBC/URL and SDK/Hadoop credentials. Apply shared value-aware masking and a supplementary FE-local name regex, completing diagnostic annotations. An exercised `uri` value: | Before | After | |---|---| | `https://fixture:fixture-password@api.example.com/v1?region=east&token=fixture-token` | `https://api.example.com/v1?region=east&token=*XXX` | - **Change map:** Production: +514/-44 across 28 files; tests: +1237/-76 across 30; CI: +9/-0 in one. No generated/docs/submodule changes. Production covers shared masking, provider annotations, configuration forwarding and structured streaming audit rendering. - **Frequency:** Always when a retained credential uses one of the uncovered names or connection formats; reproduced in property display and CREATE/ALTER audit rewriting. - **Root cause:** `DatasourcePrintableMap` checked names without inspecting values; credential declarations were incomplete. Generic URI parsing also hid local files, ViewFS and resolved streaming batches; configuration forwarding lost SQL escapes. - **Why existing tests missed it:** Property tests missed format-specific locations; streaming assertions had accepted hidden final URIs. SQL audit tests missed these formats; existing ADBC metadata tests already require visible local paths. Admin tests missed string escaping. - **Fix:** Share catalog/audit/lineage masking, complete credential annotations and distinguish diagnostic URIs; preserve supported locations and independently sanitize selected streaming files at final audit emission; quote forwarded configuration strings correctly. - **Other paths and branches:** Shared output callers inherit the rules. Cached branch-3.1/4.0/4.1/4.2 retain the parsing gap; only master changes. No single introducing PR was identified. - **Configs and defaults:** `datasource_sensitive_property_pattern` is FE-local, mutable and case-insensitive, defaulting to `password|passwd|secret|token|credential|access[._-]?key|api[._-]?key`. Startup/custom-file/runtime validation rejects invalid stored expressions without replacing the previous value. `(?!)` disables only the supplement; empty matches every name. Configure all serving FEs consistently. - **Behavior change:** Stored properties and connections are unchanged. Display is more conservative: keyword matches can hide metadata, and URLs can lose userinfo/fragments or normalize query separators. The complete masking rules are: | Input | Output rule | |---|---| | Existing exact sensitive keys and provider prefixes | Remain masked, independently of the configurable pattern. Existing hidden-property rules still omit their entries. | | Recognizable JDBC property names | Names ending in a JDBC `url`/`uri` component, including `jdbc_url`, `jdbc.jdbc_url`, `iceberg.jdbc.uri`, and `paimon.jdbc.uri`, mask completely. `connectionString`, `connection_string`, `connection-string`, and `connection.string` suffixes also mask completely. | | JDBC values under any name | Any trimmed value beginning with `jdbc:`, case-insensitively, masks completely, including a bare `uri` alias and opaque/driver-specific JDBC syntax. | | Native SDK credentials | Bare or dot/underscore/hyphen-delimited final components `token`, `credential`, or `credentials` mask completely. Registered aliases and the configurable pattern add coverage. | | Hadoop credentials | The built-in families below mask completely, including dynamic bucket/account names and names prefixed before `fs.`; they do not depend on the configurable pattern. Other credential-like names receive the default pattern's protection. | | Custom names | A match against the configured regex masks the entire value. Matching is a search, so the default protects `custom.password`, `clientSecret`, and `custom.accessKey`. It is unioned with every permanent rule. | | Ordinary addresses | Hostnames, IPv4, bracketed IPv6, optional numeric ports in 0–65535, and comma-separated host lists remain visible. Empty address values stay empty. | | URL selection | Sanitize properties ending in a delimited `uri/url/host/endpoint/address` component, including plural forms, and hierarchical `scheme://` or `file:/`, `hdfs:/`, `viewfs:/` values under other names. A name already classified sensitive takes precedence and masks completely. | | Supported URL schemes | `http`, `https`, `thrift`, `hdfs`, `viewfs`, `file`, `s3`, `s3a`, `s3n`, `oss`, `cos`, `cosn`, `obs`, `gs`, `abfs`, `abfss`, `wasb`, `wasbs`. Preserve the host, port, ordinary path, and non-sensitive query parameters; remove authentication userinfo (Azure exception below) and the entire fragment. | | Local driver paths and file URIs | Recognized `driver_url` suffixes retain absolute POSIX paths, including spaces/Unicode; protocol-relative, control, query, fragment, userinfo, matrix or nested-URL syntax masks completely. Hierarchical `file:/absolute/path` and `file:///absolute/path` retain their spelling, require no authority, and use the common query/signature/fragment rules. Name/JDBC masking takes precedence. | | Native filesystem locations | `viewfs://mount-name/path` accepts validated ordinary-address authority syntax, including ASCII underscore mount names, with numeric-port checks; it names a logical mount table rather than requiring a DNS host. Hierarchical absolute `hdfs:/path`, `hdfs:///path` and `viewfs:///path` can omit authority and retain their slash form, using configured nameservice/default-mount semantics. GCS `gs://` authorities require 3–222 lowercase ASCII letters/digits/dots/underscores/hyphens, start/end with a letter/digit, and dot-separated components at most 63 characters; ports, escaping and other syntax mask completely. This accepts underscores rather than imposing DNS-host syntax; remove authentication userinfo and retain common query/path/signature checks. This is display-safety validation, not bucket-creation policy. HTTP/S3 host validation remains strict. [GCS naming rules](https://docs.cloud.google.com/storage/docs/buckets). | | Resolved S3 streaming audit inputs | Snapshot task-selected files; sanitize each singleton location independently, then assemble the existing escaped batch syntax. Preserve selected filenames in final success/failure/notification audit events, including tested literal commas, braces, brackets, backslashes, spaces, hashes, percent text and plus signs. Already-decoded selected keys treat `#` literally, including in query-shaped suffixes; temporary URI encoding is only for validation. Native path text is already decoded, so literal `%`, `%HH` and `+` are preserved without another decoding or URI-encoding-layer check. Native query-shaped suffixes preserve non-secret separator spelling, empty components and raw values. Whole-suffix temporary encoding is only for URI validation; names/signatures retain shared rules, while value inspection checks raw and at most three percent-decoded views (including form spaces) and masks residual encoding. Matrix/nested/list-shape path guards and unknown-name masking remain. Ordinary URL fragments still disappear. Query credentials/signatures retain their common policy. Any signed/unreliable location masks the entire batch. Apply current name rules and sanitize all other TVF properties at emission; execution inputs remain unchanged. Release temporary map/list snapshots on the worker after synchronous emission, including failure and early cancellation. This exception is internal and does not admit untrusted catalog/SQL URI-list strings. | | Azure storage locations | For `abfs`, `abfss`, `wasb`, and `wasbs` (case-insensitive), retain `container@host` after validating the raw container with the existing `AzureUri` grammar: one character for compatibility, or 3–63 lowercase ASCII letters/digits/hyphens, beginning and ending with a letter/digit. Missing, encoded, malformed or password-bearing containers mask the whole URI. Path/query checks and signed-URL masking still apply. | | URL query credentials | Decode parameter names, process duplicates and both `&`/`;` separators, and mask values whose names match permanent/configured rules or contain `password/passwd/pwd/secret/token/credential`, access/API/account/private/auth/app/application key variants, or `authorization`; exact `auth` and `key` are also protected. Ordinary URL query separators render as `&`; native selected-key suffixes retain their separators and empty components; decoded names must use ASCII letters/digits, dot, underscore, tilde, or hyphen. | | Signed URLs | A decoded query name containing `signature`, or a delimited `sig`/`sas` component, masks the entire URL, including AWS/GCS/OSS/CloudFront signatures and Azure SAS. | | Unreliable address parsing | For ordinary URL/address inputs, unknown schemes, opaque/invalid URLs, invalid host/port or escaping, unrecognized query names, matrix path parameters, repeated encoding, and nested connection strings in otherwise unclassified query values, including whitespace/form-space-prefixed JDBC, mask completely. Outside the structured streaming path above, any comma-containing URL masks completely, including ordinary query commas; decoded paths containing commas or nested `://` also mask completely. Valid plain host:port lists remain visible. No raw-value or parser-exception fallback is logged. | | All-FE configuration SQL | `ADMIN SET ALL FRONTENDS CONFIG` quotes decoded names and values according to the forwarded `sql_mode`; regex backslashes and quotes survive peer reparsing in default and `NO_BACKSLASH_ESCAPES` modes. | | Typed URI diagnostics | Iceberg/Paimon JDBC and REST URI fields, including the shared `uri` alias, use `sensitive=true, sensitiveInDiagnosticsOnly=true`: non-empty diagnostic values render as `***`, empty values as `<empty>`. They do not export URI aliases into the global secret-name registry; catalog output follows the value-aware rules above. | | Credential annotations | Access keys and every declared alias in S3, MinIO, GCS, OSS, COS, OBS, Iceberg Glue and Iceberg REST now join existing secret/token annotations; Ozone access keys and JDBC catalog URLs remain protected. These declarations mask typed diagnostics and contribute unconditional provider-sensitive names. These annotation additions do not reclassify account names, OAuth modes/scopes or credential-file paths; generic name rules can independently mask such names. | Permanent Hadoop families, matched case-insensitively: | Namespace | Credential fields | |---|---| | `fs.s3.` / `fs.s3a.` and optional `bucket.<bucket>.` | `access.key`, `secret.key`, `session.token`, `encryption.key`, `server-side-encryption.key`, `proxy.password`; dotted bucket names are supported. | | `fs.azure.` | `account.key`, `sas`, `sas.fixed.token`, `account.oauth2.client.secret`, `account.oauth2.refresh.token`, `encryption.encoded.client-provided.key`, including account/container suffixes. | | `fs.adl.oauth2.` | `credential`, `refresh.token`. | | `fs.oss.` | `accessKeyId`, `accessKeySecret`, `securityToken`. | | `fs.cosn.` with optional `userInfo.` | `secretId`, `secretKey`. | | `fs.obs.` | `access.key`, `secret.key`, `session.token`, `security.token`. | Masking uses `*XXX` in property output. Lineage continues omitting name-classified secrets and sanitizes other values. Non-empty annotated credentials render as `***` in typed diagnostics. The retained `mc.session_token` declaration does not add token authentication to the current binder. - `run-fe-ut.sh` passes all 565 tests in 47 selected classes locally: masking/audit/lineage, configuration, metastore/filesystem holders, actual provider registration, security/metadata/plugin surfaces, dispatch, S3 offsets, ADBC paths, audit publication and config SQL roundtrips. Coverage includes URL lists, encoded/duplicate/signed URLs, 5,001-host lists, dynamic rules and unchanged connection values. FE Checkstyle passes. - Extended the P0/nonConcurrent SQL audit suite with SHOW, `catalogs()`, and persisted CREATE/ALTER assertions. It was not executed locally; the regular P0 configuration includes it, while cloud P0 skips nonConcurrent suites. | CI check | Evidence | |---|---| | Initial policy/annotation baselines | Before the policy change, 8 of 9 new tests expose credentials; the safe-endpoint control passes. Before the JDBC annotation, 2 of 18 tests fail. S3/Iceberg annotation tests reproduce 5 failures; Paimon separately reproduces 2. The multi-URL baseline exposes its later password. | | Configuration trimming | A targeted test reproduces a regex accepted before trimming that becomes invalid when stored. | | Azure container regression | Before the fix, 18 tests/2 classes reproduce 5 assertion failures: container loss in property display, token-query URLs, CREATE/ALTER audit and lineage, plus malformed authority passing through. New cases cover all four schemes, uppercase scheme, container length/character boundaries, encoded/password-bearing authority, query credentials and SAS signatures. The final expanded FE run passes all 565 tests/47 classes; the existing AzureUri parser suite is included. | | Existing FE integration tests | The previous head reproduces all 7 CI failures in 39 tests/4 classes. Provider fixtures use opaque names to prove admission independently of the generic regex. Final streaming audit assertions now require resolved batches, replacing the incomplete expectation that their URIs should be hidden. Malformed hosts and CREATE/ALTER JOB JDBC URLs remain masked. | | Location compatibility | Before this follow-up, 37 tests/3 classes reproduce 9 failures across final streaming events, local paths and lineage. A separate renderer probe reproduces literal-filename loss before its fix and passes afterward. Final tests cover one/multiple files, failed tasks, notifications, signed/embedded credentials, literal filenames, runtime rule changes, local/file URI rejection boundaries and ViewFS. | | Native locations and snapshot lifetime | Actual formatter probe reproduces three valid native locations masking; five focused methods reproduce five assertion failures in property/lineage and successful, failed and canceled task snapshot ownership. Added positive native audit/lineage cases, credential/signature/opaque/invalid-S3 controls and post-run release assertions. Final repository FE run passes 565 tests/47 classes; the same five focused methods and the actual native/literal renderer probes pass; Checkstyle passes. | | Literal hash identities | Before the fix, the actual final renderer collapses two selected hash keys to identical names. Before the fix, six focused methods execute: four expected hash/notification/credential/signature assertion failures and two existing controls pass. Tests require distinct hashes for one/multiple selected files on success/failure, notifications and query-shaped suffixes; ordinary URI fragment removal remains covered. Final FE run passes 565 tests/47 classes; Checkstyle and all original probes pass. Before its fix, a self-review probe initializes the pinned Hadoop ViewFileSystem with mount_table but observes MASK in display; named-ViewFS property/audit/lineage and malformed/encoded/port/signature controls now cover the repaired authority branch. | | Decoded native percent paths | Before the fix, the actual final renderer masks a batch containing100%.csv; four focused methods reproduce two percent failures with two existing controls passing. Tests add native percent/nonhex/%HH/repeated-looking/plus identities for one/multiple files, success/failure and notifications, with generic URI negative controls. Final repository FE run passes 565 tests/47 classes; the same percent renderer probe and four focused methods pass. Checkstyle passes. | | Independent local review | Qualified gpt-6-astra/xhigh lead and coverage reviewers approve exact head5a39cd98f66872ce9502f636d617bdae565ca5c5:59 changed files,17 checkpoints,0 findings/regressions,one-round convergence. [Commit-bound PASS receipt](apache#70705 (comment)). Static review is separate from the author-run tests above; cluster SQL/multi-FE RPC remain unverified. | | Native suffix spelling and inspection | Before repair, six focused methods produce four identity/credential/opaque-JDBC failures and two passing controls. Cases cover separator/empty-component identity, percent/space/plus/encoded-looking values, final success/failure/notification events, masked values with preserved non-secret syntax, and encoded/double/deep nested URLs beside malformed native percent text. A separate form-space JDBC guard fails before its repair. Final repository FE run passes 565 tests/47 classes; all seven focused identity/security/control methods and independent Checkstyle pass. | | GCP metadata | Identity roundtrips run with the supplementary pattern disabled using `(?!)`; permanent HMAC keys remain masked. A separate credential-keyword test checks that `gs.credential_provider_type` is masked, matching the default heuristic's conservative treatment of metadata names. The original pattern is restored after each test. | | Gitleaks 8.30.0 | The Gitleaks job scans the full PR commit range and misclassifies two adjacent Hadoop property-name literals as API-key values. The same scan reproduces 2 findings before the config fix and 0 after it. A generic-api-key exception requires both the exact test path and one of two exact synthetic property names. | | All-FE regex forwarding | Before the serializer fix, 2 of 9 admin-config tests fail: the peer exposes `custom.pin1`, and the regex loses its backslash. After the fix, all 9 pass; actual parser/serializer/Env application plus masking and a literal matrix cover both SQL modes and command scopes. Peer application is simulated in-process, without multi-FE RPC. | | Exception boundaries | Two fixture-name occurrences in another file and an unrelated synthetic API-key value in the allowed file remain detected; only the two intended occurrences are ignored. | The new defaulted `ConnectorProperty.sensitiveInDiagnosticsOnly` metadata prevents shared URI aliases from hiding every REST endpoint. Connector/metastore SPI signatures and baselines are unchanged. Free-text secrets, SDK containers and unrelated logging remain outside scope. External data source displays and audit property output now mask JDBC connection strings, native SDK/Hadoop credentials, credential-like custom properties, and URL authentication components. The new FE configuration `datasource_sensitive_property_pattern` adjusts extra name matching without disabling permanent credential rules. - Behavior changed: Yes (see Details). - Does this need documentation: Yes (document the FE config and catalog-output rules in apache/doris-website; detailed rules are included above). - Pre-submission status: Partially verified: SQL regression and multi-FE RPC not executed locally. - Tool: Codex (GPT-6). - Generated: Production changes, tests, and this description. - Human review: not stated. - Prompts: Mask MaxCompute/Ozone credentials, extend shared JDBC/URL/SDK/Hadoop/custom-name rules, then complete sensitive annotations and address review findings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
related pr: #54409
What's the problem:
ADMIN SET ALL FRONTENDS CONFIGcommand will forward to other FEs use new commnadADMIN SET FRONTEND CONFIGMasterOnlyconfig, will forward to this request to MASTER againHow to fix:
SET ALL FRONTENDSforward to other FEs, still use the same command:SET ALL FRONTENDS;SET ALL FRONTENDS, do not forward again while is proxy;Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)