prehogv1

package
v0.0.0-...-5c79d48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserKind_name = map[int32]string{
		0: "USER_KIND_UNSPECIFIED",
		1: "USER_KIND_HUMAN",
		2: "USER_KIND_BOT",
	}
	UserKind_value = map[string]int32{
		"USER_KIND_UNSPECIFIED": 0,
		"USER_KIND_HUMAN":       1,
		"USER_KIND_BOT":         2,
	}
)

Enum value maps for UserKind.

View Source
var (
	ResourceKind_name = map[int32]string{
		0: "RESOURCE_KIND_UNSPECIFIED",
		1: "RESOURCE_KIND_NODE",
		2: "RESOURCE_KIND_APP_SERVER",
		3: "RESOURCE_KIND_KUBE_SERVER",
		4: "RESOURCE_KIND_DB_SERVER",
		5: "RESOURCE_KIND_WINDOWS_DESKTOP",
		6: "RESOURCE_KIND_NODE_OPENSSH",
		7: "RESOURCE_KIND_NODE_OPENSSH_EICE",
	}
	ResourceKind_value = map[string]int32{
		"RESOURCE_KIND_UNSPECIFIED":       0,
		"RESOURCE_KIND_NODE":              1,
		"RESOURCE_KIND_APP_SERVER":        2,
		"RESOURCE_KIND_KUBE_SERVER":       3,
		"RESOURCE_KIND_DB_SERVER":         4,
		"RESOURCE_KIND_WINDOWS_DESKTOP":   5,
		"RESOURCE_KIND_NODE_OPENSSH":      6,
		"RESOURCE_KIND_NODE_OPENSSH_EICE": 7,
	}
)

Enum value maps for ResourceKind.

View Source
var File_prehog_v1_teleport_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ResourceKind

type ResourceKind int32

the kind of a "resource" (e.g. a node, a database, a desktop, etc.) Keep in sync with prehog/v1alpha/teleport.proto

const (
	ResourceKind_RESOURCE_KIND_UNSPECIFIED ResourceKind = 0
	// PostHog property value: "node"
	ResourceKind_RESOURCE_KIND_NODE ResourceKind = 1
	// PostHog property value: "app_server"
	ResourceKind_RESOURCE_KIND_APP_SERVER ResourceKind = 2
	// PostHog property value: "kube_server"
	ResourceKind_RESOURCE_KIND_KUBE_SERVER ResourceKind = 3
	// PostHog property value: "db_server"
	ResourceKind_RESOURCE_KIND_DB_SERVER ResourceKind = 4
	// PostHog property value: "windows_desktop"
	ResourceKind_RESOURCE_KIND_WINDOWS_DESKTOP ResourceKind = 5
	// ServerV3 ("node") heartbeat with a subkind of "openssh" (as opposed to
	// empty or "teleport"); not used in keepalives
	//
	// PostHog property value: "node.openssh"
	ResourceKind_RESOURCE_KIND_NODE_OPENSSH ResourceKind = 6
	// ServerV3 ("node") heartbeat with a subkind of "openssh-ec2-ice".
	// Nodes that map EC2 instances and are accessed using EC2 Instance Connect Endpoint.
	// Not used in keepalives.
	// This is the SubKind SubKindOpenSSHEICENode in teleport repo.
	//
	// PostHog property value: "node.openssh_ec2_ice"
	ResourceKind_RESOURCE_KIND_NODE_OPENSSH_EICE ResourceKind = 7
)

func (ResourceKind) Descriptor

func (ResourceKind) Enum

func (x ResourceKind) Enum() *ResourceKind

func (ResourceKind) EnumDescriptor deprecated

