Table of Contents

Class CertificateAuthorizationBuilderExtensions

Namespace
Steeltoe.Security.Authorization.Certificate
Assembly
Steeltoe.Security.Authorization.Certificate.dll
public static class CertificateAuthorizationBuilderExtensions
Inheritance
CertificateAuthorizationBuilderExtensions
Inherited Members

Methods

AddOrgAndSpacePolicies(AuthorizationBuilder)

Defines policies that verify the space/org in the incoming client certificate matches the space/org of the local application instance identity certificate in configuration.

Secure your endpoints with the included authorization policies by referencing CertificateAuthorizationPolicies.

This method also configures certificate forwarding.

[Obsolete("Trusting a certificate header without verifying that a reverse proxy set it after a successful mTLS handshake may enable identity spoofing. This overload will be removed in a future release. Use AddOrgAndSpacePoliciesForMutualTls instead.")]
public static AuthorizationBuilder AddOrgAndSpacePolicies(this AuthorizationBuilder builder)

Parameters

builder AuthorizationBuilder

The AuthorizationBuilder to configure.

Returns

AuthorizationBuilder

The incoming builder so that additional calls can be chained.

AddOrgAndSpacePolicies(AuthorizationBuilder, string?)

Defines policies that verify the space/org in the incoming client certificate matches the space/org of the local application instance identity certificate in configuration.

Secure your endpoints with the included authorization policies by referencing CertificateAuthorizationPolicies.

This method also configures certificate forwarding.

[Obsolete("Configuring a custom header name is no longer recommended because it may enable identity spoofing. This overload will be removed in a future release. Use AddOrgAndSpacePoliciesForMutualTls instead.")]
public static AuthorizationBuilder AddOrgAndSpacePolicies(this AuthorizationBuilder builder, string? certificateHeaderName)

Parameters

builder AuthorizationBuilder

The AuthorizationBuilder to configure.

certificateHeaderName string

The name of the HTTP header used to pass the certificate.

Returns

AuthorizationBuilder

The incoming builder so that additional calls can be chained.

AddOrgAndSpacePoliciesForMutualTls(AuthorizationBuilder)

Defines policies that verify the space/org in the incoming client certificate matches the space/org of the local application instance identity certificate in configuration.

Secure your endpoints with the included authorization policies by referencing CertificateAuthorizationPolicies.

This method also configures certificate forwarding, trusting only the X-Forwarded-Client-Cert header.

public static AuthorizationBuilder AddOrgAndSpacePoliciesForMutualTls(this AuthorizationBuilder builder)

Parameters

builder AuthorizationBuilder

The AuthorizationBuilder to configure.

Returns

AuthorizationBuilder

The incoming builder so that additional calls can be chained.

Remarks

This requires the Cloud Foundry Gorouter to be configured as the point of TLS termination.

When configured correctly, Gorouter terminates the mutual TLS handshake and forwards the verified client certificate in the X-Forwarded-Client-Cert header. Gorouter also strips any incoming instances of this header from external clients, protecting applications from spoofing.

If TLS termination is not enabled at the router, this header is never set and the configured policies will reject every request.