Skip to content

Commit d9206fc

Browse files
authored
[NET-1151 NET-11228] security: Add request normalization and header match options to prevent L7 intentions bypass (#21816)
mesh: add options for HTTP incoming request normalization Expose global mesh configuration to enforce inbound HTTP request normalization on mesh traffic via Envoy xDS config. mesh: enable inbound URL path normalization by default mesh: add support for L7 header match contains and ignore_case Enable partial string and case-insensitive matching in L7 intentions header match rules. ui: support L7 header match contains and ignore_case Co-authored-by: Phil Renaud <phil@riotindustries.com> test: add request normalization integration bats tests Add both "positive" and "negative" test suites, showing normalization in action as well as expected results when it is not enabled, for the same set of test cases. Also add some alternative service container test helpers for verifying raw HTTP request paths, which is difficult to do with Fortio. docs: update security and reference docs for L7 intentions bypass prevention - Update security docs with best practices for service intentions configuration - Update configuration entry references for mesh and intentions to reflect new values and add guidance on usage
1 parent 3370f6b commit d9206fc

File tree

96 files changed

+5859
-2634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+5859
-2634
lines changed

.changelog/21816.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```release-note:security
2+
mesh: Add `http.incoming.requestNormalization` to Mesh configuration entry to support inbound service traffic request normalization. This resolves [CVE-2024-10005](https://nvd.nist.gov/vuln/detail/CVE-2024-10005) and [CVE-2024-10006](https://nvd.nist.gov/vuln/detail/CVE-2024-10006).
3+
```
4+
```release-note:security
5+
mesh: Add `contains` and `ignoreCase` to L7 Intentions HTTP header matching criteria to support configuration resilient to variable casing and multiple values. This resolves [CVE-2024-10006](https://nvd.nist.gov/vuln/detail/CVE-2024-10006).
6+
```
7+
```release-note:breaking-change
8+
mesh: Enable Envoy `HttpConnectionManager.normalize_path` by default on inbound traffic to mesh proxies. This resolves [CVE-2024-10005](https://nvd.nist.gov/vuln/detail/CVE-2024-10005).
9+
```

agent/structs/config_entry_intentions.go

+16-8
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,15 @@ func (p *IntentionHTTPPermission) Clone() *IntentionHTTPPermission {
426426
}
427427

428428
type IntentionHTTPHeaderPermission struct {
429-
Name string
430-
Present bool `json:",omitempty"`
431-
Exact string `json:",omitempty"`
432-
Prefix string `json:",omitempty"`
433-
Suffix string `json:",omitempty"`
434-
Regex string `json:",omitempty"`
435-
Invert bool `json:",omitempty"`
429+
Name string
430+
Present bool `json:",omitempty"`
431+
Exact string `json:",omitempty"`
432+
Prefix string `json:",omitempty"`
433+
Suffix string `json:",omitempty"`
434+
Contains string `json:",omitempty"`
435+
Regex string `json:",omitempty"`
436+
Invert bool `json:",omitempty"`
437+
IgnoreCase bool `json:",omitempty" alias:"ignore_case"`
436438
}
437439

438440
func cloneStringStringMap(m map[string]string) map[string]string {
@@ -880,8 +882,14 @@ func (e *ServiceIntentionsConfigEntry) validate(legacyWrite bool) error {
880882
if hdr.Suffix != "" {
881883
hdrParts++
882884
}
885+
if hdr.Contains != "" {
886+
hdrParts++
887+
}
883888
if hdrParts != 1 {
884-
return fmt.Errorf(errorPrefix+".Header[%d] should only contain one of Present, Exact, Prefix, Suffix, or Regex", i, j, k)
889+
return fmt.Errorf(errorPrefix+".Header[%d] should only contain one of Present, Exact, Prefix, Suffix, Contains, or Regex", i, j, k)
890+
}
891+
if hdr.IgnoreCase && (hdr.Present || hdr.Regex != "") {
892+
return fmt.Errorf(errorPrefix+".Header[%d] should set one of Exact, Prefix, Suffix, or Contains when using IgnoreCase", i, j, k)
885893
}
886894
permParts++
887895
}

0 commit comments

Comments
 (0)