Skip to content

adds option to specify CRL Distribution Point. #2612#2625

Merged
jetstack-bot merged 2 commits intocert-manager:masterfrom
skra-space:crl
Mar 23, 2020
Merged

adds option to specify CRL Distribution Point. #2612#2625
jetstack-bot merged 2 commits intocert-manager:masterfrom
skra-space:crl

Conversation

@skra-space
Copy link
Copy Markdown
Contributor

@skra-space skra-space commented Feb 25, 2020

What this PR does / why we need it:
WIP adds option to specify CRL Distribution Point. Proposal

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #2612

Special notes for your reviewer:
Here is only changes for API and self-signed. I also have plan for Vault but didn't implement it.
Release note:

Added 'CRL Distribution Points' fields to Self-signed and CA issuers

@jetstack-bot jetstack-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration labels Feb 25, 2020
@jetstack-bot jetstack-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 25, 2020
@jetstack-bot
Copy link
Copy Markdown
Contributor

Hi @srbraun. Thanks for your PR.

I'm waiting for a jetstack or 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.

Details

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.

@jetstack-bot jetstack-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 2, 2020
Signed-off-by: srBraun <dev@skra.space>
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Mar 2, 2020
@munnerz
Copy link
Copy Markdown
Member

munnerz commented Mar 3, 2020

/ok-to-test

@jetstack-bot jetstack-bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 3, 2020
@skra-space
Copy link
Copy Markdown
Contributor Author

/retest


type SelfSignedIssuer struct{}
type SelfSignedIssuer struct {
CRLDistributionPoints []string `json:"crlDistributionPoints,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a comment on this field explaining:

  • What it does
  • What values are valid
  • What the default behaviour is if not specified

You should also have a // +optional line (similar to some other fields in this file) as the field is optional 😄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This text is displayed to users through both our docs and kubectl explain so it really helps to provide clearly information about fields and how they should be used 😄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, we can also include // +kubebuilder:validation:UniqueItems here too to avoid users specifying duplicates.. not sure if it's strictly required, but it's easier to relax validation in future than it is to enforce additional validation 😄

@munnerz
Copy link
Copy Markdown
Member

munnerz commented Mar 11, 2020

This is looking good. Are there any restrictions/requirements around the format for these strings? Do they have to be URLs? If so, we should add validation to check that invalid values are not entered 😄

@munnerz
Copy link
Copy Markdown
Member

munnerz commented Mar 11, 2020

Also: would it be possible to extend this PR to support the 'CA' issuer type in a similar way? The implementation of these two issuers are very similar, so it shouldn't require too much extra code to do it 😄

@skra-space
Copy link
Copy Markdown
Contributor Author

skra-space commented Mar 11, 2020

Also: would it be possible to extend this PR to support the 'CA' issuer type in a similar way? The implementation of these two issuers are very similar, so it shouldn't require too much extra code to do it smile

Yes, I will add support for CDP to 'CA' issuer. I am currently working on it. I just wanted to show you what I have first. I will work through your comments and prepare a full PR.

Thank you for the review.

@munnerz munnerz added this to the v0.15 milestone Mar 13, 2020
@jetstack-bot jetstack-bot added dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 19, 2020
Signed-off-by: Sergey Braun <dev@skra.space>
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Mar 19, 2020
@skra-space skra-space changed the title WIP adds option to specify CRL Distribution Point. #2612 adds option to specify CRL Distribution Point. #2612 Mar 19, 2020
@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 19, 2020
@skra-space skra-space requested a review from munnerz March 19, 2020 12:01
Copy link
Copy Markdown
Member

@munnerz munnerz left a comment

Choose a reason for hiding this comment

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

Only one more comment... it'd also be good if we could also add a // +kubebuilder:validation:Pattern here to restrict the types of values users can specify. I'm not 100% certain on what a good regex for this would be, as I imagine we'd have to support a variety of different URL formats (e.g. here you can see URLs starting with ldap:/// and containing commas: https://www.sysadmins.lv/blog-en/designing-crl-distribution-points-and-authority-information-access-locations.aspx).


type SelfSignedIssuer struct{}
type SelfSignedIssuer struct {
CRLDistributionPoints []string `json:"crlDistributionPoints,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, we can also include // +kubebuilder:validation:UniqueItems here too to avoid users specifying duplicates.. not sure if it's strictly required, but it's easier to relax validation in future than it is to enforce additional validation 😄

@skra-space
Copy link
Copy Markdown
Contributor Author

Only one more comment... it'd also be good if we could also add a // +kubebuilder:validation:Pattern here to restrict the types of values users can specify.

I am not sure how to validate it. According to RFC 5280, CDP name can be directory name or path relative to CRL issuer. In x509 go lib, CDP is an array of strings.

@munnerz
Copy link
Copy Markdown
Member

munnerz commented Mar 20, 2020

This all looks good, we can look into tightening validation after this merges as I think it may require us to bump our controller-tools dependency 😄

Would you be able to open a PR against the docs repo to note this new option, in both the selfsigned and ca issuer documentation? If you open the PR against the release-next branch so that it is included as part of the 'next' release documentation 😄

https://github.com/cert-manager/website/blob/release-next/content/en/docs/configuration/selfsigned.md && https://github.com/cert-manager/website/blob/release-next/content/en/docs/configuration/ca.md

/lgtm
/approve
/hold
/milestone v0.15
/kind feature

@jetstack-bot jetstack-bot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Mar 20, 2020
@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2020
@jetstack-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: munnerz, srbraun

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

The pull request process is described here

Details 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

@jetstack-bot jetstack-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 20, 2020
@munnerz
Copy link
Copy Markdown
Member

munnerz commented Mar 23, 2020

/hold cancel

@jetstack-bot jetstack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2020
@retest-bot
Copy link
Copy Markdown

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to jetstack).
Review the full test history for this PR.
Silence the bot with an /lgtm cancel comment for consistent failures.

@jetstack-bot jetstack-bot merged commit 35add56 into cert-manager:master Mar 23, 2020
@skra-space skra-space deleted the crl branch March 23, 2020 14:16
@cedenilla
Copy link
Copy Markdown

@srbraun Is there any possibility that you could add the feature to Vault, as you mentioned a few years ago? Thank you in advance!

@skra-space
Copy link
Copy Markdown
Contributor Author

Hi! Thank you for reaching out to me. Unfortunately, I am not working on it anymore. I was planning to implement it for my employer but plans have changed there. I hope you'll find a solution. Good luck!

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. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to specify CRL Distribution Point.

5 participants