cert-manager / trust-manager

trust-manager is an operator for distributing trust bundles across a Kubernetes cluster.
https://cert-manager.io/docs/projects/trust-manager/
Apache License 2.0
244 stars 66 forks source link

Add pkcs12 password feature #229

Closed arsenalzp closed 10 months ago

arsenalzp commented 10 months ago

This PR is related to the issue #199 It add PKCS12 arbitrary password feature which allows to set a password for PKCS12 bundle as well as don't remove password-less PKCS12 feature.

jetstack-bot commented 10 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign munnerz for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/cert-manager/trust-manager/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jetstack-bot commented 10 months ago

Hi @arsenalzp. Thanks for your PR.

I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
arsenalzp commented 10 months ago

Hello, Your remarks were fixed. Could you please be so kind to review PR again?

arsenalzp commented 10 months ago

https://github.com/cert-manager/trust-manager/pull/229#discussion_r1391343196

I guess it makes code more clear and avoid of copying bundle data between function/method. The bundle data is tightly coupled to its encoder; imagine you would like to add decode(), transform() methods in the future, then it leads that the bundle data should be returned from one encoder method and immediately consumed by another one.

arsenalzp commented 10 months ago

Hello colleagues, Sorry that I'm disturbing you again. Any decision regarding this PR? Should I change/fix something?

erikgb commented 10 months ago

Should I change/fix something?

Fields or function params is not a blocker for me. I prefer function params, but. Maybe you can fix (and close) the other open discussions? So we are left with just that point to land?

SgtCoDFish commented 10 months ago

This is a drive-by comment and I don't have time to fully review but I think I'm negative on adding this as a command-line flag.

This maps neatly to being added in the resource, which is where I'd expect to be able to set it:

{
  "apiVersion": "trust.cert-manager.io/v1alpha1",
  "kind": "Bundle",
  "metadata": {
    "name": "testing"
  },
  "spec": {
    "sources": [
      {
        "useDefaultCAs": true
      }
    ],
    "target": {
      "additionalFormats": {
        "jks": {
          "key": "my-bundle.jks",
          "password": "super_secret",
        }
      },
      "configMap": {
        "key": "mybundle.pem"
      }
    }
  }
}

Putting myself in the shoes of a user, I'd be familar with the concept that each JKS file can have a different password. I'd expect trust-manager to work the same way as that.

Obviously today we have one global setting for the password, but that's just because the JKS files need some password, not because the setting should be global to all bundles.

I can't really see a reason for this to be a CLI flag.

arsenalzp commented 10 months ago

This is a drive-by comment and I don't have time to fully review but I think I'm negative on adding this as a command-line flag.

This maps neatly to being added in the resource, which is where I'd expect to be able to set it:

{
  "apiVersion": "trust.cert-manager.io/v1alpha1",
  "kind": "Bundle",
  "metadata": {
    "name": "testing"
  },
  "spec": {
    "sources": [
      {
        "useDefaultCAs": true
      }
    ],
    "target": {
      "additionalFormats": {
        "jks": {
          "key": "my-bundle.jks",
          "password": "super_secret",
        }
      },
      "configMap": {
        "key": "mybundle.pem"
      }
    }
  }
}

Putting myself in the shoes of a user, I'd be familar with the concept that each JKS file can have a different password. I'd expect trust-manager to work the same way as that.

Obviously today we have one global setting for the password, but that's just because the JKS files need some password, not because the setting should be global to all bundles.

I can't really see a reason for this to be a CLI flag.

Hello, It was proposed to do it globally for entire cluster. However, if someone has different point of view, let's discuss this topic; it is no so hard to rewrite this solution. In case we accept your point of view, I would move password parameter upper in the Bundle resource, because pksc12 and jks are two formats of the same bundle, I don't expect customer wants to have different password for each format of the same bundle.

arsenalzp commented 10 months ago

Another PR #233 related to @SgtCoDFish was submitted.

jetstack-bot commented 10 months ago

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

:memo: Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
jetstack-bot commented 10 months ago

@arsenalzp: 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
pull-trust-manager-verify 2d4b1fafb956ea0b778b05980fe44a1c3ef729e2 link true /test pull-trust-manager-verify
pull-trust-manager-smoke 2d4b1fafb956ea0b778b05980fe44a1c3ef729e2 link true /test pull-trust-manager-smoke

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).