-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for minimum TLS version for opa server #3517
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.
😃 That's great, I like this. 🚀
Some questions and nitpicks inline 🙃
eec8ea5
to
2997f32
Compare
@srenatus @anderseknert does this look good? |
@kale-amruta having another look just now 😃 |
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 bearing with me, this looks good!
Besides some tiny newline nitpicks, I'm wondering about the use of flags in the e2e tests, could you have a look at my inline comments, please? 😃
// print error to stderr, exit 1 | ||
func fatal(err interface{}) { | ||
fmt.Fprintf(os.Stderr, "%s\n", err) | ||
os.Exit(1) | ||
} | ||
|
||
func TestMain(m *testing.M) { | ||
minTLSVersion := flag.String("--min-TLS-Version", "1.2", "minimum TLS Version") | ||
TLSVersion := minTLSVersions[*minTLSVersion] |
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.
Hrmm I don't quite understand why we're going through flag here. It seems quite indirect, and if this is why we need to mess with os.Args
below, I'd rather keep looking for a different solution. (If this style is consistent with the other e2e tests, which I haven't check yet, please ignore me 😅)
I suppose we could set testServerParams.MinTLSVersion
directly. If we need a different value for the other test below, could we change that field...?
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.
@srenatus all the tests in tls_test.go run through same opa server instance.
We have two set of testcases -
- default tls version set for server
- TLS1.3 set for server as implemented here
Hence to pass minTLSVersion to testServerParams through TestMain at runtime, I had to use os.Args, else I would have had to create two different servers for these testcases
Note: This flag is different from the one defined on server, its added to run the test with the command line parameter
Opa server now supports min TLS version, TLS versions supported are 1.0, 1.1, 1.2, 1.3. Since TLS 1.0 and 1.1 are deprecated, default min TLS version for opa is TLS 1.2 but if someone wants to restrict opa to use a specific minimum TLS version, they can specify it using cmd parameter --min-tls-version fixes open-policy-agent#3226 Signed-off-by: Amruta Kale <amruta.kale@styra.com>
Signed-off-by: Amruta Kale <amruta.kale@styra.com>
Signed-off-by: Amruta Kale <amruta.kale@styra.com>
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.
Will merge when green. Thanks for implementing this, it's great to have such a feature with a good default 👍
awesome. Thanks @srenatus |
…y-agent#3517) * Support for minimum TLS version OPA server now supports min TLS version, TLS versions supported are 1.0, 1.1, 1.2, 1.3. Since TLS 1.0 and 1.1 are deprecated, default min TLS version for OPA is TLS 1.2 but if someone wants to restrict OPA to use a specific minimum TLS version, they can specify it using cmd parameter `--min-tls-version`. Fixes open-policy-agent#3226. Signed-off-by: Amruta Kale <amruta.kale@styra.com>
Opa server now supports minimum TLS version. Since TLS 1.0 and 1.1 are deprecated, default minimum TLS version for opa server is TLS 1.2 . If someone wants to restrict opa to start with a specific minimum tls version, they can specify it using cmd line parameter --min-tls-version. TLS versions supported are 1.0, 1.1, 1.2, 1.3.
fixes #3226
Signed-off-by: Amruta Kale amruta.kale@styra.com