Class HeaderValidatorConfig
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
io.envoyproxy.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,HeaderValidatorConfigOrBuilder,Serializable
public final class HeaderValidatorConfig
extends com.google.protobuf.GeneratedMessageV3
implements HeaderValidatorConfigOrBuilder
This extension validates that HTTP request and response headers are well formed according to respective RFCs.
The validator performs comprehensive HTTP header validation including:
#. HTTP/1 header map validity according to `RFC 7230 section 3.2 <https://datatracker.ietf.org/doc/html/rfc7230#section-3.2>`_.
#. Syntax of HTTP/1 request target URI and response status.
#. HTTP/2 header map validity according to `RFC 7540 section 8.1.2 <https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2>`_.
#. Syntax of HTTP/2 pseudo headers.
#. HTTP/3 header map validity according to `RFC 9114 section 4.3 <https://www.rfc-editor.org/rfc/rfc9114.html>`_.
#. Syntax of HTTP/3 pseudo headers.
#. Syntax of Content-Length and Transfer-Encoding.
#. Validation of HTTP/1 requests with both ``Content-Length`` and ``Transfer-Encoding`` headers.
#. Normalization of the URI path according to `Normalization and Comparison <https://datatracker.ietf.org/doc/html/rfc3986#section-6>`_
without `case normalization <https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.1>`_.
This validator ensures that HTTP traffic processed by Envoy conforms to established
standards and helps prevent issues caused by malformed headers or invalid HTTP syntax.
[#comment:TODO(yanavlasov): Put #extension: envoy.http.header_validators.envoy_default after it is not hidden any more]
[#next-free-field: 6]
Protobuf type envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis extension validates that HTTP request and response headers are well formed according to respective RFCs.static enumAction to take when Envoy receives client request with header names containing underscore characters.static final classHTTP/1 protocol specific options for header validation.static interfacestatic final classConfiguration options for URI path normalization and transformation.static interfaceNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic HeaderValidatorConfigstatic final com.google.protobuf.Descriptors.DescriptorAction to take when a client request with a header name containing underscore characters is received.intAction to take when a client request with a header name containing underscore characters is received.HTTP/1 protocol specific options.HTTP/1 protocol specific options.com.google.protobuf.Parser<HeaderValidatorConfig>booleanRestrict HTTP methods to these defined in the `RFC 7231 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7231#section-4.1>`_.intbooleanAllow requests with fragment in URL path and strip the fragment before request processing.The URI path normalization options.The URI path normalization options.inthashCode()booleanHTTP/1 protocol specific options.booleanThe URI path normalization options.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleannewBuilder(HeaderValidatorConfig prototype) protected HeaderValidatorConfig.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static HeaderValidatorConfigparseDelimitedFrom(InputStream input) static HeaderValidatorConfigparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static HeaderValidatorConfigparseFrom(byte[] data) static HeaderValidatorConfigparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static HeaderValidatorConfigparseFrom(com.google.protobuf.ByteString data) static HeaderValidatorConfigparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static HeaderValidatorConfigparseFrom(com.google.protobuf.CodedInputStream input) static HeaderValidatorConfigparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static HeaderValidatorConfigparseFrom(InputStream input) static HeaderValidatorConfigparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static HeaderValidatorConfigparseFrom(ByteBuffer data) static HeaderValidatorConfigparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<HeaderValidatorConfig>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
HTTP1_PROTOCOL_OPTIONS_FIELD_NUMBER
public static final int HTTP1_PROTOCOL_OPTIONS_FIELD_NUMBER- See Also:
-
URI_PATH_NORMALIZATION_OPTIONS_FIELD_NUMBER
public static final int URI_PATH_NORMALIZATION_OPTIONS_FIELD_NUMBER- See Also:
-
RESTRICT_HTTP_METHODS_FIELD_NUMBER
public static final int RESTRICT_HTTP_METHODS_FIELD_NUMBER- See Also:
-
HEADERS_WITH_UNDERSCORES_ACTION_FIELD_NUMBER
public static final int HEADERS_WITH_UNDERSCORES_ACTION_FIELD_NUMBER- See Also:
-
STRIP_FRAGMENT_FROM_PATH_FIELD_NUMBER
public static final int STRIP_FRAGMENT_FROM_PATH_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
hasHttp1ProtocolOptions
public boolean hasHttp1ProtocolOptions()HTTP/1 protocol specific options. These settings control HTTP/1 specific validation behaviors.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions http1_protocol_options = 1;- Specified by:
hasHttp1ProtocolOptionsin interfaceHeaderValidatorConfigOrBuilder- Returns:
- Whether the http1ProtocolOptions field is set.
-
getHttp1ProtocolOptions
HTTP/1 protocol specific options. These settings control HTTP/1 specific validation behaviors.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions http1_protocol_options = 1;- Specified by:
getHttp1ProtocolOptionsin interfaceHeaderValidatorConfigOrBuilder- Returns:
- The http1ProtocolOptions.
-
getHttp1ProtocolOptionsOrBuilder
HTTP/1 protocol specific options. These settings control HTTP/1 specific validation behaviors.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions http1_protocol_options = 1;- Specified by:
getHttp1ProtocolOptionsOrBuilderin interfaceHeaderValidatorConfigOrBuilder
-
hasUriPathNormalizationOptions
public boolean hasUriPathNormalizationOptions()The URI path normalization options. By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`. URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value. .. attention:: Disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service selection.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;- Specified by:
hasUriPathNormalizationOptionsin interfaceHeaderValidatorConfigOrBuilder- Returns:
- Whether the uriPathNormalizationOptions field is set.
-
getUriPathNormalizationOptions
The URI path normalization options. By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`. URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value. .. attention:: Disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service selection.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;- Specified by:
getUriPathNormalizationOptionsin interfaceHeaderValidatorConfigOrBuilder- Returns:
- The uriPathNormalizationOptions.
-
getUriPathNormalizationOptionsOrBuilder
public HeaderValidatorConfig.UriPathNormalizationOptionsOrBuilder getUriPathNormalizationOptionsOrBuilder()The URI path normalization options. By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions <envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions>`. URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value. .. attention:: Disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service selection.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions uri_path_normalization_options = 2;- Specified by:
getUriPathNormalizationOptionsOrBuilderin interfaceHeaderValidatorConfigOrBuilder
-
getRestrictHttpMethods
public boolean getRestrictHttpMethods()Restrict HTTP methods to these defined in the `RFC 7231 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7231#section-4.1>`_. Envoy will respond with 400 to requests with disallowed methods. By default methods with arbitrary names are accepted. This setting helps enforce HTTP compliance and can prevent attacks that rely on non-standard HTTP methods.
bool restrict_http_methods = 3;- Specified by:
getRestrictHttpMethodsin interfaceHeaderValidatorConfigOrBuilder- Returns:
- The restrictHttpMethods.
-
getHeadersWithUnderscoresActionValue
public int getHeadersWithUnderscoresActionValue()Action to take when a client request with a header name containing underscore characters is received. If this setting is not specified, the value defaults to ``ALLOW``. This setting provides security control over headers with underscores, which can be a source of security issues when different systems interpret underscores and hyphens differently.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction headers_with_underscores_action = 4;- Specified by:
getHeadersWithUnderscoresActionValuein interfaceHeaderValidatorConfigOrBuilder- Returns:
- The enum numeric value on the wire for headersWithUnderscoresAction.
-
getHeadersWithUnderscoresAction
Action to take when a client request with a header name containing underscore characters is received. If this setting is not specified, the value defaults to ``ALLOW``. This setting provides security control over headers with underscores, which can be a source of security issues when different systems interpret underscores and hyphens differently.
.envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction headers_with_underscores_action = 4;- Specified by:
getHeadersWithUnderscoresActionin interfaceHeaderValidatorConfigOrBuilder- Returns:
- The headersWithUnderscoresAction.
-
getStripFragmentFromPath
public boolean getStripFragmentFromPath()Allow requests with fragment in URL path and strip the fragment before request processing. By default Envoy rejects requests with fragment in URL path. When this option is enabled, the fragment portion (everything after ``#``) will be removed from the path before further processing. Fragments are typically used by client-side applications and should not normally be sent to the server, so stripping them can help normalize requests.
bool strip_fragment_from_path = 5;- Specified by:
getStripFragmentFromPathin interfaceHeaderValidatorConfigOrBuilder- Returns:
- The stripFragmentFromPath.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static HeaderValidatorConfig parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static HeaderValidatorConfig parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static HeaderValidatorConfig parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static HeaderValidatorConfig parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static HeaderValidatorConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static HeaderValidatorConfig parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static HeaderValidatorConfig parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static HeaderValidatorConfig parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static HeaderValidatorConfig parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static HeaderValidatorConfig parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected HeaderValidatorConfig.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-