-
Notifications
You must be signed in to change notification settings - Fork 591
NE-2334: Implement enhancement in OpenShift API to support for TLS curves in TLSProfile #2583
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
Open
davidesalerno
wants to merge
5
commits into
openshift:master
Choose a base branch
from
davidesalerno:addCurvesForECDH
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3e571ab
NE-2334: Implement enhancement in OpenShift API to support for TLS cu…
davidesalerno 96b5d34
Update config/v1/types_tlssecurityprofile.go
davidesalerno 807ec68
Add feature gate test to verify that curves could be omitted
davidesalerno 26f6dc6
make update
davidesalerno b678623
make update after rebase
davidesalerno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
349 changes: 349 additions & 0 deletions
349
config/v1/tests/apiservers.config.openshift.io/TLSCurvePreferences.yaml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,349 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| name: "APIServer" | ||
| crdName: apiservers.config.openshift.io | ||
| featureGates: | ||
| - TLSCurvePreferences | ||
| tests: | ||
| onCreate: | ||
| - name: Should be able to create with Custom TLS profile and curves | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| - TLS_AES_256_GCM_SHA384 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| - TLS_AES_256_GCM_SHA384 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| - name: Should be able to create with all supported curves | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| - SecP384r1 | ||
| - SecP521r1 | ||
| - X25519MLKEM768 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| - SecP384r1 | ||
| - SecP521r1 | ||
| - X25519MLKEM768 | ||
| - name: Should fail to create with Custom TLS profile and empty curves | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: [] | ||
| expectedError: "spec.tlsSecurityProfile.custom.curves in body should have at least 1 items" | ||
| - name: Should be able to create with Custom TLS profile and curves omitted | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| - name: Should be able to create with Custom TLS profile VersionTLS10 and curves | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS10 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - SecP256r1 | ||
| - SecP384r1 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS10 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - SecP256r1 | ||
| - SecP384r1 | ||
| - name: Should be able to create with Custom TLS profile VersionTLS11 and curves | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS11 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - SecP384r1 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS11 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - SecP384r1 | ||
| - name: Should fail to create with more than 5 curves | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| - SecP384r1 | ||
| - SecP521r1 | ||
| - X25519MLKEM768 | ||
| - X25519 | ||
| expectedError: "spec.tlsSecurityProfile.custom.curves: Too many: 6: must have at most 5 items" | ||
| - name: Should fail to create with invalid curve value | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - InvalidCurve | ||
| expectedError: "spec.tlsSecurityProfile.custom.curves[0]: Unsupported value: \"InvalidCurve\": supported values: \"X25519\", \"SecP256r1\", \"SecP384r1\", \"SecP521r1\", \"X25519MLKEM768\"" | ||
| onUpdate: | ||
| - name: Should be able to add curves to existing Custom TLS profile | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| - name: Should be able to update curves in existing Custom TLS profile | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - SecP256r1 | ||
| - SecP384r1 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - SecP256r1 | ||
| - SecP384r1 | ||
| - name: Should be able to remove curves field from existing Custom TLS profile | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| - name: Should fail to remove all curves from existing Custom TLS profile | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: | ||
| - X25519 | ||
| - SecP256r1 | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: APIServer | ||
| spec: | ||
| audit: | ||
| profile: Default | ||
| tlsSecurityProfile: | ||
| type: Custom | ||
| custom: | ||
| minTLSVersion: VersionTLS12 | ||
| ciphers: | ||
| - TLS_AES_128_GCM_SHA256 | ||
| curves: [] | ||
| expectedError: "spec.tlsSecurityProfile.custom.curves in body should have at least 1 items" | ||
Oops, something went wrong.
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.
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 you just remove the field, is this allowed?
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 looks like it is. Lets add a test that removing the field altogether is allowed