-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Enable use of secrets via SecretProvider for MQTT broker credentials #197
Conversation
e456934
to
9777018
Compare
Codecov Report
@@ Coverage Diff @@
## master #197 +/- ##
==========================================
- Coverage 27.64% 25.60% -2.04%
==========================================
Files 5 5
Lines 463 492 +29
==========================================
- Hits 128 126 -2
- Misses 321 352 +31
Partials 14 14
Continue to review full report at Codecov.
|
4345886
to
4ee44f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good. I followed your testing instructions and was able to get everything working as expected. That said, I did have a few minor comments line, some which need addressing.
b4e3877
to
5a3b4cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes/responses...
…ials close #159 Signed-off-by: lenny <[email protected]>
dumb-init is needed when running the injected security bootstrapper entry point script for secure mode. Signed-off-by: lenny <[email protected]>
Signed-off-by: lenny <[email protected]>
5a3b4cf
to
52941ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
MQTT broker credentials are in plain text configuration. No way to get them from SecretStore (aka Vault)
Issue Number: #159
What is the new behavior?
Via use of SpecretProvider, MQTT broker credentials can be pulled from a SecretStore. The SecretStore is Vault when running in secure mode or InsecureSecrets configuration section when running non-secure mode.
This PR is dependent on the following PRs:
edgexfoundry/go-mod-bootstrap#141
edgexfoundry/device-sdk-go#707
Does this PR introduce a breaking change?
Are there any new imports or modules? If so, what are they used for and why?
no
Are there any specific instructions or things that should be known prior to reviewing?
Do the following steps to test this PR:
mkdir mqtt-config
echo 'edgex:$6$OV0KYbPEN4xbWLt9$MkEhwMRMZ8tTYvrlKHnUmZDJtzJGN1RcKNnoM1jNm7zzSgwQo9M0aAAB/8oTqCSQyVy1a42L7jO9xOsuNC9uhg==' > mqtt-config/passwords
echo 'allow_anonymous false' > mqtt-config/mosquitto.conf
echo 'password_file /mosquitto/config/passwords' >> mqtt-config/mosquitto.conf
ADD_SECRETSTORE_TOKENS: "device-mqtt"
to Vault Work in compose file.make run
edge
and Password ispassword
sudo WRITABLE_LOGLEVEL=DEBUG EDGEX_SECURITY_SECRET_STORE=true ./device-mqtt -c ./res/example
Using Secrets URL of
http://localhost:8200/v1/secret/edgex/device-mqtt/credentials`10 Store MQTT credentials
Driver.CredentialsRetryTime
settinghttp://localhost:49982/api/v2/secret
DataTopic
topic"SendEvent: Pushed event to core data"
should be logged.localhost:48080/api//v1/reading/name/message/0
Other information