forked from helidon-io/helidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TLS Revocation config (helidon-io#8425)
TLS Revocation config Signed-off-by: David Kral <[email protected]>
- Loading branch information
Showing
18 changed files
with
740 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
common/tls/src/main/java/io/helidon/common/tls/RevocationConfigBlueprint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* Copyright (c) 2024 Oracle and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.helidon.common.tls; | ||
|
||
import java.net.URI; | ||
import java.util.Optional; | ||
|
||
import io.helidon.builder.api.Option; | ||
import io.helidon.builder.api.Prototype; | ||
|
||
/** | ||
* Certificate revocation configuration. | ||
* This configuration determines whether client certificate validation should include checking if | ||
* it is still considered valid by the certificate authority. | ||
* <br> | ||
* Types of certificate validation checks: | ||
* <ul> | ||
* <li>CRL - shortcut name for Certificate Revocation List. It is a list of certificates that have | ||
* been revoked by a certificate authority before their expiration date</li> | ||
* <li>OCSP - shortcut name for Online Certificate Status Protocol. It is a real-time protocol used | ||
* to check the status of a certificate, providing immediate verification of its validity</li> | ||
* </ul> | ||
*/ | ||
@Prototype.Blueprint | ||
@Prototype.Configured | ||
interface RevocationConfigBlueprint { | ||
|
||
/** | ||
* Flag indicating whether this revocation config is enabled. | ||
* | ||
* @return enabled flag | ||
*/ | ||
@Option.Configured | ||
@Option.DefaultBoolean(false) | ||
boolean enabled(); | ||
|
||
/** | ||
* Prefer CRL over OCSP. | ||
* Default value is {@code false}. OCSP is preferred over the CRL by default. | ||
* | ||
* @return whether to prefer CRL over OCSP | ||
*/ | ||
@Option.Configured | ||
@Option.DefaultBoolean(false) | ||
boolean preferCrlOverOcsp(); | ||
|
||
/** | ||
* Only check the revocation status of end-entity certificates. | ||
* Default value is {@code false}. | ||
* | ||
* @return whether to check only end-entity certificates | ||
*/ | ||
@Option.Configured | ||
@Option.DefaultBoolean(false) | ||
boolean checkOnlyEndEntity(); | ||
|
||
/** | ||
* Enable fallback to the less preferred checking option. | ||
* <br> | ||
* If the primary method for revocation checking fails to verify the revocation status of a certificate | ||
* (such as using a CRL or OCSP), the checker will attempt alternative methods. This option ensures | ||
* whether revocation checking is performed strictly according to the specified method, or should fallback | ||
* to the one less preferred. OCSP is preferred over the CRL by default. | ||
* | ||
* @return whether to allow fallback to the less preferred checking option | ||
*/ | ||
@Option.Configured | ||
@Option.DefaultBoolean(true) | ||
boolean fallbackEnabled(); | ||
|
||
/** | ||
* Allow revocation check to succeed if the revocation status cannot be | ||
* determined for one of the following reasons: | ||
* <ul> | ||
* <li>The CRL or OCSP response cannot be obtained because of a | ||
* network error. | ||
* <li>The OCSP responder returns one of the following errors | ||
* specified in section 2.3 of RFC 2560: internalError or tryLater. | ||
* </ul> | ||
* | ||
* @return whether soft fail is enabled | ||
*/ | ||
@Option.Configured | ||
@Option.DefaultBoolean(false) | ||
boolean softFailEnabled(); | ||
|
||
/** | ||
* The URI that identifies the location of the OCSP responder. This | ||
* overrides the {@code ocsp.responderURL} security property and any | ||
* responder specified in a certificate's Authority Information Access | ||
* Extension, as defined in RFC 5280. | ||
* | ||
* @return OCSP responder URI | ||
*/ | ||
@Option.Configured | ||
Optional<URI> ocspResponderUri(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
docs/src/main/asciidoc/config/io_helidon_common_tls_RevocationConfig.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
Copyright (c) 2024 Oracle and/or its affiliates. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
ifndef::rootdir[:rootdir: {docdir}/..] | ||
:description: Configuration of io.helidon.common.tls.RevocationConfig | ||
:keywords: helidon, config, io.helidon.common.tls.RevocationConfig | ||
:basic-table-intro: The table below lists the configuration keys that configure io.helidon.common.tls.RevocationConfig | ||
include::{rootdir}/includes/attributes.adoc[] | ||
= RevocationConfig (common.tls) Configuration | ||
// tag::config[] | ||
Type: link:{javadoc-base-url}/io.helidon.common.tls/io/helidon/common/tls/RevocationConfig.html[io.helidon.common.tls.RevocationConfig] | ||
== Configuration options | ||
.Optional configuration options | ||
[cols="3,3a,2,5a"] | ||
|=== | ||
|key |type |default value |description | ||
|`check-only-end-entity` |boolean |`false` |Only check the revocation status of end-entity certificates. | ||
Default value is `false`. | ||
@return whether to check only end-entity certificates | ||
|`enabled` |boolean |`false` |Flag indicating whether this revocation config is enabled. | ||
@return enabled flag | ||
|`fallback-enabled` |boolean |`true` |Enable fallback to the less preferred checking option. | ||
@return whether to allow fallback to the less preferred checking option | ||
|`ocsp-responder-uri` |URI |{nbsp} |The URI that identifies the location of the OCSP responder. This | ||
overrides the `ocsp.responderURL` security property and any | ||
responder specified in a certificate's Authority Information Access | ||
Extension, as defined in RFC 5280. | ||
@return OCSP responder URI | ||
|`prefer-crl-over-ocsp` |boolean |`false` |Prefer CRL over OCSP. | ||
Default value is `false`. | ||
@return whether to prefer CRL over OCSP | ||
|`soft-fail-enabled` |boolean |`false` |Allow revocation check to succeed if the revocation status cannot be | ||
determined for one of the following reasons: | ||
- The CRL or OCSP response cannot be obtained because of a | ||
network error. | ||
- The OCSP responder returns one of the following errors | ||
specified in section 2.3 of RFC 2560: internalError or tryLater. | ||
@return whether soft fail is enabled | ||
|=== | ||
// end::config[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ jaxb.index | |
.bin | ||
.vm | ||
.sql | ||
.crl | ||
src/main/proto/ | ||
src/test/resources/keystore/ | ||
etc/javadoc/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.