Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ const (
// that grants a user access to AWS Identity Center resources via
// Access Requests.
SystemIdentityCenterAccessRoleName = "aws-ic-access"

// PresetWildcardWorkloadIdentityIssuerRoleName is a name of a preset role
// that includes the permissions necessary to issue workload identity
// credentials using any workload_identity resource. This exists to simplify
// Day 0 UX experience with workload identity.
PresetWildcardWorkloadIdentityIssuerRoleName = "wildcard-workload-identity-issuer"
)

var PresetRoles = []string{PresetEditorRoleName, PresetAccessRoleName, PresetAuditorRoleName}
Expand Down
1 change: 1 addition & 0 deletions lib/auth/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ func GetPresetRoles() []types.Role {
services.NewSystemOktaRequesterRole(),
services.NewPresetTerraformProviderRole(),
services.NewSystemIdentityCenterAccessRole(),
services.NewPresetWildcardWorkloadIdentityIssuerRole(),
}

// Certain `New$FooRole()` functions will return a nil role if the
Expand Down
1 change: 1 addition & 0 deletions lib/auth/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ func TestPresets(t *testing.T) {
teleport.PresetAccessRoleName,
teleport.PresetAuditorRoleName,
teleport.PresetTerraformProviderRoleName,
teleport.PresetWildcardWorkloadIdentityIssuerRoleName,
}

t.Run("EmptyCluster", func(t *testing.T) {
Expand Down
28 changes: 28 additions & 0 deletions lib/services/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,34 @@ func NewPresetRequireTrustedDeviceRole() types.Role {
}
}

// NewPresetWildcardWorkloadIdentityIssuerRole returns a new pre-defined role
// for issuing workload identities.
func NewPresetWildcardWorkloadIdentityIssuerRole() types.Role {
role := &types.RoleV6{
Kind: types.KindRole,
Version: types.V7,
Metadata: types.Metadata{
Name: teleport.PresetWildcardWorkloadIdentityIssuerRoleName,
Namespace: apidefaults.Namespace,
Description: "Issue workload identities",
Labels: map[string]string{
types.TeleportInternalResourceType: types.PresetResource,
},
},
Spec: types.RoleSpecV6{
Allow: types.RoleConditions{
WorkloadIdentityLabels: types.Labels{
types.Wildcard: []string{types.Wildcard},
},
Rules: []types.Rule{
types.NewRule(types.KindWorkloadIdentity, RO()),
},
},
},
}
return role
}

// SystemOktaAccessRoleName is the name of the system role that allows
// access to Okta resources. This will be used by the Okta requester role to
// search for Okta resources.
Expand Down