๐Ÿ“—
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
  • ํšŒ์›๊ฐ€์ž…ํ›„ ๋ผ์ด์„ผ์Šค ๋ฐ›๊ธฐ
  • arogocd / helm์œผ๋กœ ์„ค์น˜
  • ingress๋กœ ์ ‘๊ทผํ•˜๋Š”๋ฒ•
  • port forwarding์œผ๋กœ ์ ‘๊ทผํ•˜๋Š”๋ฒ•
  • Run Basic Setup
  • url change
  • jdbc
  • ํ˜„์žฌ๊นŒ์ง€ ๊ตฌ์กฐ
  • custom image
  • ์„ค์ •ํŒŒ์ผ ๋ฐฑ์—…
  • ๋ณต๊ตฌ
  • helm ์˜ต์…˜์„ ํ†ตํ•œ ๋ฐฑ์—…
  • helm ์„ ์ด์šฉํ•ด์„œ ๋ณต๊ตฌ

Was this helpful?

  1. Old fashione trend

curity

Previousdev container on remote serverNextMAAS

Last updated 1 year ago

Was this helpful?

identity server์ค‘์— ํ•˜๋‚˜๋กœ ์ƒˆ๋กœ ๋ฐฐ์šฐ๊ฒŒ ๋˜์—ˆ๋‹ค.

ํšŒ์›๊ฐ€์ž…ํ›„ ๋ผ์ด์„ผ์Šค ๋ฐ›๊ธฐ

์ปค๋ฎค๋‹ˆํ‹ฐ ์—๋””์…˜์œผ๋กœ ๋ผ์ด์„ผ์Šค๋ฅผ ๋ฐ›์•„์„œ ๋‹ค์šด๋กœ๋“œํ•ด๋‘์ž.

arogocd / helm์œผ๋กœ ์„ค์น˜

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: curity
  namespace: argocd
spec:
  destination:
    name: ''
    namespace: curity
    server: 'https://kubernetes.default.svc'
  source:
    path: ''
    repoURL: 'https://curityio.github.io/idsvr-helm/'
    targetRevision: 0.9.26
    chart: idsvr
    helm:
      parameters:
        - name: curity.adminUiHttp
          value: 'true'
        - name: curity.config.uiEnabled
          value: 'true'
        - name: curity.config.password
          value: YOUR-PASS
        - name: curity.admin.logging.stdout
          value: 'true'
        - name: ingress.enabled
          value: 'true'
        - name: ingress.runtime.host
          value: curity.yourdomain.com
        - name: ingress.admin.host
          value: admin.curity.yourdomain.com
        - name: networkpolicy.enabled
          value: 'false'
        - name: replicaCount
          value: '3'
  project: default
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

ingress๋กœ ์ ‘๊ทผํ•˜๋Š”๋ฒ•

https://admin.curity.yourdomain.com/admin/

port forwarding์œผ๋กœ ์ ‘๊ทผํ•˜๋Š”๋ฒ•

export POD_NAME=$(kubectl get pods -l "role=curity-idsvr-admin" -o jsonpath="{.items[0].metadata.name}")

kubectl port-forward $POD_NAME 6749:6749

http://localhost/admin/

port forwarding์œผ๋กœ๋Š” ์ ‘๊ทผ์ด ๋˜๊ณ  ingress๋กœ ์•ˆ๋˜๋ฉด helm ์˜ต์…˜์ค‘์— network policy๋ฅผ ๋„๊ณ  ์‹คํ–‰ํ•ด๋ด๋ผ ๊ทธ๋Ÿผ ๋ ๊ฒƒ์ด๋‹ค.

Run Basic Setup

์„ค์ •ํ•ด๋‘” url๋กœ ์ ‘๊ทผํ•˜๋ฉด ๋‹ค์Œ ํ™”๋ฉด์ด ๋‚˜์˜จ๋‹ค.

์„ค์ •ํ•ด๋‘” ๋น„๋ฒˆ์œผ๋กœ ๋กœ๊ทธ์ธ

Run Basic Setup ํด๋ฆญ

์ปค๋ฎค๋‹ˆํ‹ฐ ๋ผ์ด์„ผ์Šค๋ฅผ ๋ฐœ๊ธ‰๋ฐ›์•„์„œ ์—…๋กœ๋“œ ํ•ด์ฃผ์ž.

