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

Add lint to detect invalid cps uri #828

Merged
merged 31 commits into from
Apr 28, 2024

Conversation

defacto64
Copy link
Contributor

Please add this lint to check that any CPS URIs (hopefully just one) found in the certificates is a valid HTTP or HTTPS URL as per CABF BR 7.1.2 (several subsections thereof).

@cardonator
Copy link
Contributor

It seems like there is some leakage between this PR and #830... was that intentional?

@defacto64
Copy link
Contributor Author

Thank you @cardonator, I have fixed that.

Copy link
Contributor

@cardonator cardonator left a comment

Choose a reason for hiding this comment

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

Thanks! This looks good to me now.

}

func (l *invalidCPSUri) Execute(c *x509.Certificate) *lint.LintResult {
// There should normally be just one CPS URI, but one never knows...
Copy link
Contributor

Choose a reason for hiding this comment

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

It may make sense to raise a warning if there is more than one but not outright fail the lint

Copy link
Member

Choose a reason for hiding this comment

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

Generally, we try to have lints only raise a single severity level. If we want, we could certainly create a second lint though.

Copy link
Contributor

@aaomidi aaomidi Apr 19, 2024

Choose a reason for hiding this comment

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

Mainly trying to reconcile between this and #815

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aaomidi and @zakird,

On the first point: it seems to me that the CABF BRs do not forbid including more than one CPS URI in a certificate, and although it's uncommon and "ugly" (to me) I can imagine some more or less valid reasons for doing that, so I do not think there is a reason for raising a warning if there is more than one CPS URI.

On the second point: my lint checks than a CPS URI is valid according to the CABF BRs (which applies to any kind of certificate in the TLS context, both EV and non EV), while PR #815 seems to be specific for EV certs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, thank you!

@christopher-henderson christopher-henderson merged commit 63e3f86 into zmap:master Apr 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants