forked from signalsciences/sigsci-module-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpc.go
49 lines (44 loc) · 2.39 KB
/
rpc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package sigsci
//go:generate msgp -unexported -tests=false
//
// This is for messages to and from the agent
//
// RPCMsgIn is the primary message from the webserver module to the agent
type RPCMsgIn struct {
AccessKeyID string // AccessKeyID optional, what Site does this belong too (deprecated)
ModuleVersion string // The module build version
ServerVersion string // Main server identifier "apache 2.0.46..."
ServerFlavor string // Any other webserver configuration info (optional)
ServerName string // As in request website URL
Timestamp int64 // Start of request in the number of seconds elapsed since January 1, 1970 UTC.
NowMillis int64 // Current time, the number of milliseconds elapsed since January 1, 1970 UTC.
RemoteAddr string // Remote IP Address, from request socket
Method string // GET/POST, etc...
Scheme string // http/https
URI string // /path?query
Protocol string // HTTP protocol
TLSProtocol string // e.g. TLSv1.2
TLSCipher string // e.g. ECDHE-RSA-AES128-GCM-SHA256
WAFResponse int32 // Optional
ResponseCode int32 // HTTP Response Status Code, -1 if unknown
ResponseMillis int64 // HTTP Milliseconds - How many milliseconds did the full request take, -1 if unknown
ResponseSize int64 // HTTP Response size, -1 if unknown
HeadersIn [][2]string // HTTP Request headers (slice of name/value pairs); nil ok
HeadersOut [][2]string // HTTP Response headers (slice of name/value pairs); nil ok
PostBody string // HTTP Request body; empty string if none
}
// RPCMsgOut is sent back to the webserver
type RPCMsgOut struct {
WAFResponse int32
RequestID string `json:",omitempty"` // Set if the server expects an UpdateRequest with this ID (UUID)
RequestHeaders [][2]string `json:",omitempty"` // Any additional information in the form of additional request headers
}
// RPCMsgIn2 is a follow-up message from the webserver to the Agent
// Note there is no formal response to this message
type RPCMsgIn2 struct {
RequestID string // The request id (UUID)
ResponseCode int32 // HTTP status code did the webserver send back
ResponseMillis int64 // How many milliseconds did the full request take
ResponseSize int64 // how many bytes did the webserver send back
HeadersOut [][2]string
}