Repository navigation
Description
1. Problem Description — Real-World Scenario
KubeVela's workflow engine persists all inter-step runtime state into a Kubernetes ConfigMap, not a Secret. This is hardcoded in the architecture.
What the code actually does
From the canonical design document (kubevela/design/vela-core/workflow_policy.md):
type WorkflowContext struct {
cli client.Client
store *corev1.ConfigMap // All step variables written HERE
components map[string]*ComponentManifest
vars *value.Value
modified bool
}The CNCF scalability blog (April 2023) confirmed:
"Application workflow stores the running context in the ConfigMap."
That ConfigMap is named workflow-<appname>-context and lives in the application's namespace, readable by anyone with get configmaps RBAC in that namespace.
What users legitimately write inside workflows
The op.ws.#DoVar CUE operator allows steps to write and read arbitrary values across step boundaries:
fetchToken: op.#HTTPDo & {
method: "POST"
url: "https://vault.internal/v1/auth/token"
}
storeIt: op.ws.#DoVar & {
method: "Put"
path: "credentials.vault_token"
value: fetchToken.response.body.auth.client_token // Real token stored in ConfigMap
}
getIt: op.ws.#DoVar & {
method: "Get"
path: "credentials.vault_token"
}That vault_token is now stored verbatim in the workflow-<app>-context ConfigMap. The same happens for:
- Database passwords fetched from an external API and passed downstream
- Cloud provider temporary credentials (AWS AssumeRole tokens, GCP access tokens) retrieved in step 1 and consumed in step 2
- Git tokens extracted from an existing Secret via
op.#Readand piped through the context via DoVar - Registry passwords produced by
export2secretthat are simultaneously reflected into workflow context for downstream use - HTTP webhook response payloads containing JWTs or bearer tokens
The Compound Debug Problem
Issue kubevela/kubevela#5178 reveals that vela debug dumps all step-level context data into dedicated ConfigMaps named {appname}-{stepname}-debug-{hash}.
When workflowrun.oam.dev/debug: "true" annotation is set — which engineers routinely do in staging environments that mirror production — every single workflow variable including secrets is permanently frozen into a readable ConfigMap, with:
- No TTL
- No automatic cleanup mechanism
- No documentation warning that sensitive data will be persisted
2. Why This Is Important — Impact at Scale
Attack surface in a multi-team platform
In a platform team scenario with 50+ teams sharing the same hub cluster:
- Namespaces are the isolation boundary
- Teams commonly have
get/liston ConfigMaps (needed for app config, feature flags, etc.) - A developer with
get configmaps -n team-baccess can read all in-flight credentials from team-b's active deployment workflows
Violates Kubernetes' own least-privilege model
Kubernetes explicitly distinguishes ConfigMaps (non-sensitive, no special RBAC treatment) from Secrets (sensitive data, separate resources: ["secrets"] RBAC verbs, encryption-at-rest support, dedicated audit logging).
KubeVela's workflow engine collapses this distinction by using only ConfigMaps as its variable store, effectively making the Kubernetes RBAC model irrelevant for any credential that flows through a workflow.
Production CI/CD pipelines are the worst affected
The very workflows KubeVela is designed for — multi-environment progressive delivery, cloud-resource provisioning, GitOps — are exactly the ones that transit credentials:
- Cloud provisioning workflow: step-1 calls AWS API, gets temporary STS credentials, passes to step-2 for Terraform apply, credentials sit in ConfigMap for the entire workflow duration
- GitOps workflow: step-1 reads a GitHub token from a Secret, uses
op.ws.#DoVarto pass it to step-2 for repo push, the token is now duplicated in a ConfigMap - Image build workflow (documented example in official docs): uses
export2secretfor git-secret and image-secret, but values read back viaop.ws.#DoVarinto the context store are still stored in the ConfigMap
Compliance failure
Under SOC2, PCI-DSS, and HIPAA, audit requirements mandate that access to credentials be separately logged. Kubernetes Secrets trigger dedicated audit log events under the secrets resource group. ConfigMaps do not.
By routing credentials through ConfigMaps, KubeVela makes credential access invisible to compliance audits.
3. Why This Is NOT a Duplicate
| Existing Issue | Why It Is Different |
|---|---|
#31 (2020): vela secret to manage secret for information passing |
Was about exposing a vela secret CLI command. Closed. Does not address the internal workflow context store at all. |
#862: generate Secret/ConfigMap from vela config |
About generating user-visible ConfigMaps/Secrets from component config. Unrelated to the workflow variable store. |
#2057: TraitDefinition for Secret & PVC |
About trait-level Secret creation, not the workflow engine's internal state persistence. |
#4264: business configuration management at application level |
About config reuse and abstraction, not the security of workflow runtime state. |
#5178: vela debug configmap naming bug |
Only about the naming convention of debug ConfigMaps. The security implications of those ConfigMaps persisting sensitive data with no TTL were never raised. |
export2secret built-in step |
This is a user-triggered, explicit step that writes to a named Secret. It does NOT address: (a) the implicit workflow context store used by op.ws.#DoVar, (b) debug ConfigMaps, (c) the fact that data flowing through the context to eventually reach export2secret is first written in plaintext to the ConfigMap. |
The core architectural flaw — that WorkflowContext.store is always a *corev1.ConfigMap with no sensitivity-aware storage backend — has never been filed, discussed, or acknowledged in any open, closed, or duplicate-marked issue.
4. Suggested Direction of Fix (High-Level)
Option A — Sensitivity-annotated DoVar paths (minimal-invasive)
Extend op.ws.#DoVar with an optional sensitive: bool field:
storeToken: op.ws.#DoVar & {
method: "Put"
path: "credentials.token"
value: fetchedToken
sensitive: true
}When sensitive: true, the workflow engine writes that path's value to a sibling Secret (workflow-<app>-context-sensitive) instead of the ConfigMap, and retrieves it from there on Get. The ConfigMap holds only a tombstone reference: {"credentials.token": "__secret_ref__"}.
Option B — Dual-store WorkflowContext backend (architectural)
Refactor WorkflowContext to hold two backing stores:
type WorkflowContext struct {
cli client.Client
store *corev1.ConfigMap // non-sensitive vars (existing)
secureStore *corev1.Secret // sensitive vars (new, opt-in per path)
...
}The WorkflowStepDefinition CUE schema gains a sensitiveOutputs field (parallel to outputs) that routes selected output paths to secureStore automatically.
Option C — Debug ConfigMap TTL and warning (complementary)
- Add a configurable
ttlSecondsannotation to debug ConfigMaps, defaulting to3600 - Emit a
Warningcontroller event whenworkflowrun.oam.dev/debug: "true"is detected on an application in a namespace that does not carry a designated dev/non-production label - Document clearly that debug ConfigMaps contain all workflow state including any transited secrets
Backward Compatibility
All three options are fully additive. Existing workflows that do not opt into sensitive: true or secureStore continue to work without any change. The fix can be gated behind a feature flag:
--enable-secure-workflow-store=true
5. Steps to Reproduce (Minimal)
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: secret-leak-demo
namespace: default
spec:
components:
- name: dummy
type: webservice
properties:
image: nginx
workflow:
steps:
- name: store-sensitive-value
type: apply-componentAfter workflow execution, inspect the context ConfigMap:
kubectl get configmap workflow-secret-leak-demo-context -o yaml
# All values stored via op.ws.#DoVar appear under .data in plaintextEnvironment
- KubeVela Version: All versions (architectural issue present since workflow engine introduction)
- Kubernetes Version: Any
- Deployment: Any multi-tenant or shared-namespace production cluster
- Impact: High — affects any workflow that transits credentials between steps
References
- KubeVela Workflow Design Doc — WorkflowContext struct:
kubevela/design/vela-core/workflow_policy.md - CNCF Blog — KubeVela Scalability (April 2023): https://www.cncf.io/blog/2023/04/12/stability-and-scalability-assessment-of-kubevela/
- Built-in Workflow Operations — op.ws.#DoVar: https://kubevela.io/docs/platform-engineers/workflow/cue-actions/
- Issue [Bug] vela debug cannot work for workflow steps with invalid resource name kubevela#5178 — vela debug stores step data in ConfigMaps
- Kubernetes Secrets vs ConfigMaps security distinction: https://kubernetes.io/docs/concepts/configuration/secret/
Activity
ankitkumarrain commentedon Jul 16, 2026
@vishal210893 i would like to raise PR to this issue . Please assign it to me .
Paranitharan1110 commentedon Jul 17, 2026
Hey @roguepikachu , Is anyone actively working on this?
briankane commentedon Nov 21, 2026
Direction for this one: step templates mark sensitive fields with
// +sensitive, the same marker SourceDefinitions use, and those values are kept in a companion Secret rather than the context ConfigMap. #245 is carrying it.