Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

contrib/kafka: use secrets for SASL user and password #351

Merged
merged 2 commits into from
May 2, 2019

Conversation

danp
Copy link
Contributor

@danp danp commented Apr 8, 2019

Proposed Changes

Change the Kafka source spec to use SecretValueFromSource for user and
password, similar to the GitHub source.

This means the SASL user and password will no longer be stored in cleartext in the KafkaSource resources.

Based on #289 I did not allow for a graceful transition to this new scheme but happy to add it if needed.

Release Note

KafkaSource User and Password are now references to keys in secrets instead of plaintext values. Existing KafkaSource resources will need to be updated.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 8, 2019
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 8, 2019
@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 8, 2019
@knative-prow-robot
Copy link
Contributor

Hi @danp. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@danp
Copy link
Contributor Author

danp commented Apr 8, 2019

Wasn't sure how to nicely regenerate config/300-kafkasource.yaml so I did roughly:

cd contrib/kafka
go run ../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go all
mv config/crds/sources_v1alpha1_kafkasource.yaml config/300-kafkasource.yaml
# cut out non-relevant changes, add back license header, etc

If there's a better way, please let me know!

@matzew
Copy link
Member

matzew commented Apr 8, 2019

Mind adding a section on the readme for this ?

@danp
Copy link
Contributor Author

danp commented Apr 8, 2019

Which one were you thinking?

Did realize I need to update contrib/kafka/samples/event-source.yaml, will do that shortly.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 8, 2019
@matzew
Copy link
Member

matzew commented Apr 9, 2019

yeah, thanks @danp the readme in the samples and the related yamls doc

@matzew
Copy link
Member

matzew commented Apr 9, 2019

IMO it would be nice if some of the new secret bits are captured here:

Also, the docs repo has some high level details on the KafkaSource:

I wonder what's best ... if we move the samples/docs to the docs repo and write some real doc for it, explaining all possible config settings ?

Thoughts ?

@samodell @evankanderson @abrennan89

@danp
Copy link
Contributor Author

danp commented Apr 9, 2019

Ok! I did update the sample YAML in 810ad72.

Should we consider further doc changes as part of future PRs? For example, the current sample README doesn't mention SASL at all.

@matzew
Copy link
Member

matzew commented Apr 15, 2019

@danp I personally would like to see some more doc here.

I think in the long run we want to have some decent doc for all the sources, including all possible options.

In the long run, I'd like to see all docs mostly in the docs repo, and some short/dev references from here to the docs repo.

Perhaps @samodell from the docs team has some thoughts here too /cc @abrennan89

@matzew
Copy link
Member

matzew commented Apr 15, 2019

@danp btw. mind to rebase, when adding the doc ?

there is a conflict here

danp added 2 commits April 18, 2019 10:12
Change the Kafka source spec to use SecretValueFromSource for user and
password, similar to the GitHub source.
@danp danp force-pushed the kafka-sasl-secret branch from 810ad72 to 5a109d4 Compare April 18, 2019 13:13
@matzew
Copy link
Member

matzew commented Apr 18, 2019

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 18, 2019
@matzew
Copy link
Member

matzew commented Apr 18, 2019

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 18, 2019
@matzew
Copy link
Member

matzew commented Apr 18, 2019

IMO it's good enough to release note that the User and Password are now references to secrets, instead of not so secure plaintext 😂

/cc @grantr

@matzew
Copy link
Member

matzew commented May 2, 2019

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danp, matzew

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 2, 2019
@knative-prow-robot knative-prow-robot merged commit 7e2bc3f into knative:master May 2, 2019
@danp danp deleted the kafka-sasl-secret branch May 2, 2019 16:53
@matzew matzew mentioned this pull request May 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants