diff --git a/proxy/wasm/alert/alert.go b/proxy/wasm/alert/alert.go index 35a1576..ee901af 100644 --- a/proxy/wasm/alert/alert.go +++ b/proxy/wasm/alert/alert.go @@ -73,8 +73,8 @@ func SendAlert(filter *config_parser.FilterType, logParameters map[string]string RequestID: headers["x-request-id"], DestinationIP: string(destinationIP[:]), Url: headers[":authority"], - Server: string(server[:]), - Useragent: headers["user-agent"], + Server: truncate(string(server[:])), + Useragent: truncate(headers["user-agent"]), SourceIP: string(sourceIP[:]), Path: headers[":path"], Method: headers[":method"], @@ -104,3 +104,11 @@ func SendAlert(filter *config_parser.FilterType, logParameters map[string]string // proxywasm.LogWarn("\n" + alertMessage + ": !!!!!!! ALERT !!!!!!! DECOY TRIGGERED !!!!!!! ALERT !!!!!!! DECOY TRIGGERED !!!!!!! ALERT !!!!!!!") return nil } + +func truncate(s string) string { + maxLength := 300 + if len(s) > maxLength { + return s[:maxLength] + } + return s +} \ No newline at end of file diff --git a/proxy/wasm/cloud-active-defense.wasm b/proxy/wasm/cloud-active-defense.wasm index 8eda3af..df6e392 100755 Binary files a/proxy/wasm/cloud-active-defense.wasm and b/proxy/wasm/cloud-active-defense.wasm differ