Commit Graph
17 Commits
Author SHA1 Message Date
Krzysztof SkrzętnickiandSTeve Huang 18fe621bab convert db lib to use slog, part 2 (#43849)
* Switch Engine, EngineConfig and SessionContext to slog.

* Apply suggestions from code review

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>

* fix some lint issues, restore trace logs,

* fix tests

* fix some more lint issues

---------

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>
2024-07-04 15:22:30 +00:00
Forrest 1742c46887 readonly shared cluster configs (#43422) 2024-07-02 17:23:13 +00:00
Krzysztof Skrzętnicki 18b6b7f11a Database Access: decouple Auth from Session (#43344)
* Database Access: decouple Auth from Session, add SessionAuth wrapper, share CloudClients instance, update tests.

* Drop `SessionAuth` interface, shift usages over to updated `Auth` interface

* Drop unused params
2024-06-26 06:03:14 +00:00
Tim Buckley f7e97d0c3c Add bot field to certificates and various usage events (#35881)
* Add bot field to certificates and various usage events

This adds a new certificate extension field, `teleport-bot`, to
certificates issued to Machine ID bot users that can definitively
identify certificates as having been issued to a bot user.

Additionally, this uses the new `Bot` identity flag to mark certain
usage events as originating from bot users. As such, it includes a
protobuf update from Cloud [1], which pulled in some small additional
(mostly comment) changes.

[1] https://github.com/gravitational/cloud/pull/7060

* Small bot flag plumbing fixes

* Convert bot flag to BotName and UserKind enum

This makes a few changes to the bot tagging approach:
* The bot name is embedded in the cert rather than just true/false
* UserKind is included in events rather than just a bot flag, to
  allow for an unspecified value for older client nodes.

* Add a quick unit test for bot cert extensions

* Fix outdated grpc

* Include bot flag on initial certs

* Log a warning and override user kind for usage records if they differ

* Fix several unit tests; add a bot metadata test case

* Fix unit tests with UserKind zero value

* Rename SSH cert extension to use standard format

Renames the `teleport-bot` extension to `bot-name@goteleport.com`,
to better follow SSH cert extension naming conventions.

* Attempt to improve unspecified userkind aggregating logic
2024-01-04 23:07:08 +00:00
fheinecke b178b8b732 Updated Teleport codebase to AGPL3 license (#35259)
Signed-off-by: Fred Heinecke <fred.heinecke@goteleport.com>
2023-12-01 17:48:14 +00:00
Gabriel Corado 86358c14e4 Support auditing chunked SQL Server packets (#29228)
* feat(sqlserver): parse chunked packets

* chore(sqlserver): fix typo

* fix(sqlserver): assert final packet on flag bit

* refactor(sqlserver): return chunks data using Bytes()

* chore(sqlserver): update comparision logic

* chore(sqlserver): typo
2023-08-09 03:18:52 +00:00
Krzysztof Skrzętnicki 32ccd98af0 Add metrics for database service (#28150)
* Add DB metrics

* Address PR feedback.

- rename functions to better indicate their intent
- drop unused clock field
- cache labels
- add godoc

* Refactoring to return concrete types instead of interfaces.
2023-08-07 08:25:40 +00:00
Marek Smoliński d4805cc428 Extend DatabaseSessionStart posthog event (#28931) 2023-07-14 07:15:02 +00:00
Andrew LeFevre d4b3afe9a1 split recording session events and emitting audit events (#27873)
* split recording session events and emitting audit events

This is a refactor of how audit events and session events are handled.
Previously, all events were emitted using the same interface,
api/types/events.Emitter. This lead to event-related code getting to be
very confusing, as it was often unclear whether a given event was being
recorded as a session event and emitted as an audit event, or only one
of the two. Naturally, a few bugs arose due to this.

To simplify event handling, a separate interface for recording session
events has been created. A api/types/events.Recorder should now only be
used to record session events, and an Emitter should now only be used to
emit audit events. Instead of using a confusing TeeWriter that would
transparently (and confusingly, given its name) hold a few event types
that only belonged in session recordings, callers can now explicitly
record and/or emit an event when necessary.

* ensure e build won't break
2023-07-11 19:53:33 +00:00
Steven Martin b4e1f39742 Fix DB Query always return success false in audit log (#23270)
* Initialize db query to status of success true

* Init event status as success true
2023-03-18 14:01:30 +00:00
Gabriel Corado 22dc3dfb2e Update SQL Server library (#21065)
* refactor(sqlserver): change to microsoft fork

* chore(gomod): update mssqldb dep

* test(sqlserver): add server on parsing PLP RPC packets

* fix(db): change mssql import

* chore(gomod): update go-mssqldb reference

* test(protocol): use fuzz arguments

* chore: code review suggestions

* test(sqlserver): add missing protocols attribute
2023-02-10 11:39:11 +00:00
Alan Parra 11d58e25c7 Refactor AccessMFAParams and MFAParams to allow additional data (#20300)
Refactor `services.AccessMFAParams` and the accompanying `MFAParams` methods so
they may be extended to carry additional data (eg, information required to
perform device trust checks).

This PR refactors existing code without adding any new functionality, so it may
be backported to older branches to alleviate eventual conflicts. Follow up
changes will take advantage of it to add support for device trust.

Related to gravitational/teleport.e#514.
2023-01-17 20:02:38 +00:00
Christopher Cooper 9c2192ebb6 Prepare sql server kinit authorization (#18299) 2022-12-06 22:55:20 +00:00
Gabriel Corado 65c022893d Add Azure AD user managed identity authentication for SQL server (#17142) 2022-10-21 15:06:51 +00:00
Brian Joerger 2654add770 RequireMFAType (#16034)
Replace role/authPref RequireSessionMFA (bool) with RequireMFAType
(string).

  - Add new RequireMFAType constant values with custom boolean marshalling.

  - Add RequireMFAType to role and auth preference and deprecate
RequireSessionMFA.

  - Add session-mfa override login when hardware_key_touch is enforced.

  - Add protobuf enum for RequireMFAType.

  - Add support for proto enums in protoc-gen-crd and update Kubernetes
Operator manifests.
2022-09-22 20:30:32 +00:00
Marek Smoliński d1db890a10 SQLServer event add missing conversion (#13094) 2022-06-03 10:31:41 +00:00
Marek Smoliński 4602b485ef SQLServer audit events (#12521) 2022-05-31 14:43:40 +02:00