基于OAuth2-proxy和Keycloak為comfyui實現SSO

背景

comfyui無認證被漏掃后易被rce挖礦

攻擊過程
https://www.oschina.net/news/340226
https://github.com/comfyanonymous/ComfyUI/discussions/5165
阿里云漏洞庫關于comfyui的漏洞
https://avd.aliyun.com/search?q=comfyui&timestamp__1384=n4%2BxBD0GitGQ0QD8ID%2FiW4BIY0Ki%3DdYre1rN74D

RCE示例

https://github.com/hay86/ComfyUI_AceNodes/blob/5ba01db8a3b7afb8e4aecfaa48823ddeb132bbbb/nodes.py#L1193

邏輯圖示意

在這里插入圖片描述
理論上,配合istio的reuquestauthorization可以加密k8s中所有的需要認證的界面

Keycloak

支持郵箱認證,等各種SSO,RBAC權限控制等。

keycloak鏡像需要先build一下,再放到k8s中作為啟動鏡像直接使用

FROM registry.xx.local/keycloak/keycloak:26.2.4 AS builder
# Enable health and metrics support
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true# Configure a database vendor
ENV KC_DB=postgresWORKDIR /opt/keycloak
RUN /opt/keycloak/bin/kc.sh buildFROM registry.xx.local/keycloak/keycloak:26.2.4
COPY --from=builder /opt/keycloak/ /opt/keycloak/
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]

keycloak postgresql部署文件

apiVersion: v1
kind: Service
metadata:name: keycloaklabels:app: keycloak
spec:ports:- protocol: TCPport: 8080targetPort: httpname: httpselector:app: keycloaktype: ClusterIP
---
apiVersion: v1
kind: Service
metadata:labels:app: keycloak# Used toname: keycloak-discovery
spec:selector:app: keycloak# Allow not-yet-ready Pods to be visible to ensure the forming of a cluster if Pods come up concurrentlypublishNotReadyAddresses: trueclusterIP: Nonetype: ClusterIP
---
apiVersion: apps/v1
# Use a stateful setup to ensure that for a rolling update Pods are restarted with a rolling strategy one-by-one.
# This prevents losing in-memory information stored redundantly in two Pods.
kind: StatefulSet
metadata:name: keycloaklabels:app: keycloak
spec:serviceName: keycloak-discovery# Run with one replica to save resources, or with two replicas to allow for rolling updates for configuration changesreplicas: 1selector:matchLabels:app: keycloaktemplate:metadata:labels:app: keycloakspec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: kubernetes.io/archoperator: Invalues:- arm64containers:- name: keycloakimage: registry.xxx.local/keycloak/keycloak:26.2.4-optionsargs: ["start", "--optimized"] # 注意啟動參數env:- name: KC_BOOTSTRAP_ADMIN_USERNAMEvalue: "admin"- name: KC_BOOTSTRAP_ADMIN_PASSWORDvalue: "brainkeyClock@2025"# In a production environment, add a TLS certificate to Keycloak to either end-to-end encrypt the traffic between# the client or Keycloak, or to encrypt the traffic between your proxy and Keycloak.# Respect the proxy headers forwarded by the reverse proxy# In a production environment, verify which proxy type you are using, and restrict access to Keycloak# from other sources than your proxy if you continue to use proxy headers.- name: KC_PROXY_HEADERSvalue: "xforwarded"- name: KC_HTTP_ENABLEDvalue: "true"# In this explorative setup, no strict hostname is set.# For production environments, set a hostname for a secure setup.- name: KC_HOSTNAME_STRICTvalue: "false"- name: KC_HEALTH_ENABLEDvalue: "true"- name: 'KC_CACHE'value: 'ispn'# Use the Kubernetes configuration for distributed caches which is based on DNS- name: 'KC_CACHE_STACK'value: 'kubernetes'# Passing the Pod's IP primary address to the JGroups clustering as this is required in IPv6 only setups- name: POD_IPvalueFrom:fieldRef:fieldPath: status.podIP# Instruct JGroups which DNS hostname to use to discover other Keycloak nodes# Needs to be unique for each Keycloak cluster- name: JAVA_OPTS_APPENDvalue: '-Djgroups.dns.query="keycloak-discovery" -Djgroups.bind.address=$(POD_IP)'- name: 'KC_DB_URL_DATABASE'value: 'keycloak'- name: 'KC_DB_URL_HOST'value: 'postgres'- name: 'KC_DB'value: 'postgres'# In a production environment, use a secret to store username and password to the database- name: 'KC_DB_PASSWORD'value: 'CEPEiRjHVT'- name: 'KC_DB_USERNAME'value: 'keycloak'ports:- name: httpcontainerPort: 8080startupProbe:httpGet:path: /health/startedport: 9000readinessProbe:httpGet:path: /health/readyport: 9000livenessProbe:httpGet:path: /health/liveport: 9000resources:limits:cpu: 2000mmemory: 2000Mirequests:cpu: 500mmemory: 1700Mi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: postgres-data-pvcnamespace: infrastructure
spec:storageClassName: csi-cephfs-scaccessModes:- ReadWriteOnceresources:requests:storage: 2Gi
---
# This is deployment of PostgreSQL with an ephemeral storage for testing: Once the Pod stops, the data is lost.
# For a production setup, replace it with a database setup that persists your data.
apiVersion: apps/v1
kind: Deployment
metadata:name: postgreslabels:app: postgres
spec:replicas: 1selector:matchLabels:app: postgrestemplate:metadata:labels:app: postgresspec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: kubernetes.io/archoperator: Invalues:- arm64- key: kubernetes.io/hostnameoperator: Invalues:- 10.17.3.8containers:- name: postgresimage: registry.xxx.local/keycloak/postgres:17env:- name: POSTGRES_USERvalue: "keycloak"- name: POSTGRES_PASSWORDvalue: "CEPEiRjHVT"- name: POSTGRES_DBvalue: "keycloak"- name: POSTGRES_LOG_STATEMENTvalue: "all"- name: PGDATAvalue: "/var/lib/postgresql/data"ports:- name: postgrescontainerPort: 5432volumeMounts:# Using volume mount for PostgreSQL's data folder as it is otherwise not writable- name: postgres-datamountPath: /var/lib/postgresql/datavolumes:- name: postgres-datapersistentVolumeClaim:claimName: postgres-data-pvc
---
apiVersion: v1
kind: Service
metadata:labels:app: postgresname: postgres
spec:selector:app: postgresports:- protocol: TCPport: 5432targetPort: 5432type: ClusterIP

keycloak web界面配置

  1. 創建realms
  2. 創建client
  3. 創建user

創建realms
在這里插入圖片描述
在comfyui realms下創建client
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

在這里插入圖片描述
在這里插入圖片描述
設置郵箱,開啟校驗,用戶校驗界面選項GPT解釋如下

名稱是否勾選含義與說明
Standard flow ?已勾選啟用 授權碼模式(Authorization Code Flow)。這是 OAuth2 / OIDC 中最安全的認證方式,適用于 Web 應用。用戶先跳轉到 Keycloak 登錄,登錄成功后用授權碼換取 token。
👉 推薦用于 OAuth2 Proxy / Web 前端認證場景
Implicit flow ??未勾選啟用 隱式授權模式,直接在瀏覽器中返回 access_token(不通過授權碼)。
? 適用于老式前端 SPA,但因安全性差(token 暴露在 URL),已被 OpenID Connect 官方棄用
👉 不推薦啟用,現代系統應使用 PKCE 替代。
Direct access grants ??未勾選啟用 資源所有者密碼模式(Password Grant),客戶端可直接用用戶名+密碼換 token(不跳轉登錄頁)。
👉 適合 CLI 工具或可信環境,不適合瀏覽器 Web 應用
Service accounts roles ??未勾選啟用 客戶端憑證模式(Client Credentials Grant),用于服務對服務的通信,客戶端代表自己(非用戶)訪問資源。
👉 適合后端服務間通信,不涉及用戶登錄。
Standard Token Exchange ??未勾選啟用 token 交換(Token Exchange),允許一個 token 換成另一個 token(比如 impersonation)。
👉 一般用于微服務或代理層,需要更高控制的場景。
OAuth 2.0 Device Authorization Grant ??未勾選支持“設備授權碼模式”,常用于智能電視、物聯網設備登錄場景(輸入驗證碼方式登錄)。
OIDC CIBA Grant ??未勾選“Client Initiated Backchannel Authentication”,用于異步認證場景,比如銀行確認付款請求。非常少用,適用于強身份確認。

創建的users需要啟用郵箱驗證才能登錄,否則報錯500
驗證用戶列表頁面的郵箱列
在這里插入圖片描述
為用戶設置密碼
在這里插入圖片描述

keycloak openid endpoint
在這里插入圖片描述

postgresql

keycloak中的web界面配置realms client user存儲在后端的postgresql中。

注意掛載目錄和PGDATA變量,default PGDATA=/var/lib/postgresql/data

不能直接掛載/var/lib/postgresql到目錄下,否則刪除postgresql pod后,數據目錄中的內容也會清空

OAuth2-proxy

使用helm部署

helm repo add oauth2-proxy https://oauth2-proxy.github.io/manifests
helm repo list
NAME            URL                                    
oauth2-proxy    https://oauth2-proxy.github.io/manifests
# 下載
helm pull oauth2-proxy/oauth2-proxy
# 將gz包上傳到master節點部署機

主要配置如下

  1. clientId
  2. clientSecret
  3. cookieSecret
  4. upstreams 內部comfyui的地址
  5. oidc_issuer_url oidc openid 身份提供者 簽發地址
  6. redirect_url 重定向回客戶端和keycloak中的Valid redirect URIs 相同

cookeSecret獲取openssl rand -base64 32 | head -c 32 | base64

values.yaml如下