next ํด๋ฆญ

์ผ๋‹จ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ๋ชจ๋‘ next๋ฅผ ๋ˆ„๋ฅด๋ฉด ๋œ๋‹ค.

๋งˆ์ง€๋ง‰์— ์ปค๋ฐ‹๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์ž.

curity๋Š” ์œ ์ €๋ฐ์ดํ„ฐ๋“ฑ์€ db์— ์ €์žฅํ•˜์ง€๋งŒ ์ด ์„ค์ •ํŒŒ์ผ๋“ฑ์€ xml๋กœ ๋กœ์ปฌ์— ์ €์žฅํ•˜๋Š”๊ฒƒ๊ฐ™๋‹ค.

๋‹ค ๋กœ๋”ฉ์ด ๋˜๋ฉด

admin ํ•˜๋‚˜์™€ runtime ๋ชจ๋“ˆ 3๊ฐœ๊ฐ€ ์˜ฌ๋ผ์™€ ์žˆ๋‹ค.

url change

baseurl์„ ์ˆ˜์ •ํ•ด์ฃผ์ž.

general ๋ฉ”๋‰ด์—์„œ๋„ ์ˆ˜์ •

๋ณ€๊ฒฝํ• ๋•Œ๋งˆ๋‹ค commit์„ ํ•ด์•ผํ•œ๋‹ค.

jdbc

curity๋Š” jdbc๋“œ๋ผ์ด๋ฒ„๋ฅผ ํฌํ•จํ•˜๊ณ  ์žˆ์ง€ ์•Š๋‹ค. ์˜ค๋ผํด ๋ผ์ด์„ผ์Šค๋•Œ๋ฌธ์— ์ง์ ‘ ๋‹ค์šด๋ฐ›์•„์„œ ์ปจํ…Œ์ด๋„ˆ์— ๋„ฃ์–ด์ค˜์•ผํ•œ๋‹ค.

kubectl cp ~/Downloads/mysql-connector-java-8.0.26.jar -n curity $(kubectl get pods -l "role=curity-idsvr-admin" -o jsonpath="{.items[0].metadata.name}"):/opt/idsvr/lib/plugins/data.access.jdbc/

//todo ์ด๋ถ€๋ถ„์€ ๋‚˜์ค‘์— ์ข€๋” ๋‹ค๋“ฌ์–ด์•ผํ• ๋“ฏ. ๋งค๋ฒˆ ์ปจํ…Œ์ด๋„ˆ ์˜ฌ๋ผ์˜ฌ๋•Œ๋งˆ๋‹ค ๋„ฃ์–ด์ค„์ˆ˜๋Š” ์—†์œผ๋‹ˆ.

์ด์ œ jdbc connection string์„ ์ ์–ด์ฃผ์ž.

create

jdbc:mysql://MYSQL_HOST:3306/se_curity_store?useSSL=false

์„ค์ •ํ•˜์ž.

์ถ”๊ฐ€ ์™„๋ฃŒ

ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•ด์ค˜์•ผํ•œ๋‹ค.

์Šคํฌ๋ฆฝํŠธ๋Š” ์–ด๋“œ๋ฏผ ์ปจํ…Œ์ด๋„ˆ์— ์žˆ๋‹ค.

๊ฐ€์ง€๊ณ ์™€์„œ ๋””๋น„์— ์ ์šฉํ•ด์ฃผ์ž.

create database se_curity_store;
kubectl cp -n curity $(kubectl get pods -l "role=curity-idsvr-admin" -o jsonpath="{.items[0].metadata.name}"):/opt/idsvr/etc/mysql-create_database.sql ~/Downloads/mysql-create_database.sql

์ด์ƒํ•˜๊ฒŒ ์—๋Ÿฌ๊ฐ€ ๋‚˜์„œ Linked Accounts ์•ž๊นŒ์ง€๋งŒ ๋จผ์ € ์‹คํ–‰ํ•˜๊ณ  ์™„๋ฃŒํ›„ ๋’ค ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜์˜€๋‹ค.

commit

๋””๋น„๊นŒ์ง€ ์™„๋ฃŒ

ํ˜„์žฌ๊นŒ์ง€ ๊ตฌ์กฐ

custom image

Dockerfile์„ ๋งŒ๋“ค์–ด์„œ ์ปค์Šคํ„ฐ๋งˆ์ด์ฆˆํ•˜์ž jdbc ํŒŒ์ผ์„ ๋ณต์‚ฌํ•ด์•ผํ•จ.

๋‚˜์ค‘์— ์“ธ๋ ค๊ณ  git๋„ ์„ค์น˜๊ฐ€ ์™„๋ฃŒ๊ฐ€ ๋˜์•ผํ•จ.

cat > Dockerfile <<EOF
FROM curity.azurecr.io/curity/idsvr:6.4.1

COPY mysql-connector-java-8.0.26.jar /opt/idsvr/lib/plugins/data.access.jdbc/

USER root

RUN apt update -y
RUN apt install git curl -y

USER idsvr:idsvr
EOF

docker build . -t curity-custom

docker run -it -e PASSWORD=YOUR-PASS -p 6749:6749 -p 8443:8443 --name curity curity-custom

์ž˜ ์‹คํ–‰๋˜๋‚˜ ๋ณด๊ณ  jdbc driver ์žˆ๋Š”์ง€ ๋ณด๊ณ  git/curl์ž˜๋˜๋Š”์ง€ ํ™•์ธํ•˜๋ฉด ๋œ๋‹ค.

์„ค์ •ํŒŒ์ผ ๋ฐฑ์—…

user data๋Š” ์™ธ๋ถ€ ๋””๋น„์— ์ €์žฅ๋˜๋ฏ€๋กœ ์ƒ๊ด€์—†์ง€๋งŒ ์„ค์ •ํŒŒ์ผ์€ pod๊ฐ€ ์˜ฎ๊ฒจ์ง€๋ฉด ๋ชจ๋‘ ์—†์–ด์ง„๋‹ค.

admin์— xml๋กœ ์ƒ์„ฑ์ด ๋˜๋‹ˆ ์ด๊ฑธ ๋ฐฑ์—… ๋ฐ›์•„์•ผํ•œ๋‹ค.

์„ค์ •ํŒŒ์ผ์„ ์ €์žฅํ•  ๊นƒํ—ˆ๋ธŒ repo๋ฅผ ๋งŒ๋“ค์ž. ๊ทธ๋ฆฌ๊ณ  PAT(personal access token)์„ ์ƒ์„ฑ ์ €์žฅํ•ด๋‘์ž.

curity๊ฐ€ commit hooks๋ฅผ ์ง€์›ํ•œ๋‹ค.

์ปจํ…Œ์ด๋„ˆ์— /opt/idsvr/usr/bin/post-commit-scripts/ ์— ์ŠคํŠธ๋ฆฝํŠธ๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ์‹คํ–‰์„ ํ•œ๋‹ค.

custom image๋ฅผ ๋งŒ๋“ค๋•Œ ์ด ํŒŒ์ผ์„ ์•„์— ๋„ฃ์–ด์ฃผ๋ฉด ์ข‹์„๊ฑฐ๊ฐ™๋‹ค.

vi full-backup.cli
#!/bin/sh
git config --global user.email "teamsmiley@gmail.com"
git config --global user.name "smiley"

cd /tmp

rm -rf /tmp/curity

git clone https://teamsmiley:PAT@github.com/teamsmiley/curity.git # replace PAT with your PAT

/opt/idsvr/bin/idsh << EOF
show configuration | display xml | save /tmp/curity/config-backup.xml
EOF

cd curity

git add --all
git commit -m "curity commit update"
git push

vi Dockerfile

FROM curity.azurecr.io/curity/idsvr:6.4.1

USER root

RUN apt update -y
RUN apt install git curl vim -y

USER root

COPY mysql-connector-java-8.0.26.jar /opt/idsvr/lib/plugins/data.access.jdbc/
RUN chown -R idsvr:root /opt/idsvr/lib/plugins/data.access.jdbc/mysql-connector-java-8.0.26.jar
RUN chmod -R 400 /opt/idsvr/lib/plugins/data.access.jdbc/mysql-connector-java-8.0.26.jar

COPY full-backup.cli /opt/idsvr/usr/bin/post-commit-scripts/
RUN chown -R idsvr:idsvr /opt/idsvr/usr/bin/post-commit-scripts/
RUN chmod -R 500 /opt/idsvr/usr/bin/post-commit-scripts/full-backup.cli

RUN mkdir -p /home/idsvr
RUN chown -R idsvr:idsvr /home/idsvr

USER idsvr:idsvr

EXPOSE 8443
EXPOSE 6749
EXPOSE 4465
EXPOSE 4466

์ด์ œ ์ด ๋„์ปคํŒŒ์ผ์„ ๋นŒ๋“œํ•ด์„œ registry์— ๋“ฑ๋ก

export CR_PAT=YOUR_PAT
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
# docker build . -t ghcr.io/OWNER/IMAGE_NAME:latest
docker build . -t ghcr.io/teamsmiley/curity:latest
# docker push ghcr.io/OWNER/IMAGE_NAME:latest
docker push ghcr.io/teamsmiley/curity:latest

์ด์ œ ์ด ์ด๋ฏธ์ง€๋ฅผ ์จ๋ณด์ž.

์ด์ œ ์›น์‚ฌ์ดํŠธ์—์„œ ๋ญ”๊ฐ€๋ฅผ ๋ฐ”๊ตฌ๊ณ  commit์„ ํ•ด๋ณด์ž.

์ปจํ…Œ์ด๋„ˆ์— /tmp์— ํŒŒ์ผ์ด ์ €์žฅ๋ซ๋Š”์ง€ ํ™•์ธ

์ƒ์„ฑ๋˜์—ˆ๋‹ค.

์ž๋™์œผ๋กœ ๊นƒ์œผ๋กœ ๋งค๋ฒˆ ์ปค๋ฐ‹์„ ํ•œ๋‹ค.

์ž˜ ์•ˆ๋˜๋ฉด ๋กœ๊ทธ๋ฅผ ๋ณด์ž .

tail -f /opt/idsvr/var/log/post-commit-scripts.log

๋ณต๊ตฌ

git์— ์ปค๋ฐ‹๋˜์žˆ๋Š” ํŒŒ์ผ์„ ๊ฐ€์ง€๊ณ  secret๋ฅผ ๋งŒ๋“ ๋‹ค.

kubectl create secret generic idsvr-config \
    --from-file=default-conf=default-conf.xml

helm์œผ๋กœ ๋ณต๊ตฌํ• ๋•Œ ๋‹ค์Œ ์˜ต์…˜์„ ์‚ฌ์šฉํ•œ๋‹ค.

--set curity.config.configurationSecret=idsvr-config

--set curity.config.configurationSecretItemName=default-conf

helm ์˜ต์…˜์„ ํ†ตํ•œ ๋ฐฑ์—…

helm ์˜ต์…˜์— curity.config.backup=true๋ฅผ ์‚ฌ์šฉํ•˜์ž.

commit ์„ ํ• ๋•Œ๋งˆ๋‹ค secret์— ์ถ”๊ฐ€ ๋ฐ์ดํ„ฐ๊ฐ€ ์ €์žฅ์ด ๋œ๋‹ค.

๋‚ ์งœ-ํŠธ๋žœ์žญ์…˜ ID๋กœ ์ €์žฅ์ด ๋œ๋‹ค.

helm ์„ ์ด์šฉํ•ด์„œ ๋ณต๊ตฌ

  • curity.config.configurationSecret

  • curity.config.configurationSecretItemName๋ฅผ ์‚ฌ์šฉ

๋ฐฑ์—…์„ ๋ณต์›ํ•ฉ๋‹ˆ๋‹ค

helm์œผ๋กœ ๋ณต๊ตฌํ• ๋•Œ ๋‹ค์Œ ์˜ต์…˜์„ ์‚ฌ์šฉํ•œ๋‹ค.

--set curity.config.configurationSecret=curity-idsvr-config-backup

--set curity.config.configurationSecretItemName=2021-09-01-65E-71EF1-563AE.xml

์—ฌ๋Ÿฌ๊ฐœ ์žˆ์„๋•Œ ํ—ท๊ฐˆ๋ฆฌ๊ธฐ๋„ ํ•˜๊ฒŸ๋‹ค. git๋ฐฉ์‹์ด ๋” ๋‚˜์„์ˆ˜๋„ ์ž‡์„๊ฑฐ๊ฐ™๋‹ค.

https://developer.curity.io/
https://curity.io/docs/idsvr/latest/system-admin-guide/data-sources/jdbc.html?highlight=session#mysql-and-mariadb
https://curity.io/docs/idsvr/latest/configuration-guide/commit-hooks.html#commit-hook-scripts