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

SECURITY: Kubeclient::Config: return ssl_options[:verify_ssl] correctly #557

Merged
merged 20 commits into from
Mar 23, 2022

Commits on Mar 14, 2022

  1. Merge pull request ManageIQ#545 from cben/v4.y-test_real_cluster_ssl_…

    …verify
    
    [v4.y] Test VERIFY_PEER / VERIFY_NONE work against real cluster
    cben authored Mar 14, 2022
    Configuration menu
    Copy the full SHA
    b6d9098 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2022

  1. Configuration menu
    Copy the full SHA
    7c27fae View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2022

  1. Tests for concatenated CA data (ManageIQ#460)

    Test sandwitches the real CA cert between two unrelated CA certs
    (another-ca1.pem, another-ca2.pem, simply copied from two runs of
    update_certs_k0s.rb).
    No test for root+intermediate scenario.
    
    Fails before the backport of ManageIQ#461:
    
    KubeclientConfigTest#test_concatenated_ca [/home/beni/kubeclient/test/test_config.rb:196]:
    Expected false to be truthy.
    
    (some experimenting with order suggests only first cert is honored.)
    Passes with the fix.
    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    7c331c1 View commit details
    Browse the repository at this point in the history
  2. Merge pull request ManageIQ#461 from PerfectMemory/openssl-x509-store…

    …-add-file
    
    Load cluster ca certificates using OpenSSL::X509::Store#add_file
    
    (cherry picked from commit 53408c1)
    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    d1cd26d View commit details
    Browse the repository at this point in the history
  3. Changelog for fix for ManageIQ#460

    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    2dd7f64 View commit details
    Browse the repository at this point in the history
  4. [v4.y] CI: don't abort other builds when one fails error

    - Helps confirm suspected OS-specific failures.
    - Normally when one build fails, most other builds already started and
      some almost complete `bundle install` / started tests.
      So it's not a big "waste" expensive to let them finish, arguably it's
      actually a waste to abort them! (sunken cost fallacy? :-)
    - In case rubocop complains, while I do consider it a merge blocker,
      it's better contributor (and maintainer) experience to also see test results.
    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    b1824ed View commit details
    Browse the repository at this point in the history
  5. Merge pull request ManageIQ#552 from cben/v4.y-openssl-x509-store-add…

    …-file
    
    [v4.y] Load cluster ca certificates using OpenSSL::X509::Store#add_file
    cben authored Mar 23, 2022
    Configuration menu
    Copy the full SHA
    e05c715 View commit details
    Browse the repository at this point in the history
  6. SECURITY: Kubeclient::Config: return ssl_options[:verify_ssl] correctly

    - VULNERABILITY FIX: Previously, whenever kubeconfig did not define
      custom CA (normal situation for production clusters with public domain
      and certificate!), `Config` was returning hard-coded `VERIFY_NONE` :-(
    
      Assuming you passed those ssl_options to Kubeclient::Client,
      this means that instead of checking server's certificate against
      your system CA store, it would accept ANY certificate, allowing easy
      man-in-the middle attacks.
    
      This is especially dangerous with user/password or token credentials
      because MITM attacker could simply steal those credentials to the
      cluster and do anything you could do on the cluster.
    
    - Bug fix: kubeconfig `insecure-skip-tls-verify` field was ignored.
      When kubeconfig did define custom CA, `Config` was returning hard-coded
      `VERIFY_PEER`.
    
      Now we honor it, return `VERIFY_NONE` iff kubeconfig has explicit
      `insecure-skip-tls-verify: true`, otherwise `VERIFY_PEER`.
    
    These don't affect code that supplies `Client` parameters directly,
    only code that uses `Config`.
    
    (To ease back-porting, this commit is rebased directly on the 6-year-old
    PR that introduced Kubeclient::Config - this was broken from day 1!
    ManageIQ#127
    Tests come in separate commits based on later points.)
    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    88483cf View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f61a4e1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5086eb8 View commit details
    Browse the repository at this point in the history
  9. SECURITY: unit tests for Kubeclient::Config handling of ssl_options[:…

    …verify_ssl]
    
    - Removed `insecure-skip-tls-verify: true` from most test configs
      (that was one of the reasons the bug went unnoticed, VERIFY_NONE
      was what the unit tests expected.)
    
    - Added new kubeconfig files + `Config` unit tests covering:
      - custom CA, omitted `insecure-skip-tls-verify`
      - custom CA, `insecure-skip-tls-verify: false`
      - custom CA, `insecure-skip-tls-verify: true`
      - no custom CA, omitted `insecure-skip-tls-verify`
      - no custom CA, `insecure-skip-tls-verify: false`
      - no custom CA, `insecure-skip-tls-verify: true`
    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    c21e2b5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    aa36e89 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e4cb727 View commit details
    Browse the repository at this point in the history
  12. Merge pull request ManageIQ#556 from cben/v4.y-security-config-ssl_ve…

    …rify
    
    [v4.y] SECURITY: Kubeclient::Config: return ssl_options[:verify_ssl] correctly
    cben authored Mar 23, 2022
    Configuration menu
    Copy the full SHA
    109ea71 View commit details
    Browse the repository at this point in the history
  13. Bump kubeclient to 4.9.3

    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    d7bc03d View commit details
    Browse the repository at this point in the history
  14. Merge pull request ManageIQ#558 from cben/release-4.9.3

    Releasing 4.9.3
    cben authored Mar 23, 2022
    Configuration menu
    Copy the full SHA
    c27893f View commit details
    Browse the repository at this point in the history
  15. CHANGELOG and README fixups about ManageIQ#554, ManageIQ#555

    Tiny followup to ManageIQ#556.
    Sorry for noise, had these locally but forgot to push before merging.
    If I start backporting, CHANGELOG.md on master branch might not always be updated
    with all backports (it SHOULD, but it will require separate merges to master).
    So I prefer pointing to the vulnerability issue as the "source of truth".
    Also, security impact will be better discussed on the issue.
    cben committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    6670fab View commit details
    Browse the repository at this point in the history
  16. Merge pull request ManageIQ#559 from cben/v4.y-security-config-ssl_ve…

    …rify-changelog
    
    fixup CHANGELOG and README about ManageIQ#554, ManageIQ#555
    cben authored Mar 23, 2022
    Configuration menu
    Copy the full SHA
    2d241e3 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    d6d1ee8 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    55709fa View commit details
    Browse the repository at this point in the history