global: {}
# To help compatibility with other charts which use global.imagePullSecrets.
# global:
#   imagePullSecrets:
#   - name: pullSecret1
#   - name: pullSecret2## Override the deployment namespace
##
namespaceOverride: "infrastructure"# Force the target Kubernetes version (it uses Helm `.Capabilities` if not set).
# This is especially useful for `helm template` as capabilities are always empty
# due to the fact that it doesn't query an actual cluster
kubeVersion:# Oauth client configuration specifics
config:# Add config annotationsannotations: {}# OAuth client IDclientID: "comfyui"# OAuth client secretclientSecret: "JQXnuxI9gyGiTp8p"# Create a new secret with the following command# openssl rand -base64 32 | head -c 32 | base64# Use an existing secret for OAuth2 credentials (see secret.yaml for required fields)# Example:# existingSecret: secretcookieSecret: "dPSHySO6TexpR5uyDQC2H"# The name of the cookie that oauth2-proxy will create# If left empty, it will default to the release namecookieName: ""google: {}# adminEmail: xxxx# useApplicationDefaultCredentials: true# targetPrincipal: xxxx# serviceAccountJson: xxxx# Alternatively, use an existing secret (see google-secret.yaml for required fields)# Example:# existingSecret: google-secret# groups: []# Example:#  - group1@example.com#  - group2@example.com# Default configuration, to be overriddenconfigFile: |-email_domains = [ "*" ]upstreams = [ "http://comfyui:80/" ]  # 內部comfyui的地址provider = "oidc"oidc_issuer_url = "https://keycloak.xx.xxx.xx.cn/realms/comfyui"redirect_url = "https://comfyui.xx.xx.xx.cn/oauth2/callback"pass_authorization_header = truepass_access_token = true# Custom configuration file: oauth2_proxy.cfg# configFile: |-#   pass_basic_auth = false#   pass_access_token = true# Use an existing config map (see configmap.yaml for required fields)# Example:# existingConfig: configalphaConfig:enabled: false# Add config annotationsannotations: {}# Arbitrary configuration data to append to the server sectionserverConfigData: {}# Arbitrary configuration data to append to the metrics sectionmetricsConfigData: {}# Arbitrary configuration data to appendconfigData: {}# Arbitrary configuration to append# This is treated as a Go template and rendered with the root contextconfigFile: ""# Use an existing config map (see secret-alpha.yaml for required fields)existingConfig: ~# Use an existing secretexistingSecret: ~image:repository: "registry.xx.local/infra/quay.io/oauth2-proxy"# appVersion is used by defaulttag: ""pullPolicy: "IfNotPresent"command: []# Optionally specify an array of imagePullSecrets.
# Secrets must be manually created in the namespace.
# ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
imagePullSecrets: []# - name: myRegistryKeySecretName# Set a custom containerPort if required.
# This will default to 4180 if this value is not set and the httpScheme set to http
# This will default to 4443 if this value is not set and the httpScheme set to https
# containerPort: 4180extraArgs:- --show-debug-on-error=true- --show-debug-on-error=true- --set-authorization-header=true- --reverse-proxy=true- --auth-logging=true- --cookie-httponly=true- --pass-access-token=true- --standard-logging=trueextraEnv: []envFrom: []
# Load environment variables from a ConfigMap(s) and/or Secret(s)
# that already exists (created and managed by you).
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables
#
# PS: Changes in these ConfigMaps or Secrets will not be automatically
#     detected and you must manually restart the relevant Pods after changes.
#
#  - configMapRef:
#      name: special-config
#  - secretRef:
#      name: special-config-secret# -- Custom labels to add into metadata
customLabels: {}# To authorize individual email addresses
# That is part of extraArgs but since this needs special treatment we need to do a separate section
authenticatedEmailsFile:enabled: false# Defines how the email addresses file will be projected, via a configmap or secretpersistence: configmap# template is the name of the configmap what contains the email user list but has been configured without this chart.# It's a simpler way to maintain only one configmap (user list) instead changing it for each oauth2-proxy service.# Be aware the value name in the extern config map in data needs to be named to "restricted_user_access" or to the# provided value in restrictedUserAccessKey field.template: ""# The configmap/secret key under which the list of email access is stored# Defaults to "restricted_user_access" if not filled-in, but can be overridden to allow flexibilityrestrictedUserAccessKey: ""# One email per line# example:# restricted_access: |-#   name1@domain#   name2@domain# If you override the config with restricted_access it will configure a user list within this chart what takes care of the# config map resource.restricted_access: ""annotations: {}# helm.sh/resource-policy: keepservice:type: ClusterIP# when service.type is ClusterIP ...# clusterIP: 192.0.2.20# when service.type is LoadBalancer ...# loadBalancerIP: 198.51.100.40# loadBalancerSourceRanges: 203.0.113.0/24# when service.type is NodePort ...# nodePort: 80portNumber: 80# Protocol set on the serviceappProtocol: httpannotations: {}# foo.io/bar: "true"# configure externalTrafficPolicyexternalTrafficPolicy: ""# configure internalTrafficPolicyinternalTrafficPolicy: ""# configure service target porttargetPort: ""## Create or use ServiceAccount
serviceAccount:## Specifies whether a ServiceAccount should be createdenabled: true## The name of the ServiceAccount to use.## If not set and create is true, a name is generated using the fullname templatename:automountServiceAccountToken: trueannotations: {}ingress:enabled: false# className: nginxpath: /# Only used if API capabilities (networking.k8s.io/v1) allow itpathType: ImplementationSpecific# Used to create an Ingress record.# hosts:# - chart-example.local# Extra paths to prepend to every host configuration. This is useful when working with annotation based services.# Warning! The configuration is dependant on your current k8s API version capabilities (networking.k8s.io/v1)# extraPaths:# - path: /*#   pathType: ImplementationSpecific#   backend:#     service:#       name: ssl-redirect#       port:#         name: use-annotationlabels: {}# annotations:#   kubernetes.io/ingress.class: nginx#   kubernetes.io/tls-acme: "true"# tls:# Secrets must be manually created in the namespace.# - secretName: chart-example-tls#   hosts:#     - chart-example.localresources: {}# limits:#   cpu: 100m#   memory: 300Mi# requests:#   cpu: 100m#   memory: 300MiextraVolumes: []# - name: ca-bundle-cert#   secret:#     secretName: <secret-name>extraVolumeMounts: []# - mountPath: /etc/ssl/certs/#   name: ca-bundle-cert# Additional containers to be added to the pod.
extraContainers: []#  - name: my-sidecar#    image: nginx:latest# Additional Init containers to be added to the pod.
extraInitContainers: []#  - name: wait-for-idp#    image: my-idp-wait:latest#    command:#    - sh#    - -c#    - wait-for-idp.shpriorityClassName: ""# hostAliases is a list of aliases to be added to /etc/hosts for network name resolution
hostAliases: []
# - ip: "10.xxx.xxx.xxx"
#   hostnames:
#     - "auth.example.com"
# - ip: 127.0.0.1
#   hostnames:
#     - chart-example.local
#     - example.local# [TopologySpreadConstraints](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/) configuration.
# Ref: https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling
# topologySpreadConstraints: []# Affinity for pod assignment
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: kubernetes.io/archoperator: Invalues:- arm64# Tolerations for pod assignment
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []# Node labels for pod assignment
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
nodeSelector: {}# Whether to use secrets instead of environment values for setting up OAUTH2_PROXY variables
proxyVarsAsSecrets: true# Configure Kubernetes liveness and readiness probes.
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
# Disable both when deploying with Istio 1.0 mTLS. https://istio.io/help/faq/security/#k8s-health-checks
livenessProbe:enabled: trueinitialDelaySeconds: 0timeoutSeconds: 1readinessProbe:enabled: trueinitialDelaySeconds: 0timeoutSeconds: 5periodSeconds: 10successThreshold: 1# Configure Kubernetes security context for container
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
securityContext:enabled: trueallowPrivilegeEscalation: falsecapabilities:drop:- ALLreadOnlyRootFilesystem: truerunAsNonRoot: truerunAsUser: 2000runAsGroup: 2000seccompProfile:type: RuntimeDefaultdeploymentAnnotations: {}
podAnnotations: {}
podLabels: {}
replicaCount: 1
revisionHistoryLimit: 10
strategy: {}
enableServiceLinks: true## PodDisruptionBudget settings
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
podDisruptionBudget:enabled: trueminAvailable: 1## Horizontal Pod Autoscaling
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
autoscaling:enabled: falseminReplicas: 1maxReplicas: 10targetCPUUtilizationPercentage: 80
#  targetMemoryUtilizationPercentage: 80annotations: {}# Configure Kubernetes security context for pod
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
podSecurityContext: {}# whether to use http or https
httpScheme: httpinitContainers:# if the redis sub-chart is enabled, wait for it to be ready# before starting the proxy# creates a role binding to get, list, watch, the redis master pod# if service account is enabledwaitForRedis:enabled: trueimage:repository: "alpine"tag: "latest"pullPolicy: "IfNotPresent"# uses the kubernetes version of the cluster# the chart is deployed on, if not setkubectlVersion: ""securityContext:enabled: trueallowPrivilegeEscalation: falsecapabilities:drop:- ALLreadOnlyRootFilesystem: truerunAsNonRoot: truerunAsUser: 65534runAsGroup: 65534seccompProfile:type: RuntimeDefaulttimeout: 180resources: {}# limits:#   cpu: 100m#   memory: 300Mi# requests:#   cpu: 100m#   memory: 300Mi# Additionally authenticate against a htpasswd file. Entries must be created with "htpasswd -B" for bcrypt encryption.
# Alternatively supply an existing secret which contains the required information.
htpasswdFile:enabled: falseexistingSecret: ""entries: []# One row for each user# example:# entries:#  - testuser:$2y$05$gY6dgXqjuzFhwdhsiFe7seM9q9Tile4Y3E.CBpAZJffkeiLaC21Gy# Configure the session storage type, between cookie and redis
sessionStorage:# Can be one of the supported session storage cookie|redistype: cookieredis:# Name of the Kubernetes secret containing the redis & redis sentinel password values (see also `sessionStorage.redis.passwordKey`)existingSecret: ""# Redis password value. Applicable for all Redis configurations. Taken from redis subchart secret if not set. `sessionStorage.redis.existingSecret` takes precedencepassword: ""# Key of the Kubernetes secret data containing the redis password value. If you use the redis sub chart, make sure# this password matches the one used in redis.global.redis.password (see below).passwordKey: "redis-password"# Can be one of standalone|cluster|sentinelclientType: "standalone"standalone:# URL of redis standalone server for redis session storage (e.g. `redis://HOST[:PORT]`). Automatically generated if not setconnectionUrl: ""cluster:# List of Redis cluster connection URLs. Array or single string allowed.connectionUrls: []# - "redis://127.0.0.1:8000"# - "redis://127.0.0.1:8001"sentinel:# Name of the Kubernetes secret containing the redis sentinel password value (see also `sessionStorage.redis.sentinel.passwordKey`). Default: `sessionStorage.redis.existingSecret`existingSecret: ""# Redis sentinel password. Used only for sentinel connection; any redis node passwords need to use `sessionStorage.redis.password`password: ""# Key of the Kubernetes secret data containing the redis sentinel password valuepasswordKey: "redis-sentinel-password"# Redis sentinel master namemasterName: ""# List of Redis cluster connection URLs. Array or single string allowed.connectionUrls: []# - "redis://127.0.0.1:8000"# - "redis://127.0.0.1:8001"# Enables and configure the automatic deployment of the redis subchart
redis:# provision an instance of the redis sub-chartenabled: false# Redis specific helm chart settings, please see:# https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters# global:#   redis:#     password: yourpassword# If you install Redis using this sub chart, make sure that the password of the sub chart matches the password# you set in sessionStorage.redis.password (see above).# redisPort: 6379# architecture: standalone# Enables apiVersion deprecation checks
checkDeprecation: true# Allows graceful shutdown
# terminationGracePeriodSeconds: 65
# lifecycle:
#   preStop:
#     exec:
#       command: [ "sh", "-c", "sleep 60" ]metrics:# Enable Prometheus metrics endpointenabled: true# Serve Prometheus metrics on this portport: 44180# when service.type is NodePort ...# nodePort: 44180# Protocol set on the service for the metrics portservice:appProtocol: httpserviceMonitor:# Enable Prometheus Operator ServiceMonitorenabled: false# Define the namespace where to deploy the ServiceMonitor resourcenamespace: ""# Prometheus Instance definitionprometheusInstance: default# Prometheus scrape intervalinterval: 60s# Prometheus scrape timeoutscrapeTimeout: 30s# Add custom labels to the ServiceMonitor resourcelabels: {}## scheme: HTTP scheme to use for scraping. Can be used with `tlsConfig` for example if using istio mTLS.scheme: ""## tlsConfig: TLS configuration to use when scraping the endpoint. For example if using istio mTLS.## Of type: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#tlsconfigtlsConfig: {}## bearerTokenFile: Path to bearer token file.bearerTokenFile: ""## Used to pass annotations that are used by the Prometheus installed in your cluster to select Service Monitors to work with## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspecannotations: {}## Metric relabel configs to apply to samples before ingestion.## [Metric Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs)metricRelabelings: []# - action: keep#   regex: 'kube_(daemonset|deployment|pod|namespace|node|statefulset).+'#   sourceLabels: [__name__]## Relabel configs to apply to samples before ingestion.## [Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config)relabelings: []# - sourceLabels: [__meta_kubernetes_pod_node_name]#   separator: ;#   regex: ^(.*)$#   targetLabel: nodename#   replacement: $1#   action: replace# Extra K8s manifests to deploy
extraObjects: []# - apiVersion: secrets-store.csi.x-k8s.io/v1#   kind: SecretProviderClass#   metadata:#     name: oauth2-proxy-secrets-store#   spec:#     provider: aws#     parameters:#       objects: |#         - objectName: "oauth2-proxy"#           objectType: "secretsmanager"#           jmesPath:#               - path: "client_id"#                 objectAlias: "client-id"#               - path: "client_secret"#                 objectAlias: "client-secret"#               - path: "cookie_secret"#                 objectAlias: "cookie-secret"#     secretObjects:#     - data:#       - key: client-id#         objectName: client-id#         - key: client-secret#           objectName: client-secret#         - key: cookie-secret#         objectName: cookie-secret#       secretName: oauth2-proxy-secrets-store#       type: Opaque

