Feat: ConfigMap-driven workflow HTTP denylist and SSRF hardening
Description of your changes
Hardens workflow HTTP (request / provider http) against SSRF, with a default denylist on install and an operator-friendly path to extend it later.
Day 1 (plain Helm install)
helm install workflow kubevela/vela-workflow -n vela-system
With default values, users get SSRF protection without extra setup:
- Controller discovers ConfigMaps labeled
config.oam.dev/type=vela-workflow-http-deny - Chart installs ConfigTemplate
config-template-vela-workflow-http-deny - Chart installs labeled ConfigMap
vela-workflow-http-deny-default - Binary also ships the same floor as Go constants in
BuiltinDeny(), so empty discovery or deleting the default ConfigMap cannot open SSRF
Per-chart ownership (dual install with kubevela): each chart owns its own ConfigTemplate and default deny ConfigMap so Helm installs do not conflict on those objects:
| Chart | ConfigTemplate | Default ConfigMap | Discovery label / flag |
|---|---|---|---|
| vela-workflow | config-template-vela-workflow-http-deny | vela-workflow-http-deny-default | vela-workflow-http-deny |
| vela-core | config-template-vela-core-http-deny | vela-core-http-deny-default | vela-core-http-deny |
Uninstalling one release leaves the other's template and default CM intact.
Blocked by default (cloud metadata / link-local):
| Entry | Purpose |
|---|---|
metadata.google.internal | GCP metadata hostname |
169.254.0.0/16 | Link-local / AWS IMDS (169.254.169.254) |
fe80::/10 | IPv6 link-local |
fd00:ec2::254 | AWS IMDS IPv6 |
100.100.100.200 | Alibaba metadata |
Still allowed by default: in-cluster ClusterIP/pod traffic and public destinations.
Where the defaults live:
| Layer | Location | Role |
|---|---|---|
| Helm values | workflow.httpDeny.defaultConfig.* | What the chart ships |
| Cluster object | ConfigMap/vela-workflow-http-deny-default | Editable, discovered at runtime |
| Binary floor | pkg/utils/httpguard/defaults.go (BuiltinDeny consts) | Always-on failsafe |
Enforcement is dial-time (resolved IP via net.Dialer.Control), plus host checks on the URL and redirects. A blocked call fails the step with blocked SSRF host / blocked SSRF target.
Day 2 (operators extend or tighten)
Add more denials (unioned with defaults; hot-reloaded). Use the chart's template name:
vela config create team-http-deny \
--template vela-workflow-http-deny \
--namespace vela-system \
'denyHosts={*.evil.example}' \
'denyCIDRs={10.0.0.0/8}'
Raw labeled ConfigMaps work the same way if they carry config.oam.dev/type=vela-workflow-http-deny. For vela-core Application workflows, use vela-core-http-deny instead.
Optional Helm toggles:
| Value | Default | Effect |
|---|---|---|
workflow.httpDeny.configTemplateName | vela-workflow-http-deny | Label used for discovery ("" disables discovery) |
workflow.httpDeny.defaultConfig.enabled | true | Ship the default labeled ConfigMap |
workflow.blockPrivateHTTPAddresses | false | Also block RFC1918 + IPv6 ULA (breaks most ClusterIP calls) |
workflow.disableWorkflowHTTP | false | Block all workflow outbound HTTP |
blockPrivateHTTPAddresses uses Go ip.IsPrivate() (10/8, 172.16/12, 192.168/16, fc00::/7). It is off by default so legitimate in-cluster request steps keep working. Link-local/metadata stay covered by the Day 1 floor either way.
Implementation notes
- Feature gates:
DisableWorkflowHTTP,BlockPrivateHTTPAddresses - Startup load uses API Reader (cache is not ready before
mgr.Start), then hot-reload on create/update/delete - ConfigTemplate stamps discovery labels on output ConfigMaps; parameter defaults stay empty lists so
vela config-template applyOpenAPI schema generation keeps working - Chart rewrites the shipped CUE discovery label to match
configTemplateName; empty name skips installing the template/default ConfigMap
I have:
- Read and followed KubeVela's contribution process.
- Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
- Run
make reviewableto ensure this PR is ready for review. - Added
backport release-x.ylabels to auto-backport this PR if necessary.
How has this code been tested
- Unit tests for
pkg/utils/httpguard, ConfigMap discovery/aggregation, and HTTP provider deny paths - Live k3d install-order matrix (
ssrf-matrix): kubevela alone, workflow alone, kubevela→workflow, workflow→kubevela for the deny ConfigTemplate/CM ownership; WorkflowRun and Applicationrequeststeps to IMDS are blocked - Live
DisableWorkflowHTTP=trueon both controllers: in-clusterrequeststeps fail withworkflow outbound HTTP is disabled by DisableWorkflowHTTP feature gatefor WorkflowRun and Application
Special notes for your reviewer
- Merge this first. KubeVela main and release backports need a published workflow revision that includes these commits.
- Companion KubeVela PR (
fix/ssrf-workflow-http-guard) mirrors the ConfigTemplate, Helm defaults, and controller flag wiring, and will pin the published workflow SHA after this lands. - Related release follow-ups after this is tagged as needed:
release-0.6backport for KubeVela 1.9- pin-based branch for KubeVela 1.10 (
v0.6.3-0.20250717221743-56b80cee4121)