Skip to content

Commit

Permalink
Make namespace checking mode configurable
Browse files Browse the repository at this point in the history
Motivation:

For HTTP-TPC, the checking of Subject DN makes no sense, as the identity
being asserted by the EEC is the DNS name of the host.

Modification:

Add configation option to allow different checking modes, as supported
by the CaNL library.  The default option, if none specified, is the
existing mode `EUGRIDPMA_AND_GLOBUS_REQUIRE`, providing backwards
compatibility.

Result:

No user or admin visible changes by default.  StoRM-WebDAV now supports
an admin configuring the namespace checking mode via:

    storm:
	tls:
            namespace-checking-mode: IGNORE

Closes: italiangrid#65
  • Loading branch information
paulmillar committed Nov 26, 2024
1 parent 93997b8 commit 641427e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ public interface ServiceConfiguration {

public String getTlsProtocol();

public String getNamespaceCheckingMode();

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.net.URI;
import java.util.List;
import java.util.Objects;

import javax.validation.Valid;
import javax.validation.constraints.Max;
Expand Down Expand Up @@ -363,6 +364,9 @@ public static class TLSProperties {
@NotBlank
String protocol = "TLS";

@NotBlank
String namespaceCheckingMode = "EUGRIDPMA_AND_GLOBUS_REQUIRE";

public String getCertificatePath() {
return certificatePath;
}
Expand Down Expand Up @@ -426,6 +430,14 @@ public String getProtocol() {
public void setProtocol(String protocol) {
this.protocol = protocol;
}

public void setNamespaceCheckingMode(String checkingMode) {
this.namespaceCheckingMode = Objects.requireNonNull(checkingMode);
}

public String getNamespaceCheckingMode() {
return namespaceCheckingMode;
}
}

public static class SaProperties {
Expand Down Expand Up @@ -786,6 +798,11 @@ public boolean requireClientCertificateAuthentication() {
return getTls().isRequireClientCert();
}

@Override
public String getNamespaceCheckingMode() {
return getTls().getNamespaceCheckingMode();
}


public AuthorizationServerProperties getAuthzServer() {
return authzServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ X509CertChainValidatorExt canlCertChainValidator(ServiceConfiguration configurat
long refreshInterval =
TimeUnit.SECONDS.toMillis(configuration.getTrustAnchorsRefreshIntervalInSeconds());

return builder.namespaceChecks(NamespaceCheckingMode.EUGRIDPMA_AND_GLOBUS_REQUIRE)
NamespaceCheckingMode checkingMode = NamespaceCheckingMode.valueOf(configuration.getNamespaceCheckingMode());

return builder.namespaceChecks(checkingMode)
.crlChecks(CrlCheckingMode.IF_VALID)
.ocspChecks(OCSPCheckingMode.IGNORE)
.lazyAnchorsLoading(false)
Expand Down

0 comments on commit 641427e

Please sign in to comment.