Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudtrail): Add generic additionalEventData field #418

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading