Files
teleport/buf-go.gen.yaml
T
Cam Hutchison 8a32b4d971 usagereporter: Add Identity Security streaming/aggregating events (#63753)
* proto/prehog: Sync from cloud repo for access graph usage

Sync the `prehog.v1` proto package sfrom the cloud
repo to bring in the changes for access graph usage events.

* proto/accessgraph: Extend EventsStreamV2 response for usage events

Extend the EventsStreamV2 response to allow usage events to be sent back
to teleport.

The usage events that can be sent back are currently all defined in the
`prehog.v1alpha` protobuf package. As this does not have a `go_package`
statement, we need to add a `M` flag to the buf config for generating
the Go code. There is no canonical package for the generated code as the
protos live and are generated in two repos (cloud and teleport).

* proto: Regenerate proto/grpc code for access graph usage events

Regenerate the generated proto code to include the changes for access
graph usage events. This includes the following packages:
- `prehog.v1` (Go and Typescript)
- `accessgraph.v1alpha` (Go)

The contents of this commit were auto-generated with:

    make grpc/host

* usagereporter: Add anonymizer for identity security events

Add types compatible with `Anonymizer` for the two identity security
events:
* `prehogv1a.IdentitySecurityGraphSizeEvent`
* `prehogv1a.IdentitySecurityAuditLogsIngestedEvent`

These events are directly transformed as they contain no anonymizable
data.

* usage: Aggregate access graph queries per user

Extend `aggregating.Reporter` to aggregate the number of access graph
queries per user so we can generate monthly user active reports of
access graph usage for self-hosted Teleport customers.

* aggregating: Rename some identitySecurity -> sessionSummary

Rename some variables and functions in the aggregating reporter to more
tightly scope the naming, using "sessionSummary" instead of
"identitySecurity". Another report is to be added named
"identitySecurity" as an aggregation of more general data about the
product.

The existing report defined in the proto -
`IdentitySecuritySummariesGeneratedReport` has been retained as that is
a larger change to make across repositories and with "Summaries" in the
name, is scoped enough to differentiate it from the upcoming report.

* aggregating: Aggregate identity security events into new report

Aggregate the `IdentitySecurityGraphSizeEvent` and
`IdentitySecurityAuditLogsIngestedEvent` events into the
`IdentitySecurityReport` aggregated report.

Aggregation for the graph size events is simply taking the last size of
each provider, as these are essentially guages reporting the size at a
point in time. Aggregation for the audit log events are an accumulation
by provider giving a total count over the report window.
2026-04-10 03:46:59 +00:00

53 lines
2.0 KiB
YAML

version: v2
inputs:
- directory: .
exclude_paths:
# generated by buf-gogo.gen.yaml
- api/proto/teleport/attestation/
- api/proto/teleport/componentfeatures/
- api/proto/teleport/legacy/
- api/proto/teleport/mfa/
- api/proto/teleport/usageevents/
- proto/teleport/lib/web/terminal/envelope.proto
# generated by buf-connect-go.gen.yaml
- proto/prehog/
# generated by buf-ts.gen.yaml, JS-only
- proto/teleport/web/
- directory: .
paths:
# excluded by buf-gogo.gen.yaml
- api/proto/teleport/legacy/client/proto/event.proto
- api/proto/teleport/legacy/client/proto/inventory.proto
- api/proto/teleport/legacy/client/proto/requestable_roles.proto
plugins:
- local:
- go
- run
- google.golang.org/protobuf/cmd/protoc-gen-go
out: .
opt:
- module=github.com/gravitational/teleport
# needed by teleport/lib/teleterm/v1/usage_events.proto because we use
# managed mode for the go package name there
- Mprehog/v1alpha/connect.proto=github.com/gravitational/teleport/gen/proto/go/prehog/v1alpha;prehogv1alpha
# needed by proto/accessraph/v1alpha/access_graph_service.go because it imports it for
# usage events
- Mprehog/v1alpha/teleport.proto=github.com/gravitational/teleport/gen/proto/go/prehog/v1alpha;prehogv1alpha
strategy: all
- local:
- go
- run
- google.golang.org/grpc/cmd/protoc-gen-go-grpc
out: .
opt:
- module=github.com/gravitational/teleport
# needed by teleport/lib/teleterm/v1/usage_events.proto because we use
# managed mode for the go package name there
- Mprehog/v1alpha/connect.proto=github.com/gravitational/teleport/gen/proto/go/prehog/v1alpha;prehogv1alpha
# needed by proto/accessraph/v1alpha/access_graph_service.go because it imports it for
# usage events
- Mprehog/v1alpha/teleport.proto=github.com/gravitational/teleport/gen/proto/go/prehog/v1alpha;prehogv1alpha
strategy: all