func (ResourceKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use ResourceKind.Descriptor instead.

func (ResourceKind) Number

func (ResourceKind) String

func (x ResourceKind) String() string

func (ResourceKind) Type

type ResourceKindPresenceReport

type ResourceKindPresenceReport struct {

	// the kind of resource
	ResourceKind ResourceKind `` /* 126-byte string literal not displayed */
	// first 8 bytes of anonymized resource name
	ResourceIds []uint64 `protobuf:"fixed64,2,rep,packed,name=resource_ids,json=resourceIds,proto3" json:"resource_ids,omitempty"`
	// contains filtered or unexported fields
}

Counts all resources of one kind that were active during the time window to track the number of active resources in a cluster over time.

func (*ResourceKindPresenceReport) Descriptor deprecated

func (*ResourceKindPresenceReport) Descriptor() ([]byte, []int)

Deprecated: Use ResourceKindPresenceReport.ProtoReflect.Descriptor instead.

func (*ResourceKindPresenceReport) GetResourceIds

func (x *ResourceKindPresenceReport) GetResourceIds() []uint64

func (*ResourceKindPresenceReport) GetResourceKind

func (x *ResourceKindPresenceReport) GetResourceKind() ResourceKind

func (*ResourceKindPresenceReport) ProtoMessage

func (*ResourceKindPresenceReport) ProtoMessage()

func (*ResourceKindPresenceReport) ProtoReflect

func (*ResourceKindPresenceReport) Reset

func (x *ResourceKindPresenceReport) Reset()

func (*ResourceKindPresenceReport) String

func (x *ResourceKindPresenceReport) String() string

type ResourcePresenceReport

type ResourcePresenceReport struct {

	// randomly generated UUID for this specific report, 16 bytes (in string order)
	ReportUuid []byte `protobuf:"bytes,1,opt,name=report_uuid,json=reportUuid,proto3" json:"report_uuid,omitempty"`
	// anonymized, 32 bytes (HMAC-SHA-256)
	ClusterName []byte `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"`
	// anonymized, 32 bytes (HMAC-SHA-256)
	ReporterHostid []byte `protobuf:"bytes,3,opt,name=reporter_hostid,json=reporterHostid,proto3" json:"reporter_hostid,omitempty"`
	// beginning of the time window for this data; ending is not specified but is
	// intended to be at most one hour
	StartTime           *timestamppb.Timestamp        `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	ResourceKindReports []*ResourceKindPresenceReport `protobuf:"bytes,5,rep,name=resource_kind_reports,json=resourceKindReports,proto3" json:"resource_kind_reports,omitempty"`
	// contains filtered or unexported fields
}

func (*ResourcePresenceReport) Descriptor deprecated

func (*ResourcePresenceReport) Descriptor() ([]byte, []int)

Deprecated: Use ResourcePresenceReport.ProtoReflect.Descriptor instead.

func (*ResourcePresenceReport) GetClusterName

func (x *ResourcePresenceReport) GetClusterName() []byte

func (*ResourcePresenceReport) GetReportUuid

func (x *ResourcePresenceReport) GetReportUuid() []byte

func (*ResourcePresenceReport) GetReporterHostid

func (x *ResourcePresenceReport) GetReporterHostid() []byte

func (*ResourcePresenceReport) GetResourceKindReports

func (x *ResourcePresenceReport) GetResourceKindReports() []*ResourceKindPresenceReport

func (*ResourcePresenceReport) GetStartTime

func (x *ResourcePresenceReport) GetStartTime() *timestamppb.Timestamp

func (*ResourcePresenceReport) ProtoMessage

func (*ResourcePresenceReport) ProtoMessage()

func (*ResourcePresenceReport) ProtoReflect

func (x *ResourcePresenceReport) ProtoReflect() protoreflect.Message

func (*ResourcePresenceReport) Reset

func (x *ResourcePresenceReport) Reset()

func (*ResourcePresenceReport) String

func (x *ResourcePresenceReport) String() string

type SubmitUsageReportsRequest

type SubmitUsageReportsRequest struct {

	// at most 10 reports of all kinds in a single RPC, each shouldn't exceed 128KiB or so
	//
	// each report is encoded as a separate tp.user.activity PostHog event
	UserActivity []*UserActivityReport `protobuf:"bytes,1,rep,name=user_activity,json=userActivity,proto3" json:"user_activity,omitempty"`
	// encoded as a separate tp.resource.counts PostHog event
	ResourcePresence []*ResourcePresenceReport `protobuf:"bytes,2,rep,name=resource_presence,json=resourcePresence,proto3" json:"resource_presence,omitempty"`
	// contains filtered or unexported fields
}

func (*SubmitUsageReportsRequest) Descriptor deprecated

func (*SubmitUsageReportsRequest) Descriptor() ([]byte, []int)

Deprecated: Use SubmitUsageReportsRequest.ProtoReflect.Descriptor instead.

func (*SubmitUsageReportsRequest) GetResourcePresence

func (x *SubmitUsageReportsRequest) GetResourcePresence() []*ResourcePresenceReport

func (*SubmitUsageReportsRequest) GetUserActivity

func (x *SubmitUsageReportsRequest) GetUserActivity() []*UserActivityReport

func (*SubmitUsageReportsRequest) ProtoMessage

func (*SubmitUsageReportsRequest) ProtoMessage()

func (*SubmitUsageReportsRequest) ProtoReflect

func (*SubmitUsageReportsRequest) Reset

func (x *SubmitUsageReportsRequest) Reset()

func (*SubmitUsageReportsRequest) String

func (x *SubmitUsageReportsRequest) String() string

type SubmitUsageReportsResponse

type SubmitUsageReportsResponse struct {

	// randomly generated UUID for this specific batch, 16 bytes (in string order)
	//
	// PostHog property: tp.batch_uuid (in each report of the batch)
	BatchUuid []byte `protobuf:"bytes,1,opt,name=batch_uuid,json=batchUuid,proto3" json:"batch_uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*SubmitUsageReportsResponse) Descriptor deprecated

func (*SubmitUsageReportsResponse) Descriptor() ([]byte, []int)

Deprecated: Use SubmitUsageReportsResponse.ProtoReflect.Descriptor instead.

func (*SubmitUsageReportsResponse) GetBatchUuid

func (x *SubmitUsageReportsResponse) GetBatchUuid() []byte

func (*SubmitUsageReportsResponse) ProtoMessage

func (*SubmitUsageReportsResponse) ProtoMessage()

func (*SubmitUsageReportsResponse) ProtoReflect

func (*SubmitUsageReportsResponse) Reset

func (x *SubmitUsageReportsResponse) Reset()

func (*SubmitUsageReportsResponse) String

func (x *SubmitUsageReportsResponse) String() string

type UserActivityRecord

type UserActivityRecord struct {

	// anonymized, 32 bytes (HMAC-SHA-256)
	//
	// key of the tp.records map in tp.user.activity (in base64)
	UserName []byte `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
	// Indicates the type of user, e.g. bot or human, if known.
	UserKind UserKind `protobuf:"varint,14,opt,name=user_kind,json=userKind,proto3,enum=prehog.v1.UserKind" json:"user_kind,omitempty"`
	// counter of user.login events
	Logins uint64 `protobuf:"varint,2,opt,name=logins,proto3" json:"logins,omitempty"`
	// counter of session.start events (non-Kube)
	SshSessions uint64 `protobuf:"varint,3,opt,name=ssh_sessions,json=sshSessions,proto3" json:"ssh_sessions,omitempty"`
	// counter of app.session.start events (non-TCP)
	AppSessions uint64 `protobuf:"varint,4,opt,name=app_sessions,json=appSessions,proto3" json:"app_sessions,omitempty"`
	// counter of session.start events (only Kube)
	KubeSessions uint64 `protobuf:"varint,5,opt,name=kube_sessions,json=kubeSessions,proto3" json:"kube_sessions,omitempty"`
	// counter of db.session.start events
	DbSessions uint64 `protobuf:"varint,6,opt,name=db_sessions,json=dbSessions,proto3" json:"db_sessions,omitempty"`
	// counter of windows.desktop.session.start events
	DesktopSessions uint64 `protobuf:"varint,7,opt,name=desktop_sessions,json=desktopSessions,proto3" json:"desktop_sessions,omitempty"`
	// counter of app.session.start events (only TCP)
	AppTcpSessions uint64 `protobuf:"varint,8,opt,name=app_tcp_sessions,json=appTcpSessions,proto3" json:"app_tcp_sessions,omitempty"`
	// counter of port events (both SSH and Kube)
	//
	// Deprecated: Marked as deprecated in prehog/v1/teleport.proto.
	SshPortSessions uint64 `protobuf:"varint,9,opt,name=ssh_port_sessions,json=sshPortSessions,proto3" json:"ssh_port_sessions,omitempty"`
	// counter of kube.request events
	KubeRequests uint64 `protobuf:"varint,10,opt,name=kube_requests,json=kubeRequests,proto3" json:"kube_requests,omitempty"`
	// counter of sftp events
	SftpEvents uint64 `protobuf:"varint,11,opt,name=sftp_events,json=sftpEvents,proto3" json:"sftp_events,omitempty"`
	// counter of port events (only SSH)
	SshPortV2Sessions uint64 `protobuf:"varint,12,opt,name=ssh_port_v2_sessions,json=sshPortV2Sessions,proto3" json:"ssh_port_v2_sessions,omitempty"`
	// counter of port events (only Kube)
	KubePortSessions uint64 `protobuf:"varint,13,opt,name=kube_port_sessions,json=kubePortSessions,proto3" json:"kube_port_sessions,omitempty"`
	// counter of SPIFFE SVIDs issued
	SpiffeSvidsIssued uint64 `protobuf:"varint,15,opt,name=spiffe_svids_issued,json=spiffeSvidsIssued,proto3" json:"spiffe_svids_issued,omitempty"`
	// contains filtered or unexported fields
}

a set of activity counters for a single user; some old versions report "ssh_port_sessions", counting both SSH port forwards and kubectl port-forward connections in a single counter

fields other than user_name are encoded as the same field name in PostHog

func (*UserActivityRecord) Descriptor deprecated

func (*UserActivityRecord) Descriptor() ([]byte, []int)

Deprecated: Use UserActivityRecord.ProtoReflect.Descriptor instead.

func (*UserActivityRecord) GetAppSessions

func (x *UserActivityRecord) GetAppSessions() uint64

func (*UserActivityRecord) GetAppTcpSessions

func (x *UserActivityRecord) GetAppTcpSessions() uint64

func (*UserActivityRecord) GetDbSessions

func (x *UserActivityRecord) GetDbSessions() uint64

func (*UserActivityRecord) GetDesktopSessions

func (x *UserActivityRecord) GetDesktopSessions() uint64

func (*UserActivityRecord) GetKubePortSessions

func (x *UserActivityRecord) GetKubePortSessions() uint64

func (*UserActivityRecord) GetKubeRequests

func (x *UserActivityRecord) GetKubeRequests() uint64

func (*UserActivityRecord) GetKubeSessions

func (x *UserActivityRecord) GetKubeSessions() uint64

func (*UserActivityRecord) GetLogins

func (x *UserActivityRecord) GetLogins() uint64

func (*UserActivityRecord) GetSftpEvents

func (x *UserActivityRecord) GetSftpEvents() uint64

func (*UserActivityRecord) GetSpiffeSvidsIssued

func (x *UserActivityRecord) GetSpiffeSvidsIssued() uint64

func (*UserActivityRecord) GetSshPortSessions deprecated

func (x *UserActivityRecord) GetSshPortSessions() uint64

Deprecated: Marked as deprecated in prehog/v1/teleport.proto.

func (*UserActivityRecord) GetSshPortV2Sessions

func (x *UserActivityRecord) GetSshPortV2Sessions() uint64

func (*UserActivityRecord) GetSshSessions

func (x *UserActivityRecord) GetSshSessions() uint64

func (*UserActivityRecord) GetUserKind

func (x *UserActivityRecord) GetUserKind() UserKind

func (*UserActivityRecord) GetUserName

func (x *UserActivityRecord) GetUserName() []byte

func (*UserActivityRecord) ProtoMessage

func (*UserActivityRecord) ProtoMessage()

func (*UserActivityRecord) ProtoReflect

func (x *UserActivityRecord) ProtoReflect() protoreflect.Message

func (*UserActivityRecord) Reset

func (x *UserActivityRecord) Reset()

func (*UserActivityRecord) String

func (x *UserActivityRecord) String() string

type UserActivityReport

type UserActivityReport struct {

	// randomly generated UUID for this specific report, 16 bytes (in string order)
	//
	// PostHog property: tp.report_uuid (in 8-4-4-4-12 string form)
	ReportUuid []byte `protobuf:"bytes,1,opt,name=report_uuid,json=reportUuid,proto3" json:"report_uuid,omitempty"`
	// cluster name, anonymized, 32 bytes (HMAC-SHA-256)
	//
	// PostHog property: tp.cluster_name (in base64)
	ClusterName []byte `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"`
	// hostid of the auth that collected this report, anonymized, 32 bytes (HMAC-SHA-256)
	//
	// PostHog property: tp.reporter_hostid (in base64)
	ReporterHostid []byte `protobuf:"bytes,3,opt,name=reporter_hostid,json=reporterHostid,proto3" json:"reporter_hostid,omitempty"`
	// beginning of the time window for this data; ending is not specified but is
	// intended to be at most 15 minutes
	//
	// PostHog timestamp (not a property, the ingest time is tp.report_time instead)
	StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// one set of counters for each user
	//
	// PostHog property: tp.records (encoded as a map keyed by username, not as a list)
	Records []*UserActivityRecord `protobuf:"bytes,5,rep,name=records,proto3" json:"records,omitempty"`
	// contains filtered or unexported fields
}

counters for user activity coming from a specific auth server from a specific cluster, for a time window of up to 15 minutes

PostHog event: tp.user.activity

func (*UserActivityReport) Descriptor deprecated

func (*UserActivityReport) Descriptor() ([]byte, []int)

Deprecated: Use UserActivityReport.ProtoReflect.Descriptor instead.

func (*UserActivityReport) GetClusterName

func (x *UserActivityReport) GetClusterName() []byte

func (*UserActivityReport) GetRecords

func (x *UserActivityReport) GetRecords() []*UserActivityRecord

func (*UserActivityReport) GetReportUuid

func (x *UserActivityReport) GetReportUuid() []byte

func (*UserActivityReport) GetReporterHostid

func (x *UserActivityReport) GetReporterHostid() []byte

func (*UserActivityReport) GetStartTime

func (x *UserActivityReport) GetStartTime() *timestamppb.Timestamp

func (*UserActivityReport) ProtoMessage

func (*UserActivityReport) ProtoMessage()

func (*UserActivityReport) ProtoReflect

func (x *UserActivityReport) ProtoReflect() protoreflect.Message

func (*UserActivityReport) Reset

func (x *UserActivityReport) Reset()

func (*UserActivityReport) String

func (x *UserActivityReport) String() string

type UserKind

type UserKind int32

The kind of user a given username refers to. Usernames should always refer to a valid cluster user (even if temporary, e.g. SSO), but may be Machine ID bot users.

const (
	// Indicates a legacy cluster emitting events without a defined user kind.
	// Note that users (from PostHog's perspective) can be identified via future
	// events if the cluster is upgraded to specify this field.
	//
	// PostHog property value: ""
	UserKind_USER_KIND_UNSPECIFIED UserKind = 0
	// Indicates the user associated with this event is human, either created
	// locally or via SSO.
	//
	// PostHog property value: "human"
	UserKind_USER_KIND_HUMAN UserKind = 1
	// Indicates the user associated with this event is a Machine ID bot user.
	//
	// PostHog property value: "bot"
	UserKind_USER_KIND_BOT UserKind = 2
)

func (UserKind) Descriptor

func (UserKind) Descriptor() protoreflect.EnumDescriptor

func (UserKind) Enum

func (x UserKind) Enum() *UserKind

func (UserKind) EnumDescriptor deprecated

func (UserKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use UserKind.Descriptor instead.

func (UserKind) Number

func (x UserKind) Number() protoreflect.EnumNumber

func (UserKind) String

func (x UserKind) String() string

func (UserKind) Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL