You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Runs Lua `Strict` validation in the gateway along with a security hardening module. This module blocks dangerous Lua functionality that may lead to arbitrary code execution on the controller pods.
* Renamed `Syntax` to `InsecureSyntax` validation mode to signify that in this mode Lua won't be validated for possible security gaps. Won't be breaking as `Syntax` mode was not available for use yet. Added a similar warning to `Disabled` validation mode as well.
* Supports option to `disableLua` EnvoyExtensionPolicies feature in the gateway to eliminate arbitrary Lua execution as an attack surface.
Signed-off-by: Rudrakh Panigrahi <[email protected]>
// Execute Lua security wrappers (trusted code) to protect the gateway controller
127
+
// See security advisory: https://github.com/envoyproxy/gateway/security/advisories/GHSA-xrwg-mqj6-6m22
128
+
_=L.DoString(securityData)
129
+
130
+
// Execute user-provided code with panic recovery to prevent controller crashes
131
+
// Although gopher-lua returns errors if it internally panics,
132
+
// this is a defensive measure to prevent the controller from crashing.
133
+
varerrerror
134
+
func() {
135
+
deferfunc() {
136
+
ifr:=recover(); r!=nil {
137
+
err=fmt.Errorf("lua execution panic: %v", r)
138
+
}
139
+
}()
140
+
err=L.DoString(code)
141
+
}()
142
+
143
+
iferr!=nil {
144
+
// Check if timeout occurred
145
+
ifL.Context().Err() ==context.DeadlineExceeded {
146
+
returnfmt.Errorf("lua execution timeout: code took longer than %v", luaExecutionTimeout)
0 commit comments