Skip to content

Commit

Permalink
feat(cloudtrail): Add generic additionalEventData field
Browse files Browse the repository at this point in the history
Similar to ct.request, all values should also be available for
additionalEventData.

Signed-off-by: Uli Heilmeier <[email protected]>
  • Loading branch information
uhei authored and poiana committed Feb 23, 2024
1 parent 0e4a687 commit 9a1f86a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/cloudtrail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Here is the current set of supported fields:
| `ct.tlsdetails.tlsversion` | `string` | None | The TLS version of a request. |
| `ct.tlsdetails.ciphersuite` | `string` | None | The cipher suite (combination of security algorithms used) of a request. |
| `ct.tlsdetails.clientprovidedhostheader` | `string` | None | The client-provided host name used in the service API call. |
| `ct.additionaleventdata` | `string` | None | All additonal event data attributes. |
| `s3.uri` | `string` | None | the s3 URI (s3://<bucket>/<key>). |
| `s3.bucket` | `string` | None | the bucket name for s3 events. |
| `s3.key` | `string` | None | the S3 key name. |
Expand Down
7 changes: 7 additions & 0 deletions plugins/cloudtrail/pkg/cloudtrail/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ var supportedFields = []sdk.FieldEntry{
{Type: "string", Name: "ct.tlsdetails.tlsversion", Display: "TLS Version", Desc: "The TLS version of a request."},
{Type: "string", Name: "ct.tlsdetails.ciphersuite", Display: "TLS Cipher Suite", Desc: "The cipher suite (combination of security algorithms used) of a request."},
{Type: "string", Name: "ct.tlsdetails.clientprovidedhostheader", Display: "Client Provided Host Header", Desc: "The client-provided host name used in the service API call."},
{Type: "string", Name: "ct.additionaleventdata", Display: "Additional Event Data", Desc: "All additional event data attributes."},
{Type: "string", Name: "s3.uri", Display: "Key URI", Desc: "the s3 URI (s3://<bucket>/<key>).", Properties: []string{"conversation"}},
{Type: "string", Name: "s3.bucket", Display: "Bucket Name", Desc: "the bucket name for s3 events.", Properties: []string{"conversation"}},
{Type: "string", Name: "s3.key", Display: "Key Name", Desc: "the S3 key name."},
Expand Down Expand Up @@ -643,6 +644,12 @@ func getfieldStr(jdata *fastjson.Value, field string) (bool, string) {
} else {
res = string(val)
}
case "ct.additionaleventdata":
val := jdata.Get("additionalEventData")
if val == nil {
return false, ""
}
res = string(val.MarshalTo(nil))
case "s3.bucket":
val := jdata.GetStringBytes("requestParameters", "bucketName")

Expand Down

0 comments on commit 9a1f86a

Please sign in to comment.