-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP] Add the secrets management documentation #11396
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
Conversation
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.
just some little reviews :)
found some typo as well, but as the PR is WIP, I just wanted to review the idea
cc @mpdude as you wrote a blog post about this at EUFOSSA, you probably are interested in reviewing this as well 😃 |
1ae8ee6
to
526e6ec
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.
only typos for now
3dc07e9
to
ffbf04c
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 this feature, it's really awsome !
Comments addressed. Thanks for the review @noniagriconomie, @Simperfit and @javiereguiluz |
6443d0e
to
713dd02
Compare
69c8b5e
to
2746a57
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.
Nice :)
1f7105e
to
f656516
Compare
…ecret:...)%` processor to deal with secrets seamlessly (Tobion, jderusse, nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Add `secrets:*` commands and `%env(secret:...)%` processor to deal with secrets seamlessly | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #27351 | License | MIT | Doc PR | symfony/symfony-docs/pull/11396 This PR continues #31101, please see there for previous discussions. The attached patch has been fine-tuned on nicolas-grekas#33 with @jderusse. This PR is more opinionated and thus a lot simpler than #31101: only Sodium is supported to encrypt/decrypt (polyfill possible), and only local filesystem is available as a storage, with little to no extension point. That's on purpose: the goal here is to provide an experience, not software building blocks. In 5.1, this might be extended and might lead to a new component, but we'd first need reports from real-world needs. Having this straight-to-the-point in 4.4 will allow gathering these needs (if they exist) and will immediately provide a nice workflow for the need we do want to solve now: forwarding secrets from dev to prod using git in a secure way. The workflow this will allow is the following: - public/private key pairs are generated in the `config/secrets/%kernel.environment%/` folder using `bin/console secrets:generate-keys` - for the prod env, the corresponding private key should be deployed to the server using whatever means the hosting provider allows - this key MUST NOT be committed - the public key is used to encrypt secrets and thus *may* be committed in the git repository to allow anyone *that can commit* to add secrets - this is done using `bin/console secrets:set` DI configuration can reference secrets using `%env(secret:...)%` in e.g `services.yaml`. There is also `bin/console secrets:remove` and `bin/console debug:secrets` to complete the toolbox. In terms of design, vs #31101, this groups the dual "encoder" + "storage" concepts in a single "vault" one. That's part of what makes this PR simpler. That's all folks :) Commits ------- c4653e1 Restrict secrets management to sodium+filesystem 02b5d74 Add secrets management 8c8f623 Proof of concept for encrypted secrets
Just dropping a note - need to talk about symfony/symfony#34295 (comment) (should be added before @jderusse if it's cool with you, I can "take over" this PR soon, review it, and finish it. Nicolas has been keeping me up to date with the latest secrets tweaks, so I have an understanding of the current state. |
@weaverryan Feel free to change that PR. beware, many thing are changing right now it the PR you gave |
Hi! What is the status of this PR? I would really like to have documentation on the great secrets management feature. Even if it's not complete, if what is in here is correct, I think we should merge it asap. We can then create more PRs and issues to document the missing bits. |
@weaverryan Are you still working on this? Should I rebase and update my PR? |
I'm working on this - will get it done shortly - it's a big priority for me too :). I don't want to merge as-is, because much changed in the late stages of the feature, so I'm worried it's not accurate enough to be there yet. |
Local secrets | ||
------------- | ||
|
||
It's common for developpers to use their own privates secrets (for |
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.
It's common for developpers to use their own privates secrets (for | |
It's common for developers to use their own privates secrets (for |
Local secrets | ||
------------- | ||
|
||
It's common for developpers to use their own privates secrets (for |
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.
It's common for developpers to use their own privates secrets (for | |
It's common for developpers to use their own private secrets (for |
|
||
.. code-block:: terminal | ||
|
||
$ php bin/console secrets:remove DATABASE_PASSWORD |
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.
$ php bin/console secrets:remove DATABASE_PASSWORD | |
$ php bin/console secrets:list DATABASE_PASSWORD |
Finished finally (sorry!) over at #12958 |
…rryan) This PR was merged into the 4.4 branch. Discussion ---------- Symfony 4.4 secrets management system Hi! This completes #11396 I also made some changes to the section in `configuration.rst` about environment variables to make sure that it read well with the secrets stuff. Thanks to @jderusse for doing the vast majority of the work. Cheers! Commits ------- cd066cc tweaks thanks to review 75e5ae6 finishing the secrets documentation 82d2058 Add the secret documentation
This is a drat of the new secret management defined during the EU-FOSSA hackathon .
The PR is not yet ready, but would give an idea how it works