Skip to content

Commit

Permalink
Merge branch 'master' into tener/packet-tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tener authored Dec 16, 2024
2 parents ffda9a7 + e5487aa commit f07f2ec
Show file tree
Hide file tree
Showing 770 changed files with 20,728 additions and 10,895 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ jobs:
pkg:cargo/zerofrom-derive,
pkg:cargo/zerovec,
pkg:cargo/zerovec-derive,
pkg:npm/cspell/dict-en-common-misspellings,
pkg:npm/prettier
29 changes: 28 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
has_go: ${{ steps.changes.outputs.has_go }}
has_rust: ${{ steps.changes.outputs.has_rust }}
has_proto: ${{ steps.changes.outputs.has_proto }}
has_rfd: ${{ steps.changes.outputs.has_rfd }}
steps:
- name: Checkout
if: ${{ github.event_name == 'merge_group' }}
Expand All @@ -26,6 +27,10 @@ jobs:
base: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
filters: |
has_rfd:
- '.github/workflows/lint.yaml'
- 'rfd/**.md'
- 'rfd/cspell.json'
has_go:
- '.github/workflows/lint.yaml'
- '**.go'
Expand Down Expand Up @@ -88,7 +93,7 @@ jobs:
find . -path ./e -prune -o -name go.mod -print | while read f; do
echo "checking $f"
pushd $(dirname "$f") > /dev/null;
go mod tidy -diff;
go mod tidy -diff || (echo "Run 'make go-mod-tidy-all' to resolve" && exit 1);
popd > /dev/null;
done
Expand Down Expand Up @@ -231,3 +236,25 @@ jobs:
# We have to add the current directory as a safe directory or else git commands will not work as expected.
# The protoc-gen-terraform version must match the version in integrations/terraform/Makefile
run: git config --global --add safe.directory $(realpath .) && go install github.com/gravitational/protoc-gen-terraform@c91cc3ef4d7d0046c36cb96b1cd337e466c61225 && make terraform-resources-up-to-date

lint-rfd:
name: Lint (RFD)
needs: changes
if: ${{ !startsWith(github.head_ref, 'dependabot/') && needs.changes.outputs.has_rfd == 'true' }}
runs-on: ubuntu-22.04

permissions:
contents: read

container:
image: ghcr.io/gravitational/teleport-buildbox:teleport17

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install JS dependencies
run: pnpm install --frozen-lockfile

- name: Check spelling
run: pnpm cspell -c ./rfd/cspell.json rfd
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ linters-settings:
desc: 'use "golang.org/x/mod/semver" or "coreos/go-semver/semver" instead'
- pkg: github.com/microsoftgraph/msgraph-sdk-go
desc: 'use "github.com/gravitational/teleport/lib/msgraph" instead'
- pkg: github.com/cloudflare/cfssl
desc: 'use "crypto" or "x/crypto" instead'
# Prevent logrus from being imported by api and e. Once everything in teleport has been converted
# to use log/slog this should be moved into the main block above.
logrus:
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1839,3 +1839,7 @@ create-github-release:
--latest=$(LATEST) \
--verify-tag \
-F - <<< "$$NOTES"

