-
Notifications
You must be signed in to change notification settings - Fork 599
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(pgwire): expose SSL functionality via RW_SSL_CERT and RW_SSL_KEY #14062
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.
After this PR, SSL can work?
With a certificate with a localhost sign, I used psql to test it and it works. For on-prem users, they need to configure these environment variables by themselves. However, for cloud users, we have a proxy to provide TLS/SSL functionality.
|
cc @mikechesterwang Could you please take a look based on your experience on SSL proxy? |
src/utils/pgwire/src/pg_protocol.rs
Outdated
let cert = if let Ok(cert) = std::env::var("RW_SSL_CERT") { | ||
PathBuf::from(cert) | ||
} else { | ||
PathBuf::new().join("src/utils/pgwire").join("tests/ssl/demo.crt") |
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.
Should this be test-only? If so, should we instead pass None
here if they're unset?
risingwave/src/frontend/src/lib.rs
Line 161 in 6286ddd
pg_serve(&listen_addr, session_mgr, Some(TlsConfig::new_default())) |
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.
According to #5775 @wangrunji0408 do you know whether we still use SSL in deterministic tests?
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.
If it's believed okay to use "demo" cert in production, then we may consider embedding the contents with include_bytes
and create a temp file at runtime. Specifying a relative path towards the source code directory sounds too fragile to me. 😕
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.
If we don't use it anymore, I will remove those test purpose codes.
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.
According to #5775 @wangrunji0408 do you know whether we still use SSL in deterministic tests?
I remember SSL is always disabled in deterministic tests.
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
7648819 | Generic Private Key | 717e7bb | src/utils/pgwire/tests/ssl/demo.key | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #14062 +/- ##
==========================================
- Coverage 68.06% 68.05% -0.01%
==========================================
Files 1548 1548
Lines 267489 267482 -7
==========================================
- Hits 182064 182033 -31
- Misses 85425 85449 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.