[GCP][CDR] Add actor.entity.id and target.entity.id fields to audit logs#11983
[GCP][CDR] Add actor.entity.id and target.entity.id fields to audit logs#11983
Conversation
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
|
@romulets The issue stated |
This is the kind of question that emphasises why we want to be working from accepted specifications. Decisions should already have been made and be publicly visible so that we know that we are all on the same page and so that our users know what behaviour they can expect. |
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
History
cc @kubasobon |
|
|
@elastic/obs-service-integrations & @elastic/security-service-integrations I would appreciate someone taking a look here :) |
ishleenk17
left a comment
There was a problem hiding this comment.
I had some Nits and those are addressed. Thanks.
The changes mainly pertain to GCP audit logs owned by Security Service Integrations. I am providing code owner approval from obs-infraobs side.
Please get the code reviewed from security team before merging.
chrisberkhout
left a comment
There was a problem hiding this comment.
Minor question and comment.
Already fine.
There was a problem hiding this comment.
Fine as is, but here's an alternative:
| boolean isKubernetes = false; | |
| if (ctx.json?.resource?.type != null) { | |
| String typ = ctx.json.resource.type; | |
| isKubernetes = (typ == "k8s_cluster" || typ == "gke_cluster" || typ == "kubernetes"); | |
| } | |
| boolean isKubernetes = ["k8s_cluster", "gke_cluster", "kubernetes"].contains(ctx.json?.resource?.type); |
There was a problem hiding this comment.
That's a nice, concise way of setting the flag. I'll keep it in mind for the future.
There was a problem hiding this comment.
Are the outer ifs necessary here? is it okay to just collect entities from any of these locations if they exist?
There was a problem hiding this comment.
We were using streams for similar PRs, but we got pointed toward this approach in #11762.
I agree that nested if clauses are an overkill and we could just try to grab everything. However this way we get a nice readability bump, I think. It tells a story of where each value originates from, and lays solid groundwork for any future PRs.
|
Package gcp - 2.40.0 containing this change is available at https://epr.elastic.co/package/gcp/2.40.0/ |




Proposed commit message
Add
actor.entity.idandtarget.entity.idfields to properly identify events' origins and targets. It is a requirement for https://github.com/elastic/security-team/issues/9352.Warning
To be merged after #11762. Please remember to change the base tomain.Merged. The base is now
main.Checklist
changelog.ymlfile.Related issues