mirror of
https://github.com/containers/podman.git
synced 2025-10-18 11:42:55 +08:00
container create: add inspect data to event
When the new `events_container_create_inspect_data` option is enabled in containers.conf set the `ContainersInspectData` event field for each container-create event. The data was requested for the purpose of auditing (e.g., intrusion detection). Jira: https://issues.redhat.com/browse/RUN-1702 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -63,6 +63,10 @@ func (e EventJournalD) Write(ee Event) error {
|
||||
m["PODMAN_LABELS"] = string(b)
|
||||
}
|
||||
m["PODMAN_HEALTH_STATUS"] = ee.HealthStatus
|
||||
|
||||
if len(ee.Details.ContainerInspectData) > 0 {
|
||||
m["PODMAN_CONTAINER_INSPECT_DATA"] = ee.Details.ContainerInspectData
|
||||
}
|
||||
case Network:
|
||||
m["PODMAN_ID"] = ee.ID
|
||||
m["PODMAN_NETWORK_NAME"] = ee.Network
|
||||
@ -187,6 +191,7 @@ func newEventFromJournalEntry(entry *sdjournal.JournalEntry) (*Event, error) {
|
||||
}
|
||||
}
|
||||
newEvent.HealthStatus = entry.Fields["PODMAN_HEALTH_STATUS"]
|
||||
newEvent.Details.ContainerInspectData = entry.Fields["PODMAN_CONTAINER_INSPECT_DATA"]
|
||||
case Network:
|
||||
newEvent.ID = entry.Fields["PODMAN_ID"]
|
||||
newEvent.Network = entry.Fields["PODMAN_NETWORK_NAME"]
|
||||
|
Reference in New Issue
Block a user