Skip to content

Commit

Permalink
Merge branch 'main' of github.com:SAP/cloud-active-defense into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric HEBERT committed Apr 5, 2024
2 parents bb8629e + 3968789 commit 73f0ebf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions proxy/wasm/alert/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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
}
Binary file modified proxy/wasm/cloud-active-defense.wasm
Binary file not shown.

0 comments on commit 73f0ebf

Please sign in to comment.