Restrict regex validation of HTTP status codes for Ingress CRD resources

This commit is contained in:
Jesper Noordsij 2025-04-08 09:38:04 +02:00 committed by GitHub
parent 405be420c9
commit bb8dfa568a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -1250,7 +1250,7 @@ spec:
as ranges by separating two codes with a dash (500-599),
or a combination of the two (404,418,500-599).
items:
pattern: ^([0-5][0-9]{2}[,-]?)+$
pattern: ^([1-5][0-9]{2}[,-]?)+$
type: string
type: array
statusRewrites:

View File

@ -481,7 +481,7 @@ spec:
as ranges by separating two codes with a dash (500-599),
or a combination of the two (404,418,500-599).
items:
pattern: ^([0-5][0-9]{2}[,-]?)+$
pattern: ^([1-5][0-9]{2}[,-]?)+$
type: string
type: array
statusRewrites:

View File

@ -1250,7 +1250,7 @@ spec:
as ranges by separating two codes with a dash (500-599),
or a combination of the two (404,418,500-599).
items:
pattern: ^([0-5][0-9]{2}[,-]?)+$
pattern: ^([1-5][0-9]{2}[,-]?)+$
type: string
type: array
statusRewrites:

View File

@ -67,7 +67,7 @@ type ErrorPage struct {
// as multiple comma-separated numbers (500,502),
// as ranges by separating two codes with a dash (500-599),
// or a combination of the two (404,418,500-599).
// +kubebuilder:validation:items:Pattern=`^([0-5][0-9]{2}[,-]?)+$`
// +kubebuilder:validation:items:Pattern=`^([1-5][0-9]{2}[,-]?)+$`
Status []string `json:"status,omitempty"`
// StatusRewrites defines a mapping of status codes that should be returned instead of the original error status codes.
// For example: "418": 404 or "410-418": 404