fix: mark connector and function user config as sensitive - #221
Merged
freeznet merged 4 commits intoAug 26, 2026
Conversation
`configs` on pulsar_source and pulsar_sink carries arbitrary connector
settings, and in practice that is where credentials end up - a JDBC sink
needs its password somewhere, and `configs` is where every other setting
for that connector goes. The attribute was not marked sensitive, so those
values were echoed in `terraform plan` and `terraform apply` output.
Mark it `Sensitive: true` on both resources, and do the same for
`user_config` on pulsar_function, which is the equivalent free-form
surface there.
This is a mitigation, not a fix: the value still lives in state, as it
does for any sensitive attribute. Using `secrets` so the credential never
reaches connector config, function metadata or state at all remains the
stronger recommendation. This only stops the value being printed.
Deliberately left alone:
- `secrets` itself. It holds `{path, key}` references rather than values,
and keeping it visible shows which secret names are wired up, which is
useful in a diff and not itself sensitive.
- `custom_runtime_options`. It can carry credentials, but its structure is
being changed by streamnative#219, and masking it would hide runtime settings that
are usually not secret. Worth deciding separately.
The trade-off is that non-secret settings in `configs` and `user_config` -
a JDBC URL, a table name, a threshold - now render as `(sensitive value)`
in diffs. That is the cost of the attribute being free-form: the provider
cannot tell which keys hold credentials.
Fixes streamnative#213
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
4 tasks
Member
|
Pushed Changes:
Validation:
|
freeznet
previously approved these changes
Aug 26, 2026
maxsxu
previously approved these changes
Aug 26, 2026
maxsxu
approved these changes
Aug 26, 2026
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.
Fixes #213
Motivation
configsonpulsar_sourceandpulsar_sinkcarries arbitrary connector settings, and in practice that is where credentials end up — a JDBC sink needs its password somewhere, andconfigsis where every other setting for that connector already goes. The attribute is not marked sensitive, so those values are echoed interraform planandterraform applyoutput.pulsar_functionhas the same shape inuser_config.This is the enforcement half of #204, which documents the hazard. Documentation alone leaves the value printed to every terminal and CI log that runs a plan.
Modifications
Add
Sensitive: trueto:configsonpulsar_sink(resource_pulsar_sink.go)configsonpulsar_source(resource_pulsar_source.go)user_configonpulsar_function(resource_pulsar_function.go)and regenerate
docs/.Scope, and what I deliberately left alone. The issue asks to audit
pulsar_functionfor the same gap, so to be explicit about where I drew the line:secretsis not marked sensitive. It holds{"path": ..., "key": ...}references rather than values. Keeping it visible shows which secret names are wired up, which is useful in a diff and is not itself sensitive.custom_runtime_optionsis not marked sensitive. It can carry credentials, but feat(function): expose input_specs for per-topic consumer config #219 is actively changing its structure, and masking it would also hide runtime settings that are usually not secret. Better decided on its own once feat(function): expose input_specs for per-topic consumer config #219 settles.Trade-off worth naming. Non-secret settings in
configsanduser_config— a JDBC URL, a table name, a threshold — now render as(sensitive value)in diffs. That is the unavoidable cost of a free-form attribute: the provider cannot tell which keys hold credentials. The issue raises the same concern. If you would rather accept noisier diffs than mask everything, the alternative is to leaveconfigsvisible and rely on #204's documentation alone — happy to go that way instead.Also note this is a mitigation rather than a fix: the value still lives in state, as with any sensitive attribute. Using
secrets, so the credential never reaches connector config, function metadata or state at all, remains the stronger recommendation.Verifying this change
This change is already covered by existing tests:
make testandgolangci-lintpass.go generate ./...reproduces the committeddocs/output; the only diff is the three attributes gaining theSensitivemarker.TestSink,TestSinkUpdate,TestSourceandTestFunctionall pass, confirming that marking the attributes sensitive does not disturb the read/write paths or state handling.Documentation
Check the box below.
Need to update docs?
doc-requiredno-need-docdocdocs/resources/{sink,source,function}.mdregenerated; the three attributes now show as(Sensitive).