oauth2-proxy參數

Usage of oauth2-proxy:--acr-values string                                   acr values string:  optional--allow-query-semicolons                              allow the use of semicolons in query args--allowed-group strings                               restrict logins to members of this group (may be given multiple times)--allowed-role strings                                (keycloak-oidc) restrict logins to members of these roles (may be given multiple times)--alpha-config string                                 path to alpha config file (use at your own risk - the structure in this config file may change between minor releases)
unknown flag: --debug--api-route strings                                   return HTTP 401 instead of redirecting to authentication server if token is not valid. Format: path_regex--approval-prompt string                              OAuth approval_prompt (default "force")--auth-logging                                        Log authentication attempts (default true)--auth-logging-format string                          Template for authentication log lines (default "{{.Client}} - {{.RequestID}} - {{.Username}} [{{.Timestamp}}] [{{.Status}}] {{.Message}}")--auth-request-response-mode string                   Authorization request response mode--authenticated-emails-file string                    authenticate against emails via file (one per line)--azure-graph-group-field id                          configures the group field to be used when building the groups list(id or `displayName`. Default is `id`) from Microsoft Graph(available only for v2.0 oidc url). Based on this value, the `allowed-group` config values should be adjusted accordingly. If using `id` as group field, `allowed-group` should contains groups IDs, if using `displayName` as group field, `allowed-group` should contains groups name--azure-tenant string                                 go to a tenant-specific or common (tenant-independent) endpoint. (default "common")--backend-logout-url string                           url to perform a backend logout, {id_token} can be used as placeholder for the id_token--banner string                                       custom banner string. Use "-" to disable default banner.--basic-auth-password string                          the password to set when passing the HTTP Basic Auth header--bearer-token-login-fallback                         if skip-jwt-bearer-tokens is set, fall back to normal login redirect with an invalid JWT. If false, 403 instead (default true)--bitbucket-repository string                         restrict logins to user with access to this repository--bitbucket-team string                               restrict logins to members of this team--client-id string                                    the OAuth Client ID: ie: "123456.apps.googleusercontent.com"--client-secret string                                the OAuth Client Secret--client-secret-file string                           the file with OAuth Client Secret--code-challenge-method string                        use PKCE code challenges with the specified method. Either 'plain' or 'S256'--config string                                       path to config file--convert-config-to-alpha                             if true, the proxy will load configuration as normal and convert existing configuration to the alpha config structure, and print it to stdout--cookie-csrf-expire duration                         expire timeframe for CSRF cookie (default 15m0s)--cookie-csrf-per-request                             When this property is set to true, then the CSRF cookie name is built based on the state and varies per request. If property is set to false, then CSRF cookie has the same name for all requests.--cookie-domain .yourcompany.com                      Optional cookie domains to force cookies to (ie: .yourcompany.com). The longest domain matching the request's host will be used (or the shortest cookie domain if there is no match).--cookie-expire duration                              expire timeframe for cookie (default 168h0m0s)--cookie-httponly                                     set HttpOnly cookie flag (default true)--cookie-name string                                  the name of the cookie that the oauth_proxy creates (default "_oauth2_proxy")--cookie-path string                                  an optional cookie path to force cookies to (ie: /poc/)* (default "/")--cookie-refresh duration                             refresh the cookie after this duration; 0 to disable--cookie-samesite string                              set SameSite cookie attribute (ie: "lax", "strict", "none", or ""). --cookie-secret string                                the seed string for secure cookies (optionally base64 encoded)--cookie-secure                                       set secure (HTTPS) cookie flag (default true)--custom-sign-in-logo string                          path or URL to an custom image for the sign_in page logo. Use "-" to disable default logo.--custom-templates-dir string                         path to custom html templates--display-htpasswd-form                               display username / password login form if an htpasswd file is provided (default true)--email-domain strings                                authenticate emails with the specified domain (may be given multiple times). Use * to authenticate any email--encode-state                                        will encode oauth state with base64--entra-id-allowed-tenant strings                     list of tenants allowed for MS Entra ID multi-tenant application--entra-id-federated-token-auth                       enable oAuth client authentication with federated token projected by Azure Workload Identity plugin, instead of client secret.--errors-to-info-log                                  Log errors to the standard logging channel instead of stderr--exclude-logging-path strings                        Exclude logging requests to paths (eg: '/path1,/path2,/path3')--extra-jwt-issuers strings                           if skip-jwt-bearer-tokens is set, a list of extra JWT issuer=audience pairs (where the issuer URL has a .well-known/openid-configuration or a .well-known/jwks.json)--flush-interval duration                             period between response flushing when streaming responses (default 1s)--footer string                                       custom footer string. Use "-" to disable default footer.--force-code-challenge-method string                  Deprecated - use --code-challenge-method--force-https                                         force HTTPS redirect for HTTP requests--force-json-errors                                   will force JSON errors instead of HTTP error pages or redirects--gcp-healthchecks                                    Enable GCP/GKE healthcheck endpoints--github-org string                                   restrict logins to members of this organisation--github-repo string                                  restrict logins to collaborators of this repository--github-team string                                  restrict logins to members of this team--github-token string                                 the token to use when verifying repository collaborators (must have push access to the repository)--github-user strings                                 allow users with these usernames to login even if they do not belong to the specified org and team or collaborators (may be given multiple times)--gitlab-group strings                                restrict logins to members of this group (may be given multiple times)--gitlab-project group/project=accesslevel            restrict logins to members of this project (may be given multiple times) (eg group/project=accesslevel). Access level should be a value matching Gitlab access levels (see https://docs.gitlab.com/ee/api/members.html#valid-access-levels), defaulted to 20 if absent--google-admin-email string                           the google admin to impersonate for api calls--google-group strings                                restrict logins to members of this google group (may be given multiple times).--google-service-account-json string                  the path to the service account json credentials--google-target-principal string                      the target principal to impersonate when using ADC--google-use-application-default-credentials string   use application default credentials instead of service account json (i.e. GKE Workload Identity)--htpasswd-file string                                additionally authenticate against a htpasswd file. Entries must be created with "htpasswd -B" for bcrypt encryption--htpasswd-user-group strings                         the groups to be set on sessions for htpasswd users (may be given multiple times)--http-address string                                 [http://]<addr>:<port> or unix://<path> or fd:<int> (case insensitive) to listen on for HTTP clients (default "127.0.0.1:4180")--https-address string                                <addr>:<port> to listen on for HTTPS clients (default ":443")--insecure-oidc-allow-unverified-email                Don't fail if an email address in an id_token is not verified--insecure-oidc-skip-issuer-verification              Do not verify if issuer matches OIDC discovery URL--insecure-oidc-skip-nonce                            skip verifying the OIDC ID Token's nonce claim (default true)--jwt-key string                                      private key in PEM format used to sign JWT, so that you can say something like -jwt-key="${OAUTH2_PROXY_JWT_KEY}": required by login.gov--jwt-key-file string                                 path to the private key file in PEM format used to sign the JWT so that you can say something like -jwt-key-file=/etc/ssl/private/jwt_signing_key.pem: required by login.gov--keycloak-group strings                              restrict logins to members of these groups (may be given multiple times)--logging-compress                                    Should rotated log files be compressed using gzip--logging-filename string                             File to log requests to, empty for stdout--logging-local-time                                  If the time in log files and backup filenames are local or UTC time (default true)--logging-max-age int                                 Maximum number of days to retain old log files (default 7)--logging-max-backups int                             Maximum number of old log files to retain; 0 to disable--logging-max-size int                                Maximum size in megabytes of the log file before rotation (default 100)--login-url string                                    Authentication endpoint--metrics-address string                              the address /metrics will be served on (e.g. ":9100")--metrics-secure-address string                       the address /metrics will be served on for HTTPS clients (e.g. ":9100")--metrics-tls-cert-file string                        path to certificate file for secure metrics server--metrics-tls-key-file string                         path to private key file for secure metrics server--oidc-audience-claim strings                         which OIDC claims are used as audience to verify against client id (default [aud])--oidc-email-claim string                             which OIDC claim contains the user's email (default "email")--oidc-extra-audience strings                         additional audiences allowed to pass audience verification--oidc-groups-claim string                            which OIDC claim contains the user groups (default "groups")--oidc-issuer-url string                              OpenID Connect issuer URL (ie: https://accounts.google.com)--oidc-jwks-url string                                OpenID Connect JWKS URL (ie: https://www.googleapis.com/oauth2/v3/certs)--oidc-public-key-file strings                        path to public key file in PEM format to use for verifying JWT tokens (may be given multiple times)--pass-access-token                                   pass OAuth access_token to upstream via X-Forwarded-Access-Token header--pass-authorization-header                           pass the Authorization Header to upstream--pass-basic-auth                                     pass HTTP Basic Auth, X-Forwarded-User and X-Forwarded-Email information to upstream (default true)--pass-host-header                                    pass the request Host Header to upstream (default true)--pass-user-headers                                   pass X-Forwarded-User and X-Forwarded-Email information to upstream (default true)--ping-path string                                    the ping endpoint that can be used for basic health checks (default "/ping")--ping-user-agent string                              special User-Agent that will be used for basic health checks--prefer-email-to-user                                Prefer to use the Email address as the Username when passing information to upstream. Will only use Username if Email is unavailable, eg. htaccess authentication. Used in conjunction with -pass-basic-auth and -pass-user-headers--profile-url string                                  Profile access endpoint--prompt string                                       OIDC prompt--provider string                                     OAuth provider (default "google")--provider-ca-file strings                            One or more paths to CA certificates that should be used when connecting to the provider.  If not specified, the default Go trust sources are used instead.--provider-display-name string                        Provider display name--proxy-prefix string                                 the url root path that this proxy should be nested under (e.g. /<oauth2>/sign_in) (default "/oauth2")--proxy-websockets                                    enables WebSocket proxying (default true)--pubjwk-url string                                   JWK pubkey access endpoint: required by login.gov--ready-path string                                   the ready endpoint that can be used for deep health checks (default "/ready")--real-client-ip-header string                        Header used to determine the real IP of the client (one of: X-Forwarded-For, X-Real-IP, X-ProxyUser-IP, X-Envoy-External-Address, or CF-Connecting-IP) (default "X-Real-IP")--redeem-url string                                   Token redemption endpoint--redirect-url string                                 the OAuth Redirect URL. ie: "https://internalapp.yourcompany.com/oauth2/callback"--redis-ca-path string                                Redis custom CA path--redis-cluster-connection-urls strings               List of Redis cluster connection URLs (eg redis://[USER[:PASSWORD]@]HOST[:PORT]). Used in conjunction with --redis-use-cluster--redis-connection-idle-timeout int                   Redis connection idle timeout seconds, if Redis timeout option is non-zero, the --redis-connection-idle-timeout must be less then Redis timeout option--redis-connection-url string                         URL of redis server for redis session storage (eg: redis://[USER[:PASSWORD]@]HOST[:PORT])--redis-insecure-skip-tls-verify                      Use insecure TLS connection to redis--redis-password --redis-connection-url               Redis password. Applicable for all Redis configurations. Will override any password set in --redis-connection-url--redis-sentinel-connection-urls strings              List of Redis sentinel connection URLs (eg redis://[USER[:PASSWORD]@]HOST[:PORT]). Used in conjunction with --redis-use-sentinel--redis-sentinel-master-name string                   Redis sentinel master name. Used in conjunction with --redis-use-sentinel--redis-sentinel-password --redis-password            Redis sentinel password. Used only for sentinel connection; any redis node passwords need to use --redis-password--redis-use-cluster                                   Connect to redis cluster. Must set --redis-cluster-connection-urls to use this feature--redis-use-sentinel                                  Connect to redis via sentinels. Must set --redis-sentinel-master-name and --redis-sentinel-connection-urls to use this feature--redis-username --redis-connection-url               Redis username. Applicable for Redis configurations where ACL has been configured. Will override any username set in --redis-connection-url--relative-redirect-url                               allow relative OAuth Redirect URL.--request-id-header string                            Request header to use as the request ID (default "X-Request-Id")--request-logging                                     Log HTTP requests (default true)--request-logging-format string                       Template for HTTP request log lines (default "{{.Client}} - {{.RequestID}} - {{.Username}} [{{.Timestamp}}] {{.Host}} {{.RequestMethod}} {{.Upstream}} {{.RequestURI}} {{.Protocol}} {{.UserAgent}} {{.StatusCode}} {{.ResponseSize}} {{.RequestDuration}}")--resource string                                     The resource that is protected (Azure AD only)--reverse-proxy                                       are we running behind a reverse proxy, controls whether headers like X-Real-Ip are accepted--scope string                                        OAuth scope specification--session-cookie-minimal                              strip OAuth tokens from cookie session stores if they aren't needed (cookie session store only)--session-store-type string                           the session storage provider to use (default "cookie")--set-authorization-header                            set Authorization response headers (useful in Nginx auth_request mode)--set-basic-auth                                      set HTTP Basic Auth information in response (useful in Nginx auth_request mode)--set-xauthrequest                                    set X-Auth-Request-User and X-Auth-Request-Email response headers (useful in Nginx auth_request mode)--show-debug-on-error                                 show detailed error information on error pages (WARNING: this may contain sensitive information - do not use in production)--signature-key string                                GAP-Signature request signature key (algorithm:secretkey)--silence-ping-logging                                Disable logging of requests to ping & ready endpoints--skip-auth-preflight                                 will skip authentication for OPTIONS requests--skip-auth-regex strings                             (DEPRECATED for --skip-auth-route) bypass authentication for requests path's that match (may be given multiple times)--skip-auth-route strings                             bypass authentication for requests that match the method & path. Format: method=path_regex OR method!=path_regex. For all methods: path_regex OR !=path_regex--skip-auth-strip-headers                             strips X-Forwarded-* style authentication headers & Authorization header if they would be set by oauth2-proxy (default true)--skip-claims-from-profile-url                        Skip loading missing claims from profile URL--skip-jwt-bearer-tokens                              will skip requests that have verified JWT bearer tokens (default false)--skip-oidc-discovery                                 Skip OIDC discovery and use manually supplied Endpoints--skip-provider-button                                will skip sign-in-page to directly reach the next step: oauth/start--ssl-insecure-skip-verify                            skip validation of certificates presented when using HTTPS providers--ssl-upstream-insecure-skip-verify                   skip validation of certificates presented when using HTTPS upstreams--standard-logging                                    Log standard runtime information (default true)--standard-logging-format string                      Template for standard log lines (default "[{{.Timestamp}}] [{{.File}}] {{.Message}}")--tls-cert-file string                                path to certificate file--tls-cipher-suite strings                            restricts TLS cipher suites to those listed (e.g. TLS_RSA_WITH_RC4_128_SHA) (may be given multiple times)--tls-key-file string                                 path to private key file--tls-min-version string                              minimal TLS version for HTTPS clients (either "TLS1.2" or "TLS1.3")--trusted-ip strings                                  list of IPs or CIDR ranges to allow to bypass authentication. WARNING: trusting by IP has inherent security flaws, read the configuration documentation for more information.--upstream strings                                    the http url(s) of the upstream endpoint, file:// paths for static files or static://<status_code> for static response. Routing is based on the path--upstream-timeout duration                           maximum amount of time the server will wait for a response from the upstream (default 30s)--use-system-trust-store                              Determines if 'provider-ca-file' files and the system trust store are used. If set to true, your custom CA files and the system trust store are used otherwise only your custom CA files.--user-id-claim oidc-email-claim                      (DEPRECATED for oidc-email-claim) which claim contains the user ID (default "email")--validate-url string                                 Access token validation endpoint--version                                             print version string--whitelist-domain strings                            allowed domains for redirection after authentication. Prefix domain with a . or a *. to allow subdomains (eg .example.com, *.example.com)

Istio vs路由調整

kubectl get vs comfyui-virtualservice-exposed -o yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:annotations:kubectl.kubernetes.io/last-applied-configuration: |{"apiVersion":"networking.istio.io/v1beta1","kind":"VirtualService","metadata":{"annotations":{},"name":"comfyui-virtualservice-exposed","namespace":"infrastructure"},"spec":{"gateways":["istio-system/ingressgateway"],"hosts":["comfyui.x.x.x.cn"],"http":[{"match":null,"route":[{"destination":{"host":"comfyui","port":{"number":80}},"weight":100}]}]}}creationTimestamp: "2025-02-28T09:56:39Z"generation: 4name: comfyui-virtualservice-exposednamespace: infrastructureresourceVersion: "547356253"uid: bc6b739d-918e-4206-8657-e44361a4bc9b
spec:gateways:- istio-system/ingressgatewayhosts:- comfyui.x.x.x.cnhttp:- route:- destination:host: oauth2-proxyport:number: 80weight: 100

測試

訪問comfyui賬密
訪問comfyui界面會跳轉到OAuth2-proxy認證界面后跳轉到keycloak界面輸入賬密后才能訪問comfyui
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
登錄成功后可以在keycloak界面看到用戶的session

可以在keycloak界面調整用戶的session超時時間等。

reference

https://github.com/keycloak
優化容器
https://www.keycloak.org/server/containers
operator
https://www.keycloak.org/operator/installation#_installing_by_using_kubectl_without_operator_lifecycle_manager
配置文件
https://www.keycloak.org/server/configuration
OAuth2-proxy helm地址
https://artifacthub.io/packages/helm/oauth2-proxy/oauth2-proxy

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/81043.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/81043.shtml
英文地址,請注明出處:http://en.pswp.cn/web/81043.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

第R7周:糖尿病預測模型優化探索

文章目錄 1.數據預處理1.1 設置GPU1.2 數據導入1.3 數據檢查 2. 數據分析2.1 數據分布分析2.2 相關性分析 3. LSTM模型3.1 劃分數據集3.2 數據集構建3.3 定義模型 4. 訓練模型4.1 定義訓練函數4.2 定義測試函數4.3 訓練模型 5. 模型評估5.1 Loss與Accuracy圖 6. 總結 &#x1f…

一些好用的Chrome 擴展程序

以下是按主要功能分類的 Chrome 擴展程序列表&#xff0c;包括其版本號、中文功能簡述以及指向其主頁或 Chrome 網上應用店頁面的鏈接。 翻譯與語言 沉浸式翻譯 - 網頁翻譯插件 | PDF 翻譯 | 免費 版本: 1.16.12 描述: 【沉浸式翻譯】免費的&#xff08;原文 / 譯文&#xff0…

貪心算法題目合集2

貪心算法題目合集2 一般排序排隊接水整數區間金銀島尋找平面上的極大點NOIP 2008 普及組 排座椅 推導排序規律NOIP 1998 提高組 拼數排序規則的正確性證明&#xff1a;全序關系證明拼數的貪心策略正確P2878 [USACO07JAN] Protecting the Flowers SP1842 [USACO05NOV] 奶牛玩雜技…

全方位詳解微服務架構中的Service Mesh(服務網格)

一、引言 隨著微服務架構的廣泛應用&#xff0c;微服務之間的通信管理、流量控制、安全保障等問題變得日益復雜。服務網格&#xff08;Service Mesh&#xff09;作為一種新興的技術&#xff0c;為解決這些問題提供了有效的方案。它將服務間通信的管理從微服務代碼中分離出來&a…

如何在VSCode中更換默認瀏覽器:完整指南

引言 作為前端開發者&#xff0c;我們經常需要在VSCode中快速預覽HTML文件。默認情況下&#xff0c;VSCode會使用系統默認瀏覽器打開文件&#xff0c;但有時我們可能需要切換到其他瀏覽器進行測試。本文將詳細介紹如何在VSCode中更換默認瀏覽器。 方法一&#xff1a;使用VSCo…

【普及+/提高】洛谷P2613 【模板】有理數取余——快讀+快速冪

題目來源 P2613 【模板】有理數取余 - 洛谷 題目描述 給出一個有理數 cba?&#xff0c;求 cmod19260817 的值。 這個值被定義為 bx≡a(mod19260817) 的解。 輸入格式 一共兩行。 第一行&#xff0c;一個整數 a。 第二行&#xff0c;一個整數 b。 輸出格式 一個整數&a…

從編程助手到AI工程師:Trae插件Builder模式實戰Excel合并工具開發

Trae插件下載鏈接&#xff1a;https://www.trae.com.cn/plugin 引言&#xff1a;AI編程工具的新紀元 在軟件開發領域&#xff0c;AI輔助編程正在經歷一場革命性的變革。Trae插件&#xff08;原MarsCode編程助手&#xff09;最新推出的Builder模式&#xff0c;標志著AI編程工具…

Python set集合方法詳解

""" set()函數是個無序的去重集合&#xff0c;可以用來過濾重復元素 Python 提供了 2 種創建 set 集合的方法&#xff0c;分別是使用 {} 創建和使用 set() 函數將列表、元組等類型數據轉換為集合 """# 空集合 s0 set() # 正確方式 →…

各類Agent技術的發展現狀和核心痛點

AI Agent主要分類 Agent&#xff08;智能體&#xff09;技術是指具有自主感知、決策與執行能力的軟件系統&#xff0c;能夠在環境中完成特定任務。目前常見的Agent類型主要包括&#xff1a; - 基于大模型的智能體&#xff1a;以GPT-4等大型語言模型為核心&#xff0c;如AutoGP…

單片機-STM32部分:18、WiFi模組

飛書文檔https://x509p6c8to.feishu.cn/wiki/WFmqwImDViDUezkF7ercZuNDnve 一、WiFi模組應用 當設備需要連接網絡&#xff0c;實現遠程控制&#xff0c;狀態監控時&#xff0c;就需要添加通信模組&#xff0c;常見的通信模組WiFi模組、2G模組、4G模組等&#xff1a; 我們的板卡…

探索Qwen2ForCausalLM 架構上進行微調

簡述 試驗參考了mini_qwen 的開源實現 GitHub - qiufengqijun/mini_qwen: 這是一個從頭訓練大語言模型的項目&#xff0c;包括預訓練、微調和直接偏好優化&#xff0c;模型擁有1B參數&#xff0c;支持中英文。這是一個從頭訓練大語言模型的項目&#xff0c;包括預訓練、微調和…

hysAnalyser特色的TS流編輯、剪輯和轉存MP4功能說明

摘要 hysAnalyser 是一款特色的 MPEG-TS 數據分析工具&#xff0c;融合了常規TS文件的剪輯&#xff0c;轉存功能&#xff0c;可用于平常的視頻開發和測試。 本文詳細闡述了對MPEG-TS 流的節目ID&#xff0c;名稱&#xff0c;PID&#xff0c;時間戳&#xff0c;流類型&#xff…

前端[插件化]設計思想_Vue、React、Webpack、Vite、Element Plus、Ant Design

前端插件化設計思想旨在提升應用的可擴展性、可維護性和模塊化程度。這種思想不僅體現在框架&#xff08;如 Vue、React&#xff09;中&#xff0c;也廣泛應用于構建工具&#xff08;如 Webpack、Vite&#xff09;以及 UI 庫&#xff08;如 Element Plus、Ant Design&#xff0…

2025年高防IP與游戲盾深度對比:如何選擇最佳防護方案?

2025年&#xff0c;隨著DDoS攻擊規模的指數級增長和混合攻擊的常態化&#xff0c;高防IP與游戲盾成為企業網絡安全的核心選擇。然而&#xff0c;兩者在功能定位、技術實現及適用場景上存在顯著差異。本文結合最新行業實踐與技術趨勢&#xff0c;全面解析兩者的優劣&#xff0c;…

日志根因分析:Elastic Observability 的異常檢測與日志分類功能

作者&#xff1a;來自 Elastic Bahubali Shetti Elastic Observability 不僅提供日志聚合、指標分析、APM 和分布式追蹤&#xff0c;Elastic 的機器學習能力還能幫助分析問題的根因&#xff0c;讓你將時間專注于最重要的任務。 隨著越來越多的應用程序遷移到云端&#xff0c;收…

Linux火墻管理及優化

網絡環境配置 使用3個新的虛擬機【配置好軟件倉庫和網絡的】 F1 192.168.150.133 NAT F2 192.168.150.134 192.168.10.20 NAT HOST-ONLY 網絡適配僅主機 F3 192.168.10.30 HOST-ONLY 網絡適配僅主機 1 ~]# hostnamectl hostname double1.timinglee.org 【更…

java配置webSocket、前端使用uniapp連接

一、這個管理系統是基于若依框架&#xff0c;配置webSocKet的maven依賴 <!--websocket--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-websocket</artifactId></dependency> 二、配…

基于Yolov8+PyQT的老人摔倒識別系統源碼

概述 ??基于Yolov8PyQT的老人摔倒識別系統??&#xff0c;該系統通過深度學習算法實時檢測人體姿態&#xff0c;精準識別站立、摔倒中等3種狀態&#xff0c;為家庭或養老機構提供及時預警功能。 主要內容 ??完整可運行代碼?? 項目采用Yolov8目標檢測框架結合PyQT5開發…

Oracle 創建外部表

找別人要一下數據&#xff0c;但是他發來一個 xxx.csv 文件&#xff0c;怎么辦&#xff1f; 1、使用視圖化工具導入 使用導入工具導入&#xff0c;如 DBeaver&#xff0c;右擊要導入的表&#xff0c;選擇導入數據。 選擇對應的 csv 文件&#xff0c;下一步就行了&#xff08;如…

【華為OD- B卷 01 - 傳遞悄悄話 100分(python、java、c、c++、js)】

【華為OD- B卷 01 - 傳遞悄悄話 100分(python、java、c、c++、js)】 題目 給定一個二叉樹,每個節點上站一個人,節點數字表示父節點到該節點傳遞悄悄話需要花費的時間。 初始時,根節點所在位置的人有一個悄悄話想要傳遞給其他人,求二叉樹所有節點上的人都接收到悄悄話花…