Skip to content
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

Propagate TLSSecurityProfile to Kubevirt #2089

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

tiraboschi
Copy link
Member

Propagate TLSSecurityProfile to Kubevirt
translating the configuration to its internal
API.
Add unit tests.

Reviewer Checklist

Reviewers are supposed to review the PR for every aspect below one by one. To check an item means the PR is either "OK" or "Not Applicable" in terms of that item. All items are supposed to be checked before merging a PR.

  • PR Message
  • Commit Messages
  • How to test
  • Unit Tests
  • Functional Tests
  • User Documentation
  • Developer Documentation
  • Upgrade Scenario
  • Uninstallation Scenario
  • Backward Compatibility
  • Troubleshooting Friendly

Release note:

Propagate TLSSecurityProfile to Kubevirt

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XL labels Sep 20, 2022
@tiraboschi
Copy link
Member Author

this temporanearly relies on untagged Kubevirt from main while we wait for v0.58.0,
avoid merging it.
/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2022
@coveralls
Copy link
Collaborator

coveralls commented Sep 20, 2022

Pull Request Test Coverage Report for Build 3180091894

  • 27 of 31 (87.1%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 85.333%

Changes Missing Coverage Covered Lines Changed/Added Lines %
controllers/operands/kubevirt.go 27 31 87.1%
Totals Coverage Status
Change from base Build 3180046382: 0.01%
Covered Lines: 4608
Relevant Lines: 5400

💛 - Coveralls

@tiraboschi tiraboschi force-pushed the virt_crypto_policy branch 2 times, most recently from c9d4660 to aa0745e Compare September 21, 2022 15:17
@tiraboschi
Copy link
Member Author

/rebase

@tiraboschi
Copy link
Member Author

/retest

2 similar comments
@tiraboschi
Copy link
Member Author

/retest

@tiraboschi
Copy link
Member Author

/retest

Copy link
Contributor

@fossedihelm fossedihelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I know this is temporary, but in the meanwhile, I left two small comments. Thanks

controllers/operands/kubevirt_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fossedihelm fossedihelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tiraboschi! Looks good overall. I have a doubt about how HCO handles wrong tls configurations. Thanks

}

if profile.Custom != nil {
profileCiphers = profile.Custom.TLSProfileSpec.Ciphers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a check that prevents to specify ciphers when using 1.3 as minTLSVersion?
1.3 ciphers will be skipped by crypto.OpenSSLToIANACipherSuites(profileCiphers) and this is ok;
but what happens if a user uses a wrong configuration? i.e. if I specify

minTLSVersion: VersionTLS13,
ciphers: <one compatible tls1.2 cipher>

this will result in a reject from kv webhook.
More in general, the question is: how hco handle wrong custom configurations?
Thanks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HCO webhook is always going to try validating each change with all the components in dry-run mode, so each configuration change will be accepted only if all the components are going to accept it.
On the other side, if kv webhook will refuse the change, HCO webhook will refuse as a consequence.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clear explanation. In the light of that, it seems to me that everything is great! How about adding a test for this? WDYT? Or is it already tested in another place? Thanks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not on this specific failure from kw webhook, but in general the mechanism is already tested in validator_test.go,
see: should return error if dry-run update of KV CR returns error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great! No other objection. Thanks

@fossedihelm
Copy link
Contributor

fossedihelm commented Sep 28, 2022

@tiraboschi Feel free to ping me for a lgtm when the PR is ready. Thanks!

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 28, 2022
Propagate TLSSecurityProfile to Kubevirt
translating the configuration to its internal
API.
Add unit tests.

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@kubevirt-bot kubevirt-bot added size/L and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL labels Oct 4, 2022
@sonarcloud
Copy link

sonarcloud bot commented Oct 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tiraboschi
Copy link
Member Author

/unhold
@fossedihelm ping: we should be ready consuming Kubevirt v0.58.0-rc.0

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 2022
@hco-bot
Copy link
Collaborator

hco-bot commented Oct 4, 2022

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-aws

In response to this:

hco-e2e-image-index-gcp lane succeeded.
/override ci/prow/hco-e2e-image-index-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tiraboschi
Copy link
Member Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Oct 4, 2022

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Oct 4, 2022

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-sno-aws

In response to this:

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Oct 4, 2022

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-sno-aws

In response to this:

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tiraboschi
Copy link
Member Author

/override-bot

@hco-bot
Copy link
Collaborator

hco-bot commented Oct 4, 2022

hco-e2e-upgrade-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-aws

In response to this:

hco-e2e-upgrade-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tiraboschi
Copy link
Member Author

/override-bot

@tiraboschi
Copy link
Member Author

/retest

@fossedihelm
Copy link
Contributor

Thanks
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2022
@openshift-ci
Copy link

openshift-ci bot commented Oct 4, 2022

@tiraboschi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-hco-e2e-image-index-gcp 2a45128058cb92ff5e4463d74b9a0595267ce0f1 link true /test okd-hco-e2e-image-index-gcp
ci/prow/okd-hco-e2e-upgrade-index-gcp 2a45128058cb92ff5e4463d74b9a0595267ce0f1 link true /test okd-hco-e2e-upgrade-index-gcp
ci/prow/okd-hco-e2e-image-index-aws 2a45128058cb92ff5e4463d74b9a0595267ce0f1 link true /test okd-hco-e2e-image-index-aws
ci/prow/hco-e2e-image-index-aws 5c8e893 link true /test hco-e2e-image-index-aws
ci/prow/hco-e2e-kv-smoke-azure 5c8e893 link true /test hco-e2e-kv-smoke-azure
ci/prow/hco-e2e-image-index-sno-aws 5c8e893 link false /test hco-e2e-image-index-sno-aws
ci/prow/hco-e2e-upgrade-index-sno-aws 5c8e893 link false /test hco-e2e-upgrade-index-sno-aws
ci/prow/hco-e2e-upgrade-index-aws 5c8e893 link true /test hco-e2e-upgrade-index-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@tiraboschi
Copy link
Member Author

/retest

@tiraboschi
Copy link
Member Author

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tiraboschi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 5, 2022
@kubevirt-bot kubevirt-bot merged commit 9046f3f into kubevirt:main Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants