Skip to content

Commit

Permalink
Adding provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
mchavez committed Mar 9, 2024
1 parent aa54cdc commit 9a0bcde
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 52 deletions.
82 changes: 41 additions & 41 deletions auth.pem
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAuz4Kk+2fGZIrRXJfFN/C1XZ1K29+D3CGKNOoY4ClOUC25ziP
lTrlVf/biij2jBJfNP7hgQDCbA5KdSRM8mokiixc7pB/XwGgvn9ousg//gk/k9c6
wMIyNao9AHxELNQEtJnPgLMcIBiKWOfW9S97Qzgz3xesRn0zGqZznm+DvhgOECGM
0/qn7tWLz7sSWOtjqD/kVztbPbUnyCnBjUcaOLOXp38A/yOlhylQgFxWNy5zHNUw
R1jyiVmq6zfr8SWltjjM2P6TYC5eZLingUFqw/KaAh3Y5nKDh40ePho1V6XuDweZ
rEQ2vKBJBBWHw+jIOluldt2aAdGgMot77A/p7wIDAQABAoIBABLilQqKgut/VKHy
gSiH0Qzan8K7wgkonj9r6aXvibqWjlwP1luEzzC3V5s9unAyQiwEMRZjzzg60MOz
35brobfV9aGSLWaVsXLFQvjjzaB/qkvs/14FuC61duWfoviqgbb9dHJUnleWYg3J
hGLCYTpMZt7vck7Bve/ILg0izjTT58heYrYZUFCOiGWlg/CWXOj8ZIqefyTHUads
bjLyP9qFC3C2Jqso9j4dil7RAh1Zr7WmmlDeOpEdIPTDusv940jbPTxod8CdQIlI
/O+uXUdr81olqmN4cgasBp6YkNSVrwewdQQy1lWt6FkF5AGMvCvbLQv83mydTzbw
a+YabxECgYEAwboAxcPCInPs9wneVvWoU1n66+BWQ6NKlTSvq2lV0JISFfl/2qQd
ibKmQCgAJouo9uavvmzYYxDWYe2Cp1Vj82XbJ8LPK+8EQGVUTM7sSxFnnVAZV44e
RgF9S6ICHJQg/NtV7LkJAr3kSdmFV3byOTLDYHjKjyB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Q7F64oo20e+gW6vPUaj0m78WGNkH8qmYlM8gEL/kA/9dkb
ybWpBvFmrQbT8IlqFDC/S0uW/KyRfsQ0xtywOnqBCmowg4QYvR5kydtwyj+XEtI2
dVNMlg3uVYPnnWBW66xrURajEK+3QcvcFA4YK87s9awaX3Ox06UvTW7nIxi9oDiv
91GcdsStxWtw7DiOjvKg471OLXZ5gLUi7g6IBzsZksvi/YBaAdEb+jGQS0fcMfyY
6RuBzIgoEF0lsoUl5ppiJ0Hq50eGrphIjlXP9SQRT58cw1mvDLy+p3DLWTyByIED
70ro6sRa2UzUHBF6iUDrz0yc+CAJVg==
AAOCAQEAPPQ3k3IUMXwNELgzPwvodccwHRJn5w/Hkmrd6leyGfR6OS0tOBgv8afz
WZjBYMnoFlC17JvruIqwBV064L9oXK4QsYD0AL9/3Iqo2kRW+q09Bzt88wO5QgML
sHHoQHtMftxdCUKxyQu7Rycl/sKR6Z97qhVzDEfX991d2z/H/g1+HZYNJBw1qIBi
KIsbc1slJfrvSkf3dJfkkYTL/LMbFgzbQ/WLyPYUtYVQYYYESusuEIacqvIfjh8O
bVabFJdzAxOkWFpqwcCCNDy3dS3rNR+h8yctKl0NzGeJgTjsOjnH7xll1Mk9entJ
ywiYBcv3m0C7yTftrhg80J7mjP7mRg==
-----END CERTIFICATE-----
@cert-authority d3v-conductorone.teleport.sh,*.d3v-conductorone.teleport.sh ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKm1KKkBFUxooWznk3v4q1k4d9kar3rcj5ma5gATH4xgUSygugP63Lz50puLyGcsZPAbMhX5XChFmQYSTmwE+EJcIc8AHRrojJm8CoSSHga9L2sWZTjeW8vv6x0DUsbF8s72vve9NLfwacgJvK2BcZqdeAC2Mxi+uQWjCH9oYpKl+6zekRJ66hY5ixq6RD34s9ExrVUKkri3y6/8D4RSzyHvjtgrHY9TmVORPC7JZBpOPr7g39bUKYkj8K17mE5vX2od+xtdem63xetcx1hQKRL7uSyJxqE3tiPNHX4crGwGvAvqus7BR3W/g29ErN48fnoL6MvPNhzAeU/DXxl7gt type=host
-----BEGIN CERTIFICATE-----
Expand Down
20 changes: 20 additions & 0 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,23 @@ func (t *TeleportClient) GetRoles(ctx context.Context) ([]types.Role, error) {

return roles, nil
}

// GetUser gets an user.
func (t *TeleportClient) GetUser(ctx context.Context, username string) (types.User, error) {
user, err := t.client.GetUser(ctx, username, false)
if err != nil {
return nil, err
}

return user, nil
}

// UpdateUserRole updates an user.
func (t *TeleportClient) UpdateUserRole(ctx context.Context, user types.User) (types.User, error) {
updatedUser, err := t.client.UpdateUser(ctx, user.(*types.UserV2))
if err != nil {
return nil, err
}

return updatedUser, nil
}
File renamed without changes.
107 changes: 96 additions & 11 deletions pkg/connector/role.go → pkg/connector/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2"
"github.com/conductorone/baton-sdk/pkg/annotations"
"github.com/conductorone/baton-sdk/pkg/pagination"
"github.com/gravitational/teleport/api/types"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"

ent "github.com/conductorone/baton-sdk/pkg/types/entitlement"
"github.com/conductorone/baton-sdk/pkg/types/grant"
Expand Down Expand Up @@ -60,18 +63,15 @@ func getRoleResource(role *Role) (*v2.Resource, error) {
// Roles include a RoleTrait because they are the 'shape' of a standard group.
func (r *roleBuilder) List(ctx context.Context, parentId *v2.ResourceId, token *pagination.Token) ([]*v2.Resource, string, annotations.Annotations, error) {
var rv []*v2.Resource
roles, err := r.client.GetRoles(ctx)
if err != nil {
return nil, "", nil, err
}

if len(mapRoles) == 0 {
roles, err := r.client.GetRoles(ctx)
if err != nil {
return nil, "", nil, err
}

for _, role := range roles {
mapRoles[role.GetName()] = Role{
Name: role.GetName(),
Id: role.GetName(),
}
for _, role := range roles {
mapRoles[role.GetName()] = Role{
Name: role.GetName(),
Id: role.GetName(),
}
}

Expand Down Expand Up @@ -135,10 +135,95 @@ func (r *roleBuilder) Grants(ctx context.Context, resource *v2.Resource, token *
}

func (r *roleBuilder) Grant(ctx context.Context, principal *v2.Resource, entitlement *v2.Entitlement) (annotations.Annotations, error) {
l := ctxzap.Extract(ctx)
userName := principal.Id.Resource
roleName := entitlement.Resource.Id.Resource

if principal.Id.ResourceType != userResourceType.Id {
l.Warn(
"baton-teleport: only users can be granted role membership",
zap.String("principal_type", principal.Id.ResourceType),
zap.String("principal_id", principal.Id.Resource),
)
return nil, fmt.Errorf("baton-teleport: only users can be granted role membership")
}

// Create an MFA required role for "prod" nodes.
prodRole, err := types.NewRole(roleName, types.RoleSpecV6{
Options: types.RoleOptions{
RequireMFAType: types.RequireMFAType_SESSION,
},
Allow: types.RoleConditions{
Logins: []string{userName},
NodeLabels: types.Labels{},
},
})
if err != nil {
return nil, err
}

user, err := r.client.GetUser(ctx, userName)
if err != nil {
return nil, err
}

user.SetLogins(append(user.GetLogins(), userName))
user.AddRole(prodRole.GetName())
updatedUser, err := r.client.UpdateUserRole(ctx, user)
if err != nil {
return nil, fmt.Errorf("teleport-connector: failed to add role: %s", err.Error())
}

l.Warn("Role Membership has been created.",
zap.String("Name", updatedUser.GetName()),
zap.String("Namespace", updatedUser.GetMetadata().Namespace),
zap.Time("CreatedAt", updatedUser.GetCreatedBy().Time),
)

return nil, nil
}

func (r *roleBuilder) Revoke(ctx context.Context, grant *v2.Grant) (annotations.Annotations, error) {
l := ctxzap.Extract(ctx)
var roleList []string
entitlement := grant.Entitlement
principal := grant.Principal

if principal.Id.ResourceType != userResourceType.Id {
l.Warn(
"baton-teleport: only users can have role membership revoked",
zap.String("principal_type", principal.Id.ResourceType),
zap.String("principal_id", principal.Id.Resource),
)
return nil, fmt.Errorf("teleport-connector: only users can have role membership revoked")
}

roleName := entitlement.Resource.Id.Resource
userName := principal.Id.Resource
user, err := r.client.GetUser(ctx, userName)
if err != nil {
return nil, err
}

user.SetLogins(append(user.GetLogins(), userName))
for _, role := range user.GetRoles() {
if role != roleName {
roleList = append(roleList, role)
}
}

user.SetRoles(roleList)
updatedUser, err := r.client.UpdateUserRole(ctx, user)
if err != nil {
return nil, fmt.Errorf("teleport-connector: failed to revoke role: %s", err.Error())
}

l.Warn("Role Membership has been revoked.",
zap.String("Name", updatedUser.GetName()),
zap.String("Namespace", updatedUser.GetMetadata().Namespace),
zap.Time("CreatedAt", updatedUser.GetCreatedBy().Time),
)

return nil, nil
}

Expand Down

0 comments on commit 9a0bcde

Please sign in to comment.