📗
smiley book
  • Smiley Books
  • AI
    • Readme
    • openai-whisper
      • 샘플 실행해보기
      • GPU 서버 준비하기
      • API로 whisper를 외부에 오픈하기
      • 프롬프트 지원
      • 실시간 message chat
      • 화면 이쁘게 만들기와 로그인
      • 파이썬 가상환경
      • 실시간 voice chat
      • fine tunning(미세 조정) 으로 성능 올리기
      • app에서 api를 호출하여 실시간으로 텍스트로 바꿔보기
    • ollama - llm을 쉽게 내컴에서 실행
      • ollama webui
      • ollama docker
    • stable diffusion
      • SDXL - text to image
      • SD-webui
    • ChatGPT
      • 답변이 끊길때
      • 역할을 정하자
      • 구체적인 질문
      • 결과형태를 지정
      • 프롬프트를 여러줄로 사용하자.
      • 마틴 파울러 글 번역본
    • Prompt Engineering
    • Auto-GPT
    • Gemini
      • google ai studio
      • gemini-api
      • embedding guide
    • Huggingface
      • huggingface 사용법
      • huggingface nlp 공부중
    • kaggle
      • download dataset
    • langchain
      • langchain을 공부하며 정리
      • basic
      • slackbot
      • rag
      • document-loader
      • website-loader
      • confluence
      • memory
      • function-call
      • langsmith
      • agent-toolkit
  • Ansible
    • templates vs files and jinja2
    • dynamic inventory
    • limit 옵션 강제하기
    • limit 사용후 gather_fact 문제
  • AWS
    • AWS CLI
    • EKS
      • cluster manage
      • ALB Controller
      • external-dns
      • fargate
    • ECR
    • S3
    • Certificate Manager
  • Azure
    • Azure AD OAuth Client Flow
  • Container
    • Registry
    • 빌드시에 env값 설정하기
  • DB
    • PXC
      • Operator
      • PMM
      • 삭제
      • GTID
      • Cross Site Replication
    • Mssql
    • Mysql
  • dotnet
    • Thread Pool
    • Connection Pool
    • Thread Pool2
  • Devops
    • Recommendation
  • GIT
    • Basic
    • Submodule
  • GitHub
    • Repository
    • GitHub Action
    • GitHub PR
    • Self Hosted Runner
    • GitHub Webhook
  • GitLab
    • CI/CD
    • CI/CD Advance
    • Ssl renew
    • CI/CD Pass env to other job
  • Go Lang
    • 개발 환경 구축
    • multi os binary build
    • kubectl같은 cli만들기
    • azure ad cli
    • embed static file
    • go study
      • pointer
      • module and package
      • string
      • struct
      • goroutine
  • Kubernetes
    • Kubernetes는 무엇인가
    • Tools
    • Install with kubespray
    • Kubernetes hardening guidance
    • 11 ways not to get hacked
    • ArgoCD
      • Install
      • CLI
      • Repository
      • Apps
      • AWS ALB 사용
      • Notification slack
      • Backup / DR
      • Ingress
      • 2021-11-16 Github error
      • Server Config
      • auth0 인증 추가(oauth,OIDC)
    • Extension
      • Longhorn pvc
      • External dns
      • Ingress nginx
      • Cert Manager
      • Kube prometheus
    • Helm
      • Subchart
      • Tip
    • Loki
    • Persistent Volume
    • TIP
      • Job
      • Pod
      • Log
  • KAFKA
    • raft
  • KVM
    • kvm cpu model
  • Linux
    • DNS Bind9
      • Cert-Manager
      • Certbot
      • Dynamic Update
      • Log
    • Export and variable
    • Grep 사용법
  • Modeling
    • C4 model introduce
    • Mermaid
    • reference
  • Monitoring
    • Readme
    • 0. What is Monitoring
    • 1. install prometheus and grafana
    • 2. grafana provisioning
    • 3. grafana dashboard
    • 4. grafana portable dashboard
    • 5. prometheus ui
    • 6. prometheus oauth2
    • Prometheus
      • Metric type
      • basic
      • rate vs irate
      • k8s-prometheus
    • Grafana
      • Expolorer
    • Node Exporter
      • advance
      • textfile collector
  • Motivation
    • 3 Simple Rule
  • OPENNEBULA
    • Install(ansible)
    • Install
    • Tip
    • Windows vm
  • Reading
    • comfort zone
    • 배려
    • elon musk 6 rule for insane productivity
    • Feynman Technique
    • how to interview - elon musk
    • 경청
    • Readme
  • Redis
    • Install
    • Master-slave Architecture
    • Sentinel
    • Redis Cluster
    • Client programming c#
  • SEO
    • Readme
  • Security
    • criminalip.io
      • criminalip.io
  • Stock
    • robinhood-python
  • Terraform
    • moved block
    • output
  • vault
    • Readme
  • VS Code
    • dev container
    • dev container on remote server
  • Old fashione trend
    • curity
    • MAAS
      • Install maas
      • Manage maas
      • Tip
Powered by GitBook
On this page
  • auth0 설정
  • update argocd
  • argocd-cm.yaml
  • argocd-rbac-cm.yaml
  • sync
  • 그룹별로 다른 권한
  • logout
  • auth0에서 회원가입을 막는다

Was this helpful?

  1. Kubernetes
  2. ArgoCD

auth0 인증 추가(oauth,OIDC)

PreviousServer ConfigNextExtension

Last updated 1 year ago

Was this helpful?

검색하니 잘 안나와서 정리해봅니다.

auth0 설정

  1. 가입

  2. application 생성

  3. application type: SPA

  4. clientId 및 clientSecret 값 을 기록해 둡니다.

  5. Register login url as https://your.argoingress.address/login

  6. Set allowed callback url to https://your.argoingress.address/auth/callback

  7. Under connections, select the user-registries you want to use with argo

  8. add rules

    function (user, context, callback) {
       const namespace =http://aaa.com'; <- 중요
       const assignedRoles = (context.authorization || {}).roles;
    
       let idTokenClaims = context.idToken || {};
       let accessTokenClaims = context.accessToken || {};
    
       idTokenClaims[`${namespace}/groups`] = assignedRoles; <- 중요
       accessTokenClaims[`${namespace}/groups`] = assignedRoles; <- 중요
    
       context.idToken = idTokenClaims;
       context.accessToken = accessTokenClaims;
    
       callback(null, user, context);
     }

    이렇게 하면 토큰에 roles 정보가 들어가게 됩니다.

    {
      "http://aaa.com/groups": ["netops"],
      "nickname": "smiley",
      "name": "smiley@aaa.com",
      "picture": "aaa.png",
      "updated_at": "2023-02-04T00:45:12.831Z",
      "email": "smiley@aaa.com",
      "email_verified": true,
      "iss": "https://dev.us.auth0.com/",
      "aud": "zzz",
      "iat": 1675634411,
      "exp": 1675670411,
      "sub": "auth0|xxx",
      "sid": "ggg"
    }
  9. create role

  10. assign role to user

update argocd

argocd-cm.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cm
  namespace: argocd
data:
  application.instanceLabelKey: argocd.argoproj.io/instance
  url: https://argocd.aaa.com
  oidc.config: |
    name: Auth0
    issuer: https://dev.us.auth0.com/
    clientID: OzF3npfPuxjxBn
    clientSecret: LSbBj88xocuog2qlxxx
    requestedIDTokenClaims:
      groups:
        essential: true
    requestedScopes:
      - openid
      - profile
      - email
      -http://aaa.com/groups' <- 중요

argocd-rbac-cm.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-rbac-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-rbac-cm
  namespace: argocd
data:
  policy.csv: |
    g, netops, role:admin
  scopes: http://aaa.com/groups, email]' <- 중요

sync

sync하고 pod를 재시작한후 로그인하면 된다.

그룹별로 다른 권한

  • web 이라는 그룹을 만들고 유저를 그룹에 넣는다.

  • argocd-rbac-cm에 다음을 추가한다. (argocd-cm.yaml)

    p, role:web, applications, get, *, allow  # webteam
    p, role:web, applications, sync, *, allow # webteam
    g, web, role:web                          # webteam

이제 웹 그룹은 get/sync만 할수 있다.

logout

  • edit argocd-cm.yaml

logoutURL: https://your-auth0-domain/v2/logout?client_id=your-client-key&returnTo=your-argo-url

please add your return url on auth0

sync / restart pod

auth0에서 회원가입을 막는다

https://auth0.com/docs/api/authentication#logout