.PHONY: go-mod-tidy-all
go-mod-tidy-all:
find . -type "f" -name "go.mod" -execdir go mod tidy \;
2 changes: 1 addition & 1 deletion api/accessrequest/access_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func GetResourceDetails(ctx context.Context, clusterName string, lister client.L
var resourceIDs []types.ResourceID
for _, resourceID := range ids {
// We're interested in hostname or friendly name details. These apply to
// nodes, app servers, and user groups.
// nodes, app servers, user groups and Identity Center resources.
switch resourceID.Kind {
case types.KindNode, types.KindApp, types.KindUserGroup, types.KindIdentityCenterAccount:
resourceIDs = append(resourceIDs, resourceID)
Expand Down
382 changes: 212 additions & 170 deletions api/gen/proto/go/teleport/autoupdate/v1/autoupdate.pb.go

Large diffs are not rendered by default.

180 changes: 96 additions & 84 deletions api/gen/proto/go/teleport/notifications/v1/notifications.pb.go

Large diffs are not rendered by default.

328 changes: 198 additions & 130 deletions api/gen/proto/go/teleport/usertasks/v1/user_tasks.pb.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ require (
go.opentelemetry.io/otel/sdk v1.32.0
go.opentelemetry.io/otel/trace v1.32.0
go.opentelemetry.io/proto/otlp v1.4.0
golang.org/x/crypto v0.29.0
golang.org/x/crypto v0.31.0
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
golang.org/x/net v0.31.0
golang.org/x/term v0.26.0
golang.org/x/term v0.27.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697
google.golang.org/grpc v1.68.0
google.golang.org/protobuf v1.35.2
Expand All @@ -45,8 +45,8 @@ require (
github.com/mattermost/xml-roundtrip-validator v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russellhaering/goxmldsig v1.4.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
16 changes: 8 additions & 8 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1185,8 +1185,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
Expand All @@ -1197,8 +1197,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=
golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E=
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1217,8 +1217,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
30 changes: 25 additions & 5 deletions api/proto/teleport/autoupdate/v1/autoupdate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ message AgentAutoUpdateSchedules {

// AgentAutoUpdateGroup specifies the update schedule for a group of agents.
message AgentAutoUpdateGroup {
reserved 4;
reserved "wait_days";

// name of the group
string name = 1;
// days when the update can run. Supported values are "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" and "*"
repeated string days = 2;
// start_hour to initiate update
int32 start_hour = 3;
// wait_days after last group succeeds before this group can run. This can only be used when the strategy is "halt-on-failure".
int64 wait_days = 4;
// wait_hours after last group succeeds before this group can run. This can only be used when the strategy is "halt-on-failure".
// This field must be positive.
int32 wait_hours = 5;
}

// AutoUpdateVersion is a resource singleton with version required for
Expand Down Expand Up @@ -159,16 +163,31 @@ message AutoUpdateAgentRolloutSpec {
// availability. A group finishes its update once most of its agents are running the correct version. Agents that
// missed the group update will try to catch back as soon as possible.
string strategy = 5;
// maintenance_window_duration is the maintenance window duration. This can only be set if `strategy` is "time-based".
// Once the window is over, the group transitions to the done state. Existing agents won't be updated until the next
// maintenance window.
google.protobuf.Duration maintenance_window_duration = 6;
}

// AutoUpdateAgentRolloutStatus tracks the current agent rollout status.
message AutoUpdateAgentRolloutStatus {
repeated AutoUpdateAgentRolloutStatusGroup groups = 1;
AutoUpdateAgentRolloutState state = 2;
// The start time is set when the rollout is created or reset. Usually this is caused by a version change.
// The timestamp allows the controller to detect that the rollout just changed.
// The controller will not start any group that should have been active before the start_time to avoid a double-update
// effect.
// For example, a group updates every day between 13:00 and 14:00. If the target version changes to 13:30, the group
// will not start updating to the new version directly. The controller sees that the group theoretical start time is
// before the rollout start time and the maintenance window belongs to the previous rollout.
google.protobuf.Timestamp start_time = 3;
}

// AutoUpdateAgentRolloutStatusGroup tracks the current agent rollout status of a specific group.
message AutoUpdateAgentRolloutStatusGroup {
reserved 8;
reserved "config_wait_days";

// name of the group
string name = 1;
// start_time of the rollout
Expand All @@ -183,8 +202,9 @@ message AutoUpdateAgentRolloutStatusGroup {
repeated string config_days = 6;
// config_start_hour to initiate update
int32 config_start_hour = 7;
// config_wait_days after last group succeeds before this group can run. This can only be used when the strategy is "halt-on-failure".
int64 config_wait_days = 8;
// config_wait_hours after last group succeeds before this group can run. This can only be used when the strategy is "halt-on-failure".
// This field must be positive.
int32 config_wait_hours = 9;
}

// AutoUpdateAgentGroupState represents the agent group state. This state controls whether the agents from this group
Expand All @@ -199,7 +219,7 @@ enum AutoUpdateAgentGroupState {
AUTO_UPDATE_AGENT_GROUP_STATE_ACTIVE = 2;
// AUTO_UPDATE_AGENT_GROUP_STATE_DONE represents that the group has been updated. New agents should run v2.
AUTO_UPDATE_AGENT_GROUP_STATE_DONE = 3;
// AUTO_UPDATE_AGENT_GROUP_STATE_ROLLEDBACK represents that the group has been rolleback.
// AUTO_UPDATE_AGENT_GROUP_STATE_ROLLEDBACK represents that the group has been rolled back.
// New agents should run v1, existing agents should update to v1.
AUTO_UPDATE_AGENT_GROUP_STATE_ROLLEDBACK = 4;
}
Expand Down
67 changes: 67 additions & 0 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4707,6 +4707,7 @@ message OneOf {
events.WorkloadIdentityCreate WorkloadIdentityCreate = 194;
events.WorkloadIdentityUpdate WorkloadIdentityUpdate = 195;
events.WorkloadIdentityDelete WorkloadIdentityDelete = 196;
events.GitCommand GitCommand = 197;
}
}

Expand Down Expand Up @@ -7800,3 +7801,69 @@ message WorkloadIdentityDelete {
(gogoproto.jsontag) = ""
];
}

// GitCommand is emitted when a user performs a Git fetch or push command.
message GitCommand {
// Metadata is a common event metadata
Metadata Metadata = 1 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// User is a common user event metadata
UserMetadata User = 2 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// ConnectionMetadata holds information about the connection
ConnectionMetadata Connection = 3 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// SessionMetadata is a common event session metadata
SessionMetadata Session = 4 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// ServerMetadata is a common server metadata
ServerMetadata Server = 5 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// CommandMetadata is a common command metadata
CommandMetadata Command = 6 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// Service is the type of the git request like git-upload-pack or
// git-receive-pack.
string service = 8 [(gogoproto.jsontag) = "service"];
// Path is the Git repo path, usually <org>/<repo>.
string path = 9 [(gogoproto.jsontag) = "path"];

// Actions defines details for a Git push.
repeated GitCommandAction actions = 10 [(gogoproto.jsontag) = "actions,omitempty"];
}

// GitCommandAction defines details for a Git push.
message GitCommandAction {
// Action type like create or update.
string Action = 1 [(gogoproto.jsontag) = "action,omitempty"];
// Reference name like ref/main/my_branch.
string Reference = 2 [(gogoproto.jsontag) = "reference,omitempty"];
// Old is the old hash.
string Old = 3 [(gogoproto.jsontag) = "old,omitempty"];
// New is the new hash.
string New = 4 [(gogoproto.jsontag) = "new,omitempty"];
}
14 changes: 14 additions & 0 deletions api/proto/teleport/legacy/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,8 @@ message Header {
// PortRange can be used to describe a single port in which case the Port field is the port and the
// EndPort field is 0.
message PortRange {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.stringer) = false;
// Port describes the start of the range. It must be between 1 and 65535.
uint32 Port = 1 [(gogoproto.jsontag) = "port"];
// EndPort describes the end of the range, inclusive. If set, it must be between 2 and 65535 and
Expand Down Expand Up @@ -3437,6 +3439,18 @@ message RoleConditions {
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "github_permissions,omitempty"
];

// WorkloadIdentityLabels controls whether or not specific WorkloadIdentity
// resources can be invoked. Further authorization controls exist on the
// WorkloadIdentity resource itself.
wrappers.LabelValues WorkloadIdentityLabels = 44 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "workload_identity_labels,omitempty",
(gogoproto.customtype) = "Labels"
];
// WorkloadIdentityLabelsExpression is a predicate expression used to
// allow/deny access to issuing a WorkloadIdentity.
string WorkloadIdentityLabelsExpression = 45 [(gogoproto.jsontag) = "workload_identity_labels_expression,omitempty"];
}

// IdentityCenterAccountAssignment captures an AWS Identity Center account
Expand Down
3 changes: 3 additions & 0 deletions api/proto/teleport/notifications/v1/notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ message GlobalNotificationSpec {
bool match_all_conditions = 4;
// notification is the notification itself.
Notification notification = 5;
// exclude_users is a list of usernames of users who should never match this notification
// under any circumstances.
repeated string exclude_users = 6;
}

// ByPermissions represents the RoleConditions needed for a user to receive this notification.
Expand Down
8 changes: 8 additions & 0 deletions api/proto/teleport/usertasks/v1/user_tasks.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ message UserTask {
teleport.header.v1.Metadata metadata = 4;
// The configured properties of UserTask.
UserTaskSpec spec = 5;
// The current status for this UserTask.
UserTaskStatus status = 6;
}

// UserTaskSpec contains the properties of the UserTask.
Expand All @@ -62,6 +64,12 @@ message UserTaskSpec {
DiscoverEKS discover_eks = 6;
}

// UserTaskStatus contains the current status for the UserTask.
message UserTaskStatus {
// LastStateChange is the timestamp when the UserTask state was last modified.
google.protobuf.Timestamp last_state_change = 1;
}

// DiscoverEC2 contains the instances that failed to auto-enroll into the cluster.
message DiscoverEC2 {
// Instances maps an instance id to the result of enrolling that instance into teleport.
Expand Down
Loading

0 comments on commit f07f2ec

Please sign in to comment.