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

refactor of SMIME aia contains #777

Merged
merged 28 commits into from
Dec 12, 2023

Conversation

mtgag
Copy link
Contributor

@mtgag mtgag commented Dec 6, 2023

the effective date of this lint has been updated and in checkApplies a check to see whether the extension is present has been added.

Also, another proposal would be to break this lint into two lints. One that is checking whether the scheme is HTTP and produces either error or pass and a second lint that is checking the internal names and produces either warn or pass. I believe that most lints try to focus on one aspect and not to lint many aspects in one lint. I would be willing to contribute on this.

Best,

Vangelis

h Outdated Show resolved Hide resolved
@cardonator
Copy link
Contributor

Separating the scheme check to a separate lint does seem appropriate. There are several lints for AIA checking that have a similar structure so we will want to make sure they all have consistent behavior.

@mtgag
Copy link
Contributor Author

mtgag commented Dec 9, 2023

I did not find any text in the SMIME CABF Specifications which deals with internal names in AIA/OCSP. I propose to remove this part in the lint and the smime package and if this is a requirement from another specification, implement it as a new lint in the corresponding package. This proposal is implemented in commit a1eee50

@cardonator
Copy link
Contributor

I'll disagree with that one. I don't think a requirement is spelled out in any of the BRs, however the ocsp has to be publicly accessible as does the aia. Is there a use case you're thinking of where an internal name would or should be allowed? Pinging @CBonnell for visibility.

@CBonnell
Copy link
Contributor

CBonnell commented Dec 9, 2023

I agree with @cardonator. While the S/MIME BRs do not explicitly state that the URIs contained within the CRLDP and AIA extensions must be publicly accessible, the language cannot reasonably be interpreted as allowing the inclusion of such internal domain names.

If one reads the current language in the SMBRs as permitting internal domain names in CRLDP and AIA extensions, then one would also interpret the SMBRs as allowing the issuance of publicly trusted S/MIME certificates that have no publicly available revocation information.

More generally, the inclusion of such internal domain names is of no use (and actively harmful due to connection attempts that will inevitably fail) in the common case, as the referenced resources cannot be accessed by most Relying Parties.

@mtgag
Copy link
Contributor Author

mtgag commented Dec 10, 2023

The motivation to remove the check about internal names was to keep different aspects of lints separated and left the removed part to future work.

Commit 2a6b887 tries to address the issues discussed in this PR. On the one hand two distinct lints exist to keep a narrow focus on each lint, and on the other hand the check for internal names is extended to all SMIME certificates. I hope that the current proposal and implementation reflects the discussion.

ExpectedResult: lint.Warn,
},
{
Name: "warn - aia with valid names, one is ldap",
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this version of the lint will now cover Legacy profile, which currently allows LDAP scheme to appear in the AIA. That may be unintentional or just missed. Along with that, I think if we're going to do this refactor for the Strict/MP profiles, that we should also do it for the legacy profiles which are additional lints that should be reviewed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the contains_internal_names lint, it is checked whether it is a BR-SMIME certificate, the scheme part is not checked at all and only the host part of the URL is checked. The certificate containing the LDAP URL is a Pass Test. I believe the current implementation covers these apsects. Has something not been taken into account? If there is something missing or is not correct I could extend the implementation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, thanks. So, with this lint now covering Legacy, I think we should refactor the Legacy profile lint to only ensure the proper schemes, right? I would think we could just check that at least one OCSP URL and issuer url have the http scheme and remove the internal name checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Commit a5711df covers this.

@timfromdigicert
Copy link

A future browser alignment ballot might help here, as it is my opinion is that a non-public OCSP or CRL server for public S/MIME would violate Mozilla policy:

"CA operators MUST NOT issue certificates that have:

[...]; or
cRLDistributionPoints or OCSP authorityInfoAccess extensions for which no operational CRL or OCSP service exists."

In the context of Mozilla policy for public S/MIME, I would interpret "operational" to include "publicly accessible". Because PUBLIC S/MIME.

And this is all just another data point showing that the correct reading of the S/MIME BRs includes the common implicit assumption that CRL and OCSP servers need to be publicly available and operating in a manner generally consistent with how CRL and OCSP servers are generally accepted to operate.

…acy AIA has one HTTP moved to a new lint, added isSubscriberCert for all checkApplies
@cardonator
Copy link
Contributor

Great, this LGTM now. @christopher-henderson do you want to take a look?

@christopher-henderson
Copy link
Member

Thank you @cardonator, @mtgag, and @CBonnell for the thorough policy discussion - it always helps a ton.

@@ -40,40 +39,37 @@ For Legacy: When provided, at least one accessMethod SHALL have the URI scheme H
func init() {
lint.RegisterCertificateLint(&lint.CertificateLint{
LintMetadata: lint.LintMetadata{
Name: "w_smime_legacy_aia_contains_internal_names",
Name: "e_smime_legacy_aia_shall_have_one_http",

Choose a reason for hiding this comment

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

Good catch on the change from w to e. It really should have been marked as an error class in the first place.

@christopher-henderson christopher-henderson merged commit 45de880 into zmap:master Dec 12, 2023
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.

7 participants