Skip to content

[Security][XDS] Support Verification with SPIFFE Bundle Maps#40321

Closed
gtcooke94 wants to merge 29 commits intogrpc:masterfrom
gtcooke94:spiffe_verification
Closed

[Security][XDS] Support Verification with SPIFFE Bundle Maps#40321
gtcooke94 wants to merge 29 commits intogrpc:masterfrom
gtcooke94:spiffe_verification

Conversation

@gtcooke94
Copy link
Contributor

@gtcooke94 gtcooke94 commented Jul 24, 2025

This PR adds APIs discussed in grpc/proposal#506 and https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md to support verification with SPIFFE Bundle Map roots.

RELEASE NOTES:

  • Adds support for SPIFFE Bundle Maps in as roots of trust per gRFC A87 and gRFC L127

"No spiffe bundle found for trust domain %s", trust_domain));
}

} // namespace grpc_core No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

please add new line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"//test/core/test_util:grpc_test_util",
"//test/cpp/util:test_util",
],
) No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

please add new line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

const auto result = RUN_ALL_TESTS();
grpc_shutdown();
return result;
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

please add new line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@gtcooke94 gtcooke94 requested a review from yashykt July 28, 2025 21:08
Copy link
Contributor

@matthewstevenson88 matthewstevenson88 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I already did a review when this was on your personal branch (linked below for posterity). LGTM, modulo a few small nits I noticed while doing a final pass on the PR.

Copy link
Contributor

@matthewstevenson88 matthewstevenson88 left a comment

Choose a reason for hiding this comment

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

Per request, did a review pass of the newly-added tests. No major concerns, just some nits and clarification suggestions. Deferring to Yash to review the xds_security_spiffe_end2end_test.cc file, as I am not qualified to review for the XDS logic.

Copy link
Contributor

@pawbhard pawbhard left a comment

Choose a reason for hiding this comment

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

LGTM, from xds e2e test side .added some nit commrnts

"absl/log:check",
"gtest",
],
# flaky = True, # TODO(b/144705388)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: cleanup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"no_test_ios",
"no_windows",
"xds_end2end_test",
], # TODO(jtattermusch): fix test on windows
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need to fix on windows, or copy-paste ?
If yes add TODO on your name or existing person name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy paste, removing TODO

@@ -0,0 +1,38 @@
All of the following files in this directory except `server_spiffebundle.json`
and `client_spiffebundle.json` are generated with the `generate.sh` and
`generate_intermediate.sh` script in this directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Do we need to generate them again , if yes when ? Should we add that in this README?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, not sure the exact date, I believe the scripts usually do 10 years for cert expiry

}

