Skip to content

tls: enable match_subject_alt_names option in SPIFFE validator#15509

Merged
mattklein123 merged 9 commits intoenvoyproxy:mainfrom
mathetake:spiffe-san-match
Mar 22, 2021
Merged

tls: enable match_subject_alt_names option in SPIFFE validator#15509
mattklein123 merged 9 commits intoenvoyproxy:mainfrom
mathetake:spiffe-san-match

Conversation

@mathetake
Copy link
Copy Markdown
Member

Signed-off-by: Takeshi Yoneda takeshi@tetrate.io

Commit Message: tls: enable match_subject_alt_names option in SPIFFE validator
Additional Description: This is a follow up on #14884 and resolves #15392.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
@mathetake mathetake marked this pull request as ready for review March 16, 2021 13:06
@mathetake
Copy link
Copy Markdown
Member Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15509 (comment) was created by @mathetake.

see: more, trace.

Copy link
Copy Markdown

@azdagron azdagron left a comment

Choose a reason for hiding this comment

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

This is exciting! Very happy to see this work move forward! I can't speak to the rest of the mechanics, but the actual SAN validation seems fine.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
@mathetake
Copy link
Copy Markdown
Member Author

@azdagron Thanks for the review from the perspective of SPIFFE expert 👍 I really appreciate it 🙂

Copy link
Copy Markdown
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM besides the nit

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
@mathetake
Copy link
Copy Markdown
Member Author

mathetake commented Mar 18, 2021

@PiotrSikora sorry my stale merge commit has requested your review. Never mind.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
@mathetake
Copy link
Copy Markdown
Member Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15509 (comment) was created by @mathetake.

see: more, trace.

asraa
asraa previously approved these changes Mar 18, 2021
Copy link
Copy Markdown
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM
@envoyproxy/senior-maintainers

@mattklein123
Copy link
Copy Markdown
Member

Needs a main merge.

/wait

@mathetake
Copy link
Copy Markdown
Member Author

merged main and resolved conflicts. Thanks!

Comment on lines +149 to +153
case GEN_EMAIL: {
ASN1_STRING* str = general_name->d.rfc822Name;
san.assign(reinterpret_cast<const char*>(ASN1_STRING_data(str)), ASN1_STRING_length(str));
break;
}
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.

Does this have explicit testing somewhere? I don't see any cert changes in this PR?

/wait-any

Copy link
Copy Markdown
Member Author

@mathetake mathetake Mar 22, 2021

Choose a reason for hiding this comment

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

I used this here for testing SAN matcher https://github.com/envoyproxy/envoy/pull/15509/files#diff-ee57e8aee637e17f1f512cef5e2bff807c263ab67922c85659721654913242f4R460, so that's why you don't see certs changes.

In any way, generalNameAsString doesn't have any explicit unit test so I think we should. Added a dedicated test case of getSubjectAltNames for email SAN.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
@mathetake
Copy link
Copy Markdown
Member Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15509 (comment) was created by @mathetake.

see: more, trace.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Super, thanks for beefing up the test coverage!

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.

tls: SAN matching support in SPIFFE certificate validator

4 participants