Repository navigation
fix(security): authorize test-connection workflow triggers (#26760) - #28414
Conversation
POST /v1/automations/workflows/trigger/{id} performed no authorization,
so any authenticated user could trigger a TEST_CONNECTION workflow against
any service and probe its connectivity/credentials.
For TEST_CONNECTION triggers, require ANY of: admin, EDIT_ALL on the target
service (covers the service owner), or CREATE on INGESTION_PIPELINE; fall
back to CREATE on INGESTION_PIPELINE when no serviceName is present. Other
workflow types keep their prior behavior to keep the change scoped.
The stored Workflow.request is an untyped LinkedHashMap, so the type check
runs on a ClassConverterFactory-converted copy (same pattern the existing
unmask/decrypt paths use) — otherwise the instanceof never matches and the
check silently falls through.
Adds WorkflowTriggerPermissionsIT covering admin, non-owner, service-owner,
pipeline-permission, no-serviceName fallback, and non-test-connection scoping.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR adds server-side authorization to the workflow trigger endpoint (POST /v1/automations/workflows/trigger/{id}) for TEST_CONNECTION workflows, preventing non-privileged users from triggering connectivity/credential probes against services they don’t own or administer.
Changes:
- Enforce authorization on
TEST_CONNECTIONworkflow triggers, requiring either service-levelEDIT_ALLor globalINGESTION_PIPELINECREATE(admin short-circuits via authorizer behavior). - Convert stored workflow payloads before type-checking the request so
TEST_CONNECTIONrequests stored as untyped maps can be evaluated. - Add integration tests validating allow/deny behavior across admin, service-owner, ingestionPipeline-create, and DataConsumer scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| openmetadata-service/src/main/java/org/openmetadata/service/resources/automations/WorkflowResource.java | Adds TEST_CONNECTION-scoped authorization checks to the trigger endpoint using authorizeRequests(..., ANY). |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/WorkflowTriggerPermissionsIT.java | Introduces integration coverage for the new trigger authorization behavior and confirms non-TEST_CONNECTION triggers remain ungated. |
…ected Address review: if a TEST_CONNECTION workflow's request cannot be resolved to a TestServiceConnectionRequest after conversion (e.g. a null/corrupt request or future converter change), deny the trigger with 403 instead of silently letting it run unauthorized. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Code Review ✅ Approved 1 resolved / 1 findingsAdds authorization to the workflow trigger endpoint for test-connection requests to prevent unauthorized connectivity probes. The fix addresses the silent auth bypass caused by type conversion failures. ✅ 1 resolved✅ Security: Silent auth bypass when ClassConverter fails to produce expected type
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
🟡 Playwright Results — all passed (11 flaky)✅ 4246 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 87 skipped
🟡 11 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Changes have been cherry-picked to the 1.12.9 branch. |
…28414) * fix(security): authorize test-connection workflow triggers (#26760) POST /v1/automations/workflows/trigger/{id} performed no authorization, so any authenticated user could trigger a TEST_CONNECTION workflow against any service and probe its connectivity/credentials. For TEST_CONNECTION triggers, require ANY of: admin, EDIT_ALL on the target service (covers the service owner), or CREATE on INGESTION_PIPELINE; fall back to CREATE on INGESTION_PIPELINE when no serviceName is present. Other workflow types keep their prior behavior to keep the change scoped. The stored Workflow.request is an untyped LinkedHashMap, so the type check runs on a ClassConverterFactory-converted copy (same pattern the existing unmask/decrypt paths use) — otherwise the instanceof never matches and the check silently falls through. Adds WorkflowTriggerPermissionsIT covering admin, non-owner, service-owner, pipeline-permission, no-serviceName fallback, and non-test-connection scoping. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(security): fail closed when TEST_CONNECTION request type is unexpected Address review: if a TEST_CONNECTION workflow's request cannot be resolved to a TestServiceConnectionRequest after conversion (e.g. a null/corrupt request or future converter change), deny the trigger with 403 instead of silently letting it run unauthorized. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> (cherry picked from commit 45295b7)
|
Changes have been cherry-picked to the 1.13 branch. |
…28414) * fix(security): authorize test-connection workflow triggers (#26760) POST /v1/automations/workflows/trigger/{id} performed no authorization, so any authenticated user could trigger a TEST_CONNECTION workflow against any service and probe its connectivity/credentials. For TEST_CONNECTION triggers, require ANY of: admin, EDIT_ALL on the target service (covers the service owner), or CREATE on INGESTION_PIPELINE; fall back to CREATE on INGESTION_PIPELINE when no serviceName is present. Other workflow types keep their prior behavior to keep the change scoped. The stored Workflow.request is an untyped LinkedHashMap, so the type check runs on a ClassConverterFactory-converted copy (same pattern the existing unmask/decrypt paths use) — otherwise the instanceof never matches and the check silently falls through. Adds WorkflowTriggerPermissionsIT covering admin, non-owner, service-owner, pipeline-permission, no-serviceName fallback, and non-test-connection scoping. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(security): fail closed when TEST_CONNECTION request type is unexpected Address review: if a TEST_CONNECTION workflow's request cannot be resolved to a TestServiceConnectionRequest after conversion (e.g. a null/corrupt request or future converter change), deny the trigger with 403 instead of silently letting it run unauthorized. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> (cherry picked from commit 45295b7)



What
Adds authorization to the workflow trigger endpoint (
POST /v1/automations/workflows/trigger/{id}) forTEST_CONNECTIONworkflows. Closes #26760.Why
The trigger endpoint performed no authorization, so any authenticated user could trigger a
TEST_CONNECTIONworkflow against any service and probe its connectivity/credentials, regardless of ownership or pipeline permissions.How
authorizeWorkflowTrigger, forTEST_CONNECTIONonly:ClassConverterFactorybefore the type check. The storedWorkflow.requestis an untypedLinkedHashMap, soinstanceof TestServiceConnectionRequestonly matches after conversion — the same pattern the existing unmask/decrypt paths already use. Without this the check silently falls through.EDIT_ALLon the target service (covers the service owner), orCREATEonINGESTION_PIPELINE.serviceNameis present, falls back toCREATEonINGESTION_PIPELINE.workflowTypeis checked before converting, so non-test-connection triggers skip the (secrets-decrypting) conversion entirely.Scope
QUERY_RUNNER,REVERSE_INGESTION, andTEST_SPARK_ENGINE_CONNECTIONare intentionally left unchanged (no trigger-level authz, as before) to keep this change scoped to #26760. Locking those down —QUERY_RUNNERin particular executes arbitrary SQL — is worth a separate follow-up.Testing
Adds
WorkflowTriggerPermissionsIT. Verified end-to-end against a local Docker deployment:ingestionPipeline:Create→ TEST_CONNECTION🤖 Generated with Claude Code