grpc_core::UniqueTypeName type() const override {
static grpc_core::UniqueTypeName::Factory kFactory("fake");
Copy link
Contributor

Choose a reason for hiding this comment

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

nit : use GRPC_UNIQUE_TYPE_NAME_HERE()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


private:
int CompareImpl(const grpc_tls_certificate_provider* other) const override {
// TODO(yashykt): Maybe do something better here.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add TODO to yourself or existing gRPC member .
Same for rest of the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were copy paste TODOs, just removed them

identity_pair_ = ReadTlsIdentityPair(kClientKeyPath, kClientCertPath);

// TODO(yashykt): Use different client certs here instead of reusing
// server certs after https://github.com/grpc/grpc/pull/24876 is merged
Copy link
Contributor

Choose a reason for hiding this comment

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

PR is already merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

eugeneo pushed a commit to eugeneo/grpc that referenced this pull request Aug 11, 2025
)

This PR adds APIs discussed in grpc/proposal#506 and https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md to support verification with SPIFFE Bundle Map roots.

RELEASE NOTES:
* Adds support for SPIFFE Bundle Maps in as roots of trust per [gRFC A87](https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md) and [gRFC L127](grpc/proposal#506)

Closes grpc#40321

COPYBARA_INTEGRATE_REVIEW=grpc#40321 from gtcooke94:spiffe_verification 6ddc24e
PiperOrigin-RevId: 793688101
gtcooke94 added a commit to gtcooke94/grpc that referenced this pull request Aug 14, 2025
copybara-service bot pushed a commit that referenced this pull request Aug 18, 2025
Roll forward #40321 with fixes relating to OpenSSL 1.0.2

This roll forward fixes two things broken by the original commit:
* OpenSSL 1.0.2 compatibility - `X509_up_ref` is not in 1.0.2, so `CRYPTO_add` is used along with compiler directives.
* The macOS tests flatten trust bundles, and two files in different directories were both named `ca.pem` in the new `spiffe_bundle_map_end2end_test.cc`. One was from the existing test that this new test file was modeled after and was not needed, so it was removed from the BUILD file resolving the double naming conflict.

Closes #40476

COPYBARA_INTEGRATE_REVIEW=#40476 from gtcooke94:spiffe_roll_forward e30b7e4
PiperOrigin-RevId: 796537764
gtcooke94 added a commit to gtcooke94/grpc that referenced this pull request Aug 21, 2025
Roll forward grpc#40321 with fixes relating to OpenSSL 1.0.2

This roll forward fixes two things broken by the original commit:
* OpenSSL 1.0.2 compatibility - `X509_up_ref` is not in 1.0.2, so `CRYPTO_add` is used along with compiler directives.
* The macOS tests flatten trust bundles, and two files in different directories were both named `ca.pem` in the new `spiffe_bundle_map_end2end_test.cc`. One was from the existing test that this new test file was modeled after and was not needed, so it was removed from the BUILD file resolving the double naming conflict.

Closes grpc#40476

COPYBARA_INTEGRATE_REVIEW=grpc#40476 from gtcooke94:spiffe_roll_forward e30b7e4
PiperOrigin-RevId: 796537764
asheshvidyut pushed a commit to asheshvidyut/grpc that referenced this pull request Aug 22, 2025
Roll forward grpc#40321 with fixes relating to OpenSSL 1.0.2

This roll forward fixes two things broken by the original commit:
* OpenSSL 1.0.2 compatibility - `X509_up_ref` is not in 1.0.2, so `CRYPTO_add` is used along with compiler directives.
* The macOS tests flatten trust bundles, and two files in different directories were both named `ca.pem` in the new `spiffe_bundle_map_end2end_test.cc`. One was from the existing test that this new test file was modeled after and was not needed, so it was removed from the BUILD file resolving the double naming conflict.

Closes grpc#40476

COPYBARA_INTEGRATE_REVIEW=grpc#40476 from gtcooke94:spiffe_roll_forward e30b7e4
PiperOrigin-RevId: 796537764
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Aug 23, 2025
)

This PR adds APIs discussed in grpc/proposal#506 and https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md to support verification with SPIFFE Bundle Map roots.

RELEASE NOTES:
* Adds support for SPIFFE Bundle Maps in as roots of trust per [gRFC A87](https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md) and [gRFC L127](grpc/proposal#506)

Closes grpc#40321

COPYBARA_INTEGRATE_REVIEW=grpc#40321 from gtcooke94:spiffe_verification 6ddc24e
PiperOrigin-RevId: 793688101
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Aug 23, 2025
Roll forward grpc#40321 with fixes relating to OpenSSL 1.0.2

This roll forward fixes two things broken by the original commit:
* OpenSSL 1.0.2 compatibility - `X509_up_ref` is not in 1.0.2, so `CRYPTO_add` is used along with compiler directives.
* The macOS tests flatten trust bundles, and two files in different directories were both named `ca.pem` in the new `spiffe_bundle_map_end2end_test.cc`. One was from the existing test that this new test file was modeled after and was not needed, so it was removed from the BUILD file resolving the double naming conflict.

Closes grpc#40476

COPYBARA_INTEGRATE_REVIEW=grpc#40476 from gtcooke94:spiffe_roll_forward e30b7e4
PiperOrigin-RevId: 796537764
asheshvidyut pushed a commit to asheshvidyut/grpc that referenced this pull request Sep 12, 2025
)

This PR adds APIs discussed in grpc/proposal#506 and https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md to support verification with SPIFFE Bundle Map roots.

RELEASE NOTES:
* Adds support for SPIFFE Bundle Maps in as roots of trust per [gRFC A87](https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md) and [gRFC L127](grpc/proposal#506)

Closes grpc#40321

COPYBARA_INTEGRATE_REVIEW=grpc#40321 from gtcooke94:spiffe_verification 6ddc24e
PiperOrigin-RevId: 793688101
asheshvidyut pushed a commit to asheshvidyut/grpc that referenced this pull request Sep 12, 2025
Roll forward grpc#40321 with fixes relating to OpenSSL 1.0.2

This roll forward fixes two things broken by the original commit:
* OpenSSL 1.0.2 compatibility - `X509_up_ref` is not in 1.0.2, so `CRYPTO_add` is used along with compiler directives.
* The macOS tests flatten trust bundles, and two files in different directories were both named `ca.pem` in the new `spiffe_bundle_map_end2end_test.cc`. One was from the existing test that this new test file was modeled after and was not needed, so it was removed from the BUILD file resolving the double naming conflict.

Closes grpc#40476

COPYBARA_INTEGRATE_REVIEW=grpc#40476 from gtcooke94:spiffe_roll_forward e30b7e4
PiperOrigin-RevId: 796537764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants