diff --git a/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap b/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap index 2f2a06da4..d8ce8a736 100644 --- a/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap +++ b/packages/teleport/src/Audit/__snapshots__/Audit.story.test.tsx.snap @@ -2422,7 +2422,7 @@ exports[`list of all events 1`] = ` - Program [bash] opened a connection [10.217.136.161 <-> 190.58.129.4:3000] within a session [44c6cea8-362f-11ea-83aa-125400432324] + [DENY] Program [bash] was prevented from opening a connection [10.217.136.161 <-> 190.58.129.4:3000] within a session [44c6cea8-362f-11ea-83aa-125400432324] - Program [bash] opened a connection [10.217.136.161 <-> 190.58.129.4:3000] within a session [44c6cea8-362f-11ea-83aa-125400432324] + [ALLOW] Program [bash] successfully opened a connection [10.217.136.161 <-> 190.58.129.4:3000] within a session [44c6cea8-362f-11ea-83aa-125400432324] - `Program [${program}] opened a connection [${src_addr} <-> ${dst_addr}:${dst_port}] within a session [${sid}]`, + format: ({ action, sid, program, src_addr, dst_addr, dst_port }) => { + const a = action === 1 ? '[DENY]' : '[ALLOW]'; + const desc = + action === 1 ? 'was prevented from opening' : 'successfully opened'; + return `${a} Program [${program}] ${desc} a connection [${src_addr} <-> ${dst_addr}:${dst_port}] within a session [${sid}]`; + }, }, [eventCodes.SESSION_PROCESS_EXIT]: { type: 'session.process_exit', diff --git a/packages/teleport/src/services/audit/types.ts b/packages/teleport/src/services/audit/types.ts index 2da0a95c3..a32940aad 100644 --- a/packages/teleport/src/services/audit/types.ts +++ b/packages/teleport/src/services/audit/types.ts @@ -571,6 +571,7 @@ type RawEventCommand = RawEvent< type RawEventNetwork = RawEvent< T, { + action: number; login: string; namespace: string; pid: number; diff --git a/yarn.lock b/yarn.lock index 796e2128c..8da3c2552 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2181,11 +2181,6 @@ "@types/minimatch" "*" "@types/node" "*" -"@types/google-protobuf@^3.7.2": - version "3.7.4" - resolved "https://registry.yarnpkg.com/@types/google-protobuf/-/google-protobuf-3.7.4.tgz#1621c50ceaf5aefa699851da8e0ea606a2943a39" - integrity sha512-6PjMFKl13cgB4kRdYtvyjKl8VVa0PXS2IdVxHhQ8GEKbxBkyJtSbaIeK1eZGjDKN7dvUh4vkOvU9FMwYNv4GQQ== - "@types/hast@^2.0.0": version "2.3.1" resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.1.tgz#b16872f2a6144c7025f296fb9636a667ebb79cd9"