-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(conf): allow *_cert and *_cert_key to be stored in environment variables and vaults #9253
Merged
Conversation
This file contains 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
bungle
force-pushed
the
feat/conf-certs-env-and-vaults
branch
from
August 19, 2022 10:50
ef340f5
to
1c17b18
Compare
bungle
force-pushed
the
feat/conf-certs-env-and-vaults
branch
from
August 26, 2022 10:50
1c17b18
to
d13f432
Compare
bungle
force-pushed
the
feat/conf-certs-env-and-vaults
branch
from
September 2, 2022 13:18
2990779
to
2f595c2
Compare
bungle
force-pushed
the
feat/conf-certs-env-and-vaults
branch
from
September 13, 2022 06:52
1fc5f70
to
78ab363
Compare
bungle
force-pushed
the
feat/conf-certs-env-and-vaults
branch
from
September 13, 2022 08:32
9ab96cf
to
fd0df1e
Compare
hbagdi
reviewed
Sep 20, 2022
bungle
changed the title
feat(conf) allow *_cert and *_cert_key to be stored in environment variables and vaults
feat(conf): allow *_cert and *_cert_key to be stored in environment variables and vaults
Sep 23, 2022
…ariables and vaults ### Summary Allow several `kong.conf` values to be stored in vaults or environment variables: - `ssl_cert` - `ssl_cert_key` - `admin_ssl_cert` - `admin_ssl_cert_key` - `status_ssl_cert` - `status_ssl_cert_key` - `cluster_cert` - `cluster_cert_key` - `client_ssl_cert` - `client_ssl_cert_key` #### Usage The following is possible after this is commit is merged: ```bash CERT=$(<cert.crt) \ # normal environment variable intialized from file KONG_SSL_CERT="{vault://env/cert}" \ # a secret reference using env vault KONG_SSL_CERT_KEY="$(<cert.key)" \ # reading content of file to env var kong start ```
* move creation of certificate and key files in a separate block * add file creation for the remaining certs and keys: cluster_ and client_ * update configuration with generated path for cluster_* and client_*
* support base64 encoded *_cert and *_cert_key * support base64url encoding This adds a test case to ensure base64 encoded properties are corectly parsed and decoded.
…cate This adds to the supported properties that can be assigned via environment variables or vault.
* test all base64 decodings * test that properties passed as content result in files being stored
* base64 conversion is moved later in the flow in order to make it safer, so that values like system are not attempted to be decoded * test coverage for the content of the created files * refactoring
Update kong.conf.default to reflect the fact some properties can be configured directly via content or base64
bungle
force-pushed
the
feat/conf-certs-env-and-vaults
branch
from
October 4, 2022 10:57
fd0df1e
to
f87af24
Compare
bungle
commented
Oct 4, 2022
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, cannot approve this as I originally opened it.
yzyyi
approved these changes
Oct 4, 2022
Would you also cherrypick this to EE for parity? thanks |
locao
pushed a commit
that referenced
this pull request
Jun 21, 2024
…group is absent (#9253) Cherry-picked from #13024 Fix #13014, https://konghq.atlassian.net/browse/KAG-4474 Co-authored-by: hulk <hulk.website@gmail.com> Co-authored-by: Xumin <100666470+StarlightIbuki@users.noreply.github.com> Co-authored-by: Chrono <chronolaw@gmail.com> Co-authored-by: Mikołaj Nowak <mikolaj.nowak93@gmail.com> Co-authored-by: xumin <xumin.zhou@konghq.com>
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.
Summary
Allow several
kong.conf
values to be stored in vaults or environment variables:ssl_cert
ssl_cert_key
admin_ssl_cert
admin_ssl_cert_key
status_ssl_cert
status_ssl_cert_key
cluster_cert
cluster_cert_key
client_ssl_cert
client_ssl_cert_key
cluster_ca_cert
ssl_dhparam
lua_ssl_trusted_certificate
Usage
The following is possible after this is commit is merged:
(FT-3244)