k8s物料清单工具——KubeClarity

介绍

KubeClarity是一个用于检测和管理容器镜像和文件系统的软件清单(SBOM)和漏洞的工具。它扫描运行时的K8s集群和CI/CD流水线,以增强软件供应链安全性。

安装

添加 helm 仓库

bash 复制代码
helm repo add kubeclarity https://openclarity.github.io/kubeclarity

部署

bash 复制代码
helm install --create-namespace kubeclarity kubeclarity/kubeclarity -n kubeclarity

配置

kubeclarity 有一个配置文件,配置文件中记录了对整个 Kubernetes 集群扫描时所需要的 Job,内容如下:

yaml 复制代码
apiVersion: batch/v1
kind: Job
metadata:
  namespace: ""
  labels:
    app: kubeclarity-scanner
    sidecar.istio.io/inject: "false"
spec:
  backoffLimit: 0
  ttlSecondsAfterFinished: 300
  template:
    metadata:
      labels:
        app: kubeclarity-scanner
        sidecar.istio.io/inject: "false"
    spec:
      nodeSelector:
        kubernetes.io/arch: amd64
        kubernetes.io/os: linux
      restartPolicy: Never
      volumes:
      - name: tmp-volume
        emptyDir: {}
      securityContext:
        fsGroup: 1001
      containers:
      - name: vulnerability-scanner
        image: 'ghcr.io/openclarity/kubeclarity-runtime-k8s-scanner:latest'
        imagePullPolicy: Always
        volumeMounts:
          - mountPath: /tmp
            name: tmp-volume
        args:
        - scan
        - --log-level
        - warning
        env:
        - name: RESULT_SERVICE_ADDR
          value: kubeclarity-kubeclarity.kubeclarity:8888
        - name: SBOM_DB_ADDR
          value: kubeclarity-kubeclarity-sbom-db.kubeclarity:8080
        - name: ANALYZER_LIST
          value: syft gomod
        - name: ANALYZER_SCOPE
          value: squashed
        - name: SCANNERS_LIST
          value: grype
        - name: SCANNER_GRYPE_MODE
          value: REMOTE
        - name: REGISTRY_SKIP_VERIFY_TLS
          value: false
        - name: REGISTRY_USE_HTTP
          value: false
        - name: SCANNER_REMOTE_GRYPE_SERVER_ADDRESS
          value: kubeclarity-kubeclarity-grype-server.kubeclarity:9991
        - name: SCANNER_REMOTE_GRYPE_SERVER_TIMEOUT
          value: 2m
        securityContext:
          capabilities:
            drop:
            - ALL
          runAsNonRoot: true
          runAsGroup: 1001
          runAsUser: 1001
          privileged: false
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
        resources:
          limits:
            cpu: 1000m
            memory: 1000Mi
          requests:
            cpu: 50m
            memory: 50Mi
      - name: cis-docker-benchmark-scanner
        image: 'ghcr.io/openclarity/kubeclarity-cis-docker-benchmark-scanner:latest'
        imagePullPolicy: Always
        args:
        - scan
        - --log-level
        - warning
        env:
        - name: RESULT_SERVICE_ADDR
          value: kubeclarity-kubeclarity.kubeclarity:8888
        - name: TIMEOUT
          value: 2m
        - name: REGISTRY_SKIP_VERIFY_TLS
          value: false
        - name: REGISTRY_USE_HTTP
          value: false
        securityContext:
          capabilities:
            drop:
              - ALL
          runAsNonRoot: true
          runAsGroup: 1001
          runAsUser: 1001
          privileged: false
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
        resources:
          limits:
            cpu: 1000m
            memory: 1000Mi
          requests:
            cpu: 50m
            memory: 50Mi

使用

kubeclarity 的界面主要分为 Dashboard、Applications、Applications Resources、Package、Vulnerability 和 Scan 界面,用户唯一能操作的地方就是在 Scan 界面中点击扫描或者配置定时扫描任务。下面就为各个板块的截图:






相关推荐
KeyPan17 分钟前
【Ubuntu与Linux操作系统:十二、LAMP平台与PHP开发环境】
android·java·linux·运维·服务器·ubuntu
NightReader27 分钟前
Ubuntu 24.04蓝牙失效之复活
linux·运维·ubuntu
迃幵chen2 小时前
高可用虚拟IP-keepalived
linux·服务器·tcp/ip
苹果醋32 小时前
MySQL Binlog 同步工具go-mysql-transfer Lua模块使用说明
java·运维·spring boot·mysql·nginx
猫猫的小茶馆3 小时前
【IO编程】标准IO和文件IO的对比
linux·c语言·嵌入式硬件·microsoft·嵌入式实时数据库
学Linux的语莫3 小时前
k8s之pod生命周期
linux·运维·docker·容器·kubernetes
petunsecn3 小时前
Jenkins触发器--在其他项目执行后构建
运维·jenkins
福大大架构师每日一题3 小时前
1.1 k8s的介绍与核心对象概念
云原生·容器·kubernetes