Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(k8s): kbom support addons labels #5178

Merged

Conversation

chen-keinan
Copy link
Contributor

@chen-keinan chen-keinan commented Sep 13, 2023

Description

kbom support addons labels

Related issues

Checklist

Example with cilium installed on cluster:

trivy k8s cluster --format cyclonedx
{
  "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
  "bomFormat": "CycloneDX",
  "specVersion": "1.5",
  "serialNumber": "urn:uuid:eb120ca6-17fd-4098-9377-44e3f648ae44",
  "version": 1,
  "metadata": {
    "timestamp": "2023-09-13T13:50:10+00:00",
    "tools": [
      {
        "vendor": "aquasecurity",
        "name": "trivy",
        "version": "dev"
      }
    ],
    "component": {
      "bom-ref": "689cd793-eb8b-4799-9c19-734b39daaabd",
      "type": "platform",
      "name": "k8s.io/kubernetes",
      "version": "1.21.1",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "kind-kind"
        }
      ]
    }
  },
  "components": [
    {
      "bom-ref": "0fed1359-bb7d-4843-8a3b-cb0a1ceaaaf8",
      "type": "application",
      "name": "k8s.io/apiserver",
      "version": "1.21.1",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "kube-apiserver-kind-control-plane"
        },
        {
          "name": "aquasecurity:trivy:resource:Type",
          "value": "ControlPlane"
        }
      ]
    },
    {
      "bom-ref": "321d33be-4fbd-492c-b633-e994c51fabfe",
      "type": "application",
      "name": "kindnet",
      "version": "20210326-1e038dc5",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "kindnet-bpmlx"
        }
      ]
    },
    {
      "bom-ref": "5bfde425-37e4-411d-94e5-4a19596838e1",
      "type": "application",
      "name": "kube-dns",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "coredns-558bd4d5db-9t9k9"
        }
      ]
    },
    {
      "bom-ref": "70143948-df4e-403e-8736-bb513160bd90",
      "type": "application",
      "name": "node-core-components",
      "properties": [
        {
          "name": "aquasecurity:trivy:Class",
          "value": "lang-pkgs"
        },
        {
          "name": "aquasecurity:trivy:Type",
          "value": "golang"
        }
      ]
    },
    {
      "bom-ref": "8b9442ec-17ea-418a-a340-327e0185cc08",
      "type": "application",
      "name": "k8s.io/kube-proxy",
      "version": "1.21.1",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "kube-proxy-2skt9"
        }
      ]
    },
    {
      "bom-ref": "91226cf9-fcf5-497f-b02c-4c132feadd63",
      "type": "application",
      "name": "k8s.io/kube-scheduler",
      "version": "1.21.1",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "kube-scheduler-kind-control-plane"
        },
        {
          "name": "aquasecurity:trivy:resource:Type",
          "value": "ControlPlane"
        }
      ]
    },
    {
      "bom-ref": "a146bc06-d3dc-4080-a5a8-e2e40efda5ee",
      "type": "platform",
      "name": "kind-control-plane",
      "properties": [
        {
          "name": "aquasecurity:trivy:Architecture",
          "value": "arm64"
        },
        {
          "name": "aquasecurity:trivy:HostName",
          "value": "kind-control-plane"
        },
        {
          "name": "aquasecurity:trivy:KernelVersion",
          "value": "6.4.15-200.fc38.aarch64"
        },
        {
          "name": "aquasecurity:trivy:NodeRole",
          "value": "master"
        },
        {
          "name": "aquasecurity:trivy:OperatingSystem",
          "value": "linux"
        },
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "kind-control-plane"
        },
        {
          "name": "aquasecurity:trivy:resource:Type",
          "value": "node"
        }
      ]
    },
    {
      "bom-ref": "a6a68f70-af59-4384-81e5-a0ebbd51c312",
      "type": "operating-system",
      "name": "ubuntu",
      "version": "21.04",
      "properties": [
        {
          "name": "aquasecurity:trivy:Class",
          "value": "os-pkgs"
        },
        {
          "name": "aquasecurity:trivy:Type",
          "value": "ubuntu"
        }
      ]
    },
    {
      "bom-ref": "cb9586d3-97d1-466b-a1a1-e196e3279ad1",
      "type": "application",
      "name": "cilium",
      "version": "sha256:6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "cilium-4pz6w"
        }
      ]
    },
    {
      "bom-ref": "d8b5d876-2b98-4cb1-8da1-56d4771dcef4",
      "type": "application",
      "name": "k8s.io/controller-manager",
      "version": "1.21.1",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "kube-controller-manager-kind-control-plane"
        },
        {
          "name": "aquasecurity:trivy:resource:Type",
          "value": "ControlPlane"
        }
      ]
    },
    {
      "bom-ref": "e838f8af-b9d1-472c-a772-e738041644c7",
      "type": "application",
      "name": "go.etcd.io/etcd/v3",
      "version": "3.4.13-0",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "etcd-kind-control-plane"
        },
        {
          "name": "aquasecurity:trivy:resource:Type",
          "value": "ControlPlane"
        }
      ]
    },
    {
      "bom-ref": "f8793779-efce-4f50-b5ff-3d7407d131fa",
      "type": "application",
      "name": "kube-dns",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "coredns-558bd4d5db-2qckh"
        }
      ]
    },
    {
      "bom-ref": "pkg:golang/github.com%2Fcontainerd%[email protected]",
      "type": "application",
      "name": "github.com/containerd/containerd",
      "version": "1.5.2",
      "purl": "pkg:golang/github.com%2Fcontainerd%[email protected]",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "github.com/containerd/containerd"
        },
        {
          "name": "aquasecurity:trivy:resource:Type",
          "value": "node"
        }
      ]
    },
    {
      "bom-ref": "pkg:golang/k8s.io%[email protected]",
      "type": "application",
      "name": "k8s.io/kubelet",
      "version": "1.21.1",
      "purl": "pkg:golang/k8s.io%[email protected]",
      "properties": [
        {
          "name": "aquasecurity:trivy:resource:Name",
          "value": "k8s.io/kubelet"
        },
        {
          "name": "aquasecurity:trivy:resource:Type",
          "value": "node"
        }
      ]
    },
    {
      "bom-ref": "pkg:oci/cilium@sha256%3A6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35?arch=\u0026repository_url=quay.io%2Fcilium%2Fcilium",
      "type": "container",
      "name": "quay.io/cilium/cilium",
      "version": "sha256:6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35",
      "purl": "pkg:oci/cilium@sha256%3A6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35?arch=\u0026repository_url=quay.io%2Fcilium%2Fcilium",
      "properties": [
        {
          "name": "aquasecurity:trivy:PkgID",
          "value": "quay.io/cilium/cilium:sha256:6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35"
        },
        {
          "name": "aquasecurity:trivy:PkgType",
          "value": "oci"
        }
      ]
    },
    {
      "bom-ref": "pkg:oci/etcd@sha256%3A05b738aa1bc6355db8a2ee8639f3631b908286e43f584a3d2ee0c472de033c28?arch=\u0026repository_url=k8s.gcr.io%2Fetcd",
      "type": "container",
      "name": "k8s.gcr.io/etcd",
      "version": "sha256:05b738aa1bc6355db8a2ee8639f3631b908286e43f584a3d2ee0c472de033c28",
      "purl": "pkg:oci/etcd@sha256%3A05b738aa1bc6355db8a2ee8639f3631b908286e43f584a3d2ee0c472de033c28?arch=\u0026repository_url=k8s.gcr.io%2Fetcd",
      "properties": [
        {
          "name": "aquasecurity:trivy:PkgID",
          "value": "k8s.gcr.io/etcd:3.4.13-0"
        },
        {
          "name": "aquasecurity:trivy:PkgType",
          "value": "oci"
        }
      ]
    },
    {
      "bom-ref": "pkg:oci/kindnetd@sha256%3Af37b7c809e5dcc2090371f933f7acb726bb1bffd5652980d2e1d7e2eff5cd301?arch=\u0026repository_url=index.docker.io%2Fkindest%2Fkindnetd",
      "type": "container",
      "name": "index.docker.io/kindest/kindnetd",
      "version": "sha256:f37b7c809e5dcc2090371f933f7acb726bb1bffd5652980d2e1d7e2eff5cd301",
      "purl": "pkg:oci/kindnetd@sha256%3Af37b7c809e5dcc2090371f933f7acb726bb1bffd5652980d2e1d7e2eff5cd301?arch=\u0026repository_url=index.docker.io%2Fkindest%2Fkindnetd",
      "properties": [
        {
          "name": "aquasecurity:trivy:PkgID",
          "value": "index.docker.io/kindest/kindnetd:20210326-1e038dc5"
        },
        {
          "name": "aquasecurity:trivy:PkgType",
          "value": "oci"
        }
      ]
    },
    {
      "bom-ref": "pkg:oci/kube-apiserver@sha256%3A18e61c783b41758dd391ab901366ec3546b26fae00eef7e223d1f94da808e02f?arch=\u0026repository_url=k8s.gcr.io%2Fkube-apiserver",
      "type": "container",
      "name": "k8s.gcr.io/kube-apiserver",
      "version": "sha256:18e61c783b41758dd391ab901366ec3546b26fae00eef7e223d1f94da808e02f",
      "purl": "pkg:oci/kube-apiserver@sha256%3A18e61c783b41758dd391ab901366ec3546b26fae00eef7e223d1f94da808e02f?arch=\u0026repository_url=k8s.gcr.io%2Fkube-apiserver",
      "properties": [
        {
          "name": "aquasecurity:trivy:PkgID",
          "value": "k8s.gcr.io/kube-apiserver:1.21.1"
        },
        {
          "name": "aquasecurity:trivy:PkgType",
          "value": "oci"
        }
      ]
    },
    {
      "bom-ref": "pkg:oci/kube-controller-manager@sha256%3A0c6dccae49de8003ee4fa06db04a9f13bb46cbaad03977e6baa21174f2dba2fc?arch=\u0026repository_url=k8s.gcr.io%2Fkube-controller-manager",
      "type": "container",
      "name": "k8s.gcr.io/kube-controller-manager",
      "version": "sha256:0c6dccae49de8003ee4fa06db04a9f13bb46cbaad03977e6baa21174f2dba2fc",
      "purl": "pkg:oci/kube-controller-manager@sha256%3A0c6dccae49de8003ee4fa06db04a9f13bb46cbaad03977e6baa21174f2dba2fc?arch=\u0026repository_url=k8s.gcr.io%2Fkube-controller-manager",
      "properties": [
        {
          "name": "aquasecurity:trivy:PkgID",
          "value": "k8s.gcr.io/kube-controller-manager:1.21.1"
        },
        {
          "name": "aquasecurity:trivy:PkgType",
          "value": "oci"
        }
      ]
    },
    {
      "bom-ref": "pkg:oci/kube-proxy@sha256%3A4bbef4ca108cdc3b99fe23d487fa4fca933a62c4fc720626a3706df9cef63b21?arch=\u0026repository_url=k8s.gcr.io%2Fkube-proxy",
      "type": "container",
      "name": "k8s.gcr.io/kube-proxy",
      "version": "sha256:4bbef4ca108cdc3b99fe23d487fa4fca933a62c4fc720626a3706df9cef63b21",
      "purl": "pkg:oci/kube-proxy@sha256%3A4bbef4ca108cdc3b99fe23d487fa4fca933a62c4fc720626a3706df9cef63b21?arch=\u0026repository_url=k8s.gcr.io%2Fkube-proxy",
      "properties": [
        {
          "name": "aquasecurity:trivy:PkgID",
          "value": "k8s.gcr.io/kube-proxy:1.21.1"
        },
        {
          "name": "aquasecurity:trivy:PkgType",
          "value": "oci"
        }
      ]
    },
    {
      "bom-ref": "pkg:oci/kube-scheduler@sha256%3A8c783dd2520887cc8e7908489ffc9f356c82436ba0411d554237a0b9632c9b87?arch=\u0026repository_url=k8s.gcr.io%2Fkube-scheduler",
      "type": "container",
      "name": "k8s.gcr.io/kube-scheduler",
      "version": "sha256:8c783dd2520887cc8e7908489ffc9f356c82436ba0411d554237a0b9632c9b87",
      "purl": "pkg:oci/kube-scheduler@sha256%3A8c783dd2520887cc8e7908489ffc9f356c82436ba0411d554237a0b9632c9b87?arch=\u0026repository_url=k8s.gcr.io%2Fkube-scheduler",
      "properties": [
        {
          "name": "aquasecurity:trivy:PkgID",
          "value": "k8s.gcr.io/kube-scheduler:1.21.1"
        },
        {
          "name": "aquasecurity:trivy:PkgType",
          "value": "oci"
        }
      ]
    }
  ],
  "dependencies": [
    {
      "ref": "0fed1359-bb7d-4843-8a3b-cb0a1ceaaaf8",
      "dependsOn": [
        "pkg:oci/kube-apiserver@sha256%3A18e61c783b41758dd391ab901366ec3546b26fae00eef7e223d1f94da808e02f?arch=\u0026repository_url=k8s.gcr.io%2Fkube-apiserver"
      ]
    },
    {
      "ref": "321d33be-4fbd-492c-b633-e994c51fabfe",
      "dependsOn": [
        "pkg:oci/kindnetd@sha256%3Af37b7c809e5dcc2090371f933f7acb726bb1bffd5652980d2e1d7e2eff5cd301?arch=\u0026repository_url=index.docker.io%2Fkindest%2Fkindnetd"
      ]
    },
    {
      "ref": "5bfde425-37e4-411d-94e5-4a19596838e1",
      "dependsOn": []
    },
    {
      "ref": "689cd793-eb8b-4799-9c19-734b39daaabd",
      "dependsOn": [
        "0fed1359-bb7d-4843-8a3b-cb0a1ceaaaf8",
        "321d33be-4fbd-492c-b633-e994c51fabfe",
        "5bfde425-37e4-411d-94e5-4a19596838e1",
        "8b9442ec-17ea-418a-a340-327e0185cc08",
        "91226cf9-fcf5-497f-b02c-4c132feadd63",
        "a146bc06-d3dc-4080-a5a8-e2e40efda5ee",
        "cb9586d3-97d1-466b-a1a1-e196e3279ad1",
        "d8b5d876-2b98-4cb1-8da1-56d4771dcef4",
        "e838f8af-b9d1-472c-a772-e738041644c7",
        "f8793779-efce-4f50-b5ff-3d7407d131fa"
      ]
    },
    {
      "ref": "70143948-df4e-403e-8736-bb513160bd90",
      "dependsOn": [
        "pkg:golang/github.com%2Fcontainerd%[email protected]",
        "pkg:golang/k8s.io%[email protected]"
      ]
    },
    {
      "ref": "8b9442ec-17ea-418a-a340-327e0185cc08",
      "dependsOn": [
        "pkg:oci/kube-proxy@sha256%3A4bbef4ca108cdc3b99fe23d487fa4fca933a62c4fc720626a3706df9cef63b21?arch=\u0026repository_url=k8s.gcr.io%2Fkube-proxy"
      ]
    },
    {
      "ref": "91226cf9-fcf5-497f-b02c-4c132feadd63",
      "dependsOn": [
        "pkg:oci/kube-scheduler@sha256%3A8c783dd2520887cc8e7908489ffc9f356c82436ba0411d554237a0b9632c9b87?arch=\u0026repository_url=k8s.gcr.io%2Fkube-scheduler"
      ]
    },
    {
      "ref": "a146bc06-d3dc-4080-a5a8-e2e40efda5ee",
      "dependsOn": [
        "70143948-df4e-403e-8736-bb513160bd90",
        "a6a68f70-af59-4384-81e5-a0ebbd51c312"
      ]
    },
    {
      "ref": "a6a68f70-af59-4384-81e5-a0ebbd51c312",
      "dependsOn": []
    },
    {
      "ref": "cb9586d3-97d1-466b-a1a1-e196e3279ad1",
      "dependsOn": [
        "pkg:oci/cilium@sha256%3A6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35?arch=\u0026repository_url=quay.io%2Fcilium%2Fcilium"
      ]
    },
    {
      "ref": "d8b5d876-2b98-4cb1-8da1-56d4771dcef4",
      "dependsOn": [
        "pkg:oci/kube-controller-manager@sha256%3A0c6dccae49de8003ee4fa06db04a9f13bb46cbaad03977e6baa21174f2dba2fc?arch=\u0026repository_url=k8s.gcr.io%2Fkube-controller-manager"
      ]
    },
    {
      "ref": "e838f8af-b9d1-472c-a772-e738041644c7",
      "dependsOn": [
        "pkg:oci/etcd@sha256%3A05b738aa1bc6355db8a2ee8639f3631b908286e43f584a3d2ee0c472de033c28?arch=\u0026repository_url=k8s.gcr.io%2Fetcd"
      ]
    },
    {
      "ref": "f8793779-efce-4f50-b5ff-3d7407d131fa",
      "dependsOn": []
    },
    {
      "ref": "pkg:golang/github.com%2Fcontainerd%[email protected]",
      "dependsOn": []
    },
    {
      "ref": "pkg:golang/k8s.io%[email protected]",
      "dependsOn": []
    },
    {
      "ref": "pkg:oci/cilium@sha256%3A6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35?arch=\u0026repository_url=quay.io%2Fcilium%2Fcilium",
      "dependsOn": []
    },
    {
      "ref": "pkg:oci/etcd@sha256%3A05b738aa1bc6355db8a2ee8639f3631b908286e43f584a3d2ee0c472de033c28?arch=\u0026repository_url=k8s.gcr.io%2Fetcd",
      "dependsOn": []
    },
    {
      "ref": "pkg:oci/kindnetd@sha256%3Af37b7c809e5dcc2090371f933f7acb726bb1bffd5652980d2e1d7e2eff5cd301?arch=\u0026repository_url=index.docker.io%2Fkindest%2Fkindnetd",
      "dependsOn": []
    },
    {
      "ref": "pkg:oci/kube-apiserver@sha256%3A18e61c783b41758dd391ab901366ec3546b26fae00eef7e223d1f94da808e02f?arch=\u0026repository_url=k8s.gcr.io%2Fkube-apiserver",
      "dependsOn": []
    },
    {
      "ref": "pkg:oci/kube-controller-manager@sha256%3A0c6dccae49de8003ee4fa06db04a9f13bb46cbaad03977e6baa21174f2dba2fc?arch=\u0026repository_url=k8s.gcr.io%2Fkube-controller-manager",
      "dependsOn": []
    },
    {
      "ref": "pkg:oci/kube-proxy@sha256%3A4bbef4ca108cdc3b99fe23d487fa4fca933a62c4fc720626a3706df9cef63b21?arch=\u0026repository_url=k8s.gcr.io%2Fkube-proxy",
      "dependsOn": []
    },
    {
      "ref": "pkg:oci/kube-scheduler@sha256%3A8c783dd2520887cc8e7908489ffc9f356c82436ba0411d554237a0b9632c9b87?arch=\u0026repository_url=k8s.gcr.io%2Fkube-scheduler",
      "dependsOn": []
    }
  ],
  "vulnerabilities": []
}

@chen-keinan chen-keinan marked this pull request as draft September 13, 2023 12:42
@chen-keinan chen-keinan marked this pull request as ready for review September 13, 2023 13:50
@chen-keinan chen-keinan changed the title feat: kbom support addons labels fix(k8s): kbom support addons labels Sep 14, 2023
@knqyf263 knqyf263 added this pull request to the merge queue Sep 14, 2023
Merged via the queue into aquasecurity:main with commit ecee794 Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

include k8s add-ons in kbom
2 participants