teleport/lib
Gavin Frazar d9b80fb2a7
Emit new event for DynamoDB requests via app access (#17595)
* protobuf update

* Update proto to use dynamodb request event specific to app-access

We will include a similar event for dynamodb via database-access.
We split the events so that app and database access events are not coupled.
This way we do not have to include optional database/app metadata in one event too.

* Update protos

* Update oneof

* Move AppMetaData up with the other metadata and add a 'target' field

* Remove operation plane

* Fix typo

* Configure signing service with transport instead of http client

* Protect from resource exhaustion attacks

* Add IsDynamoDB to types.Application

* Add new event and code for dynamodb requests

* Add async emitter to app access

* Add audit.go to unify app access auditing

* Refactor auditing in app access

* Use the new audit's onSessionChunk/onRequest methods
* Put the session context in the session chunk
* Use a TeeStreamer to send AppSessionDynamoDBRequest directly to audit log as well as session file
* Change streamWriter to streamCloser in sessionChunk to clarify that it should only be used for closing

* Update handler test to test dynamodb events

* Update test to use streamCloser

* Update sever test

* Add doc strings

* Return error from audit interface methods so callers can choose what do to with it

* Move app session start/end into audit interface

* Configure tcpServer to use the server's emitter instead of auth
  client, as an Audit interface.
* Have tcpServer call onSessionStart/End instead of emitting events
  itself.

* Remove unneeded check type

* Rename Transport -> RoundTripper

* Fix test after renaming field

* Rename drainBody and defer body closing

* Fix subtle named return mistake

* Update lib/service/service.go

Co-authored-by: Tobiasz Heller <14020794+tobiaszheller@users.noreply.github.com>

* Update lib/service/service.go

Co-authored-by: Tobiasz Heller <14020794+tobiaszheller@users.noreply.github.com>

* Rename ok->shouldSkipCleanup to make the purpose of it more clear

* Refactor request body decoding into aws utils

* Use request instead of signed request for audit event

* Determine if req is for a dynamo endpoint instead of checking app uri

* Remove obsolete app func IsDynamoDB

* Update handler test

* Use generic console app uri to test that we differentiate request by endpoint instead of app uri
* Use a dynamodb request which has a body to test that we include the body in the audit event
* Test for expected body JSON

* fix lint

* Fixup merge

Co-authored-by: Tobiasz Heller <14020794+tobiaszheller@users.noreply.github.com>
2022-11-15 22:58:15 +00:00
..
asciitable PR Buddy 16673 - fix(asciitable): Default maxCellLength to 0 if negative (#17777) 2022-10-25 14:45:26 +01:00
auditd Do not return error from Auditd when process lacks privileges (#17319) 2022-10-17 18:27:24 +00:00
auth Add support for user.spec in moderated sessions filters (#18402) 2022-11-14 19:44:29 +00:00
backend Run GCI as make fix-imports (#17956) 2022-11-04 15:46:46 +00:00
benchmark Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
bpf Run GCI as make fix-imports (#17956) 2022-11-04 15:46:46 +00:00
cache Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
cgroup Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
circleci CircleCI Secure Joining (#17626) 2022-11-01 12:15:10 +00:00
client Extend loadAllCAs to tsh ssh -J (#17569) 2022-11-08 18:03:25 +00:00
cloud Adds GCP GKE auto-discovery (#17831) 2022-11-11 18:10:29 +00:00
config Adds GCP GKE auto-discovery (#17831) 2022-11-11 18:10:29 +00:00
configurators Add teleport discovery bootstrap command (#17775) 2022-11-02 12:32:23 +00:00
defaults Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
events Emit new event for DynamoDB requests via app access (#17595) 2022-11-15 22:58:15 +00:00
fixtures Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
fuzz Cleanup lint targets 2021-10-19 09:21:55 -06:00
githubactions CircleCI Secure Joining (#17626) 2022-11-01 12:15:10 +00:00
httplib Add test for ConvertResponse and fix url.Err conditional (#18330) 2022-11-15 01:52:36 +00:00
inventory Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
joinserver Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
jwt feat: add GCP KMS support for Teleport CA key material (#17933) 2022-11-11 00:03:49 +00:00
kube Adds GCP GKE auto-discovery (#17831) 2022-11-11 18:10:29 +00:00
labels Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
limiter Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
modules [reopen] Handle private key policy errors for the web UI (#17928) 2022-10-31 23:18:54 +00:00
multiplexer Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
observability Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
pam Run GCI as make fix-imports (#17956) 2022-11-04 15:46:46 +00:00
plugin Add "billing_information" RBAC resource (#5676) 2021-03-01 22:47:03 -05:00
proxy Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
restrictedsession Run GCI as make fix-imports (#17956) 2022-11-04 15:46:46 +00:00
reversetunnel plumb context to keystore methods (#18034) 2022-11-10 18:57:17 -08:00
secret Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
service Emit new event for DynamoDB requests via app access (#17595) 2022-11-15 22:58:15 +00:00
services Adds GCP GKE auto-discovery (#17831) 2022-11-11 18:10:29 +00:00
session Include all active sessions in the web API (#17945) 2022-11-07 20:09:37 +00:00
shell Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
srv Emit new event for DynamoDB requests via app access (#17595) 2022-11-15 22:58:15 +00:00
sshca Remove needlessly complex key generation scheme (#12113) 2022-04-25 09:26:10 +00:00
sshutils Fix compatibility with sshd 7.x (#18181) 2022-11-10 22:50:06 +00:00
system CircleCI Secure Joining (#17626) 2022-11-01 12:15:10 +00:00
tbot Remove deprecated kinds field from tbot config (#18439) 2022-11-14 16:55:48 +00:00
teleagent Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
teleterm Connect: Set up tshd-initiated communication (#17660) 2022-11-08 10:04:00 +00:00
tlsca Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
utils Emit new event for DynamoDB requests via app access (#17595) 2022-11-15 22:58:15 +00:00
versioncontrol Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
web set cluster connector name on signin for first cloud user (#17834) 2022-11-14 14:52:42 +00:00
runtimeflags.go Correct various typos 2017-10-20 10:20:26 +02:00