Skip to content

Commit

Permalink
This is a followup PR to openshift#1364
Browse files Browse the repository at this point in the history
The header name max size limit is changed to 255.
This was changed as haproxy does not allow more 255 bytes to be set
for header name because of the reason mentioned here:
https://jfrog.com/blog/critical-vulnerability-in-haproxy-cve-2021-40346-integer-overflow-enables-http-smuggling/
Issue link: https://issues.redhat.com/browse/OCPBUGS-17414
  • Loading branch information
miheer committed Aug 7, 2023
1 parent 26b8597 commit 806dcee
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -25579,7 +25579,7 @@
"$ref": "#/definitions/com.github.openshift.api.operator.v1.IngressControllerHTTPHeaderActionUnion"
},
"name": {
"description": "name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, \"-!#$%&'*+.^_`\". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.",
"description": "name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, \"-!#$%&'*+.^_`\". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.",
"type": "string",
"default": ""
}
Expand Down Expand Up @@ -31438,7 +31438,7 @@
"$ref": "#/definitions/com.github.openshift.api.route.v1.RouteHTTPHeaderActionUnion"
},
"name": {
"description": "name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, \"-!#$%&'*+.^_`\". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.",
"description": "name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, \"-!#$%&'*+.^_`\". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.",
"type": "string",
"default": ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ spec:
- message: set is required when type is Set, and forbidden otherwise
rule: 'has(self.type) && self.type == ''Set'' ? has(self.set) : !has(self.set)'
name:
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.'
maxLength: 1024
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.'
maxLength: 255
minLength: 1
pattern: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$
type: string
Expand Down Expand Up @@ -356,8 +356,8 @@ spec:
- message: set is required when type is Set, and forbidden otherwise
rule: 'has(self.type) && self.type == ''Set'' ? has(self.set) : !has(self.set)'
name:
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.'
maxLength: 1024
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.'
maxLength: 255
minLength: 1
pattern: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$
type: string
Expand Down
4 changes: 2 additions & 2 deletions operator/v1/types_ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -1473,11 +1473,11 @@ type IngressControllerHTTPHeader struct {
// The name must consist only of alphanumeric and the following special characters, "-!#$%&'*+.^_`".
// The following header names are reserved and may not be modified via this API:
// Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie.
// It must be no more than 1024 characters in length.
// It must be no more than 255 characters in length.
// Header name must be unique.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=1024
// +kubebuilder:validation:MaxLength=255
// +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$"
// +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'strict-transport-security'",message="strict-transport-security header may not be modified via header actions"
// +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'proxy'",message="proxy header may not be modified via header actions"
Expand Down
2 changes: 1 addition & 1 deletion operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions route/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions route/v1/route-CustomNoUpgrade.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ spec:
- rule: 'has(self.type) && self.type == ''Set'' ? has(self.set) : !has(self.set)'
message: set is required when type is Set, and forbidden otherwise
name:
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.'
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.'
type: string
maxLength: 1024
maxLength: 255
minLength: 1
pattern: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$
x-kubernetes-validations:
Expand Down Expand Up @@ -186,9 +186,9 @@ spec:
- rule: 'has(self.type) && self.type == ''Set'' ? has(self.set) : !has(self.set)'
message: set is required when type is Set, and forbidden otherwise
name:
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.'
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.'
type: string
maxLength: 1024
maxLength: 255
minLength: 1
pattern: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$
x-kubernetes-validations:
Expand Down
8 changes: 4 additions & 4 deletions route/v1/route-TechPreviewNoUpgrade.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ spec:
- rule: 'has(self.type) && self.type == ''Set'' ? has(self.set) : !has(self.set)'
message: set is required when type is Set, and forbidden otherwise
name:
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.'
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.'
type: string
maxLength: 1024
maxLength: 255
minLength: 1
pattern: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$
x-kubernetes-validations:
Expand Down Expand Up @@ -186,9 +186,9 @@ spec:
- rule: 'has(self.type) && self.type == ''Set'' ? has(self.set) : !has(self.set)'
message: set is required when type is Set, and forbidden otherwise
name:
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 1024 characters in length. Header name must be unique.'
description: 'name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header name as defined in RFC 2616 section 4.2. The name must consist only of alphanumeric and the following special characters, "-!#$%&''*+.^_`". The following header names are reserved and may not be modified via this API: Strict-Transport-Security, Proxy, Cookie, Set-Cookie. It must be no more than 255 characters in length. Header name must be unique.'
type: string
maxLength: 1024
maxLength: 255
minLength: 1
pattern: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$
x-kubernetes-validations:
Expand Down
Loading

0 comments on commit 806dcee

Please sign in to comment.