dbones-labs / lab-dev

OrgOps - Enable DevOps with GitOps and KubeOps
https://github.com/dbones-labs/lab-dev/wiki
1 stars 0 forks source link

Rancher - Account (User) #16

Open dbones opened 2 years ago

dbones commented 2 years ago

Rancher uses are automatically added via the github integration

we will need a away to query for them though

dbones commented 2 years ago
apiVersion: management.cattle.io/v3
description: ""
displayName: Dave R.
kind: User
metadata:
  annotations:
    authz.management.cattle.io/creator-role-bindings: '{"created":["user"],"required":["user"]}'
    lifecycle.cattle.io/create.mgmt-auth-users-controller: "true"
  finalizers:
  - controller.cattle.io/mgmt-auth-users-controller
  labels:
    CTKN8Q3LC9FNASR5E8T2UBPH70PJGD1P: hashed-principal-name
  name: u-whzq6t3pkh
principalIds:
- github_user://183822
- local://u-whzq6t3pkh

note that the principal is not in the spec or status

dbones commented 2 years ago

note that we cannot QUERY for User or UserAttribute resources

will implement a controller so we can cache the info, and be done with it

dbones commented 2 years ago
ExtraByProvider:
  github:
    principalid:
    - github_user://15765462
    username:
    - dev-tu
  local:
    principalid:
    - local://user-xasdsfqld
    username:
    - admin
GroupPrincipals:
  activedirectory:
    Items: null
  adfs:
    Items: null
  azuread:
    Items: null
  freeipa:
    Items: null
  github:
    Items:
    - displayName: fox-in-the-lab
      loginName: fox-in-the-lab
      memberOf: true
      metadata:
        creationTimestamp: null
        name: github_org://54006669
      principalType: group
      profilePicture: https://avatars.githubusercontent.com/u/54006669?v=4
      provider: github
    - displayName: archive
      loginName: archive
      memberOf: true
      metadata:
        creationTimestamp: null
        name: github_team://6599990
      principalType: group
      profilePicture: https://avatars.githubusercontent.com/u/54006669?v=4
      provider: github
    - displayName: galaxy
      loginName: galaxy
      memberOf: true
      metadata:
        creationTimestamp: null
        name: github_team://6609853
      principalType: group
      profilePicture: https://avatars.githubusercontent.com/u/54006669?v=4
      provider: github
    - displayName: galaxy-guest
      loginName: galaxy-guest
      memberOf: true
      metadata:
        creationTimestamp: null
        name: github_team://6609854
      principalType: group
      profilePicture: https://avatars.githubusercontent.com/u/54006669?v=4
      provider: github
    - displayName: in-the-lab
      loginName: in-the-lab
      memberOf: true
      metadata:
        creationTimestamp: null
        name: github_team://6599991
      principalType: group
      profilePicture: https://avatars.githubusercontent.com/u/54006669?v=4
      provider: github
    - displayName: platform
      loginName: platform
      memberOf: true
      metadata:
        creationTimestamp: null
        name: github_team://6600567
      principalType: group
      profilePicture: https://avatars.githubusercontent.com/u/54006669?v=4
      provider: github
    - displayName: platform-guest
      loginName: platform-guest
      memberOf: true
      metadata:
        creationTimestamp: null
        name: github_team://6600566
      principalType: group
      profilePicture: https://avatars.githubusercontent.com/u/54006669?v=4
      provider: github
  googleoauth:
    Items: null
  keycloak:
    Items: null
  keycloakoidc:
    Items: null
  local:
    Items: null
  oidc:
    Items: null
  okta:
    Items: null
  openldap:
    Items: null
  ping:
    Items: null
  shibboleth:
    Items: null
LastRefresh: "2022-09-29T20:23:34Z"
NeedsRefresh: false
UserName: ""
apiVersion: management.cattle.io/v3
kind: UserAttribute
metadata:
  creationTimestamp: "2022-09-13T00:14:31Z"
  generation: 205
  labels:
    cattle.io/creator: norman
  name: user-xxqld
  ownerReferences:
  - apiVersion: management.cattle.io/v3
    kind: User
    name: user-xxqld
    uid: aa9af792-6c1d-a6a3144542a6
  resourceVersion: "153630253"
  uid: 214992-ea0c791cdb5b
dbones commented 2 years ago

odd thing the UserAttribute did not work with the ExtraByProvider

now using the Rancher User and its principal IDs

Lab Account

Image

Internal Github User

Image

Internal Rancher User

Image