diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index af0728f98..bea792472 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,18 +17,18 @@ jobs: docker-build-push: runs-on: ubuntu-latest strategy: - # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs - matrix: - include: - - dockerfile: deployments/kubehound/kubegraph/Dockerfile - image: graph - workdir: deployments/kubehound/kubegraph/ - - dockerfile: deployments/kubehound/notebook/Dockerfile - image: ui - workdir: deployments/kubehound/notebook/ - - dockerfile: deployments/kubehound/ingestor/Dockerfile - image: ingestor - workdir: . + # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs + matrix: + include: + - dockerfile: deployments/kubehound/graph/Dockerfile + image: graph + workdir: deployments/kubehound/graph/ + - dockerfile: deployments/kubehound/ui/Dockerfile + image: ui + workdir: deployments/kubehound/ui/ + - dockerfile: deployments/kubehound/kubehound/Dockerfile + image: kubehound + workdir: . permissions: contents: read packages: write @@ -97,8 +97,8 @@ jobs: build-args: | VERSION=${{ github.ref_name }} tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:${{ github.ref_name }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:${{ github.ref_name }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:latest - name: Build and push Docker image if: ${{ github.event_name == 'workflow_dispatch' }} @@ -111,5 +111,5 @@ jobs: build-args: | VERSION=${{ github.sha }} tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:snapshot-${{ github.sha }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:latest \ No newline at end of file + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:snapshot-${{ github.sha }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image }}:latest diff --git a/.gitignore b/.gitignore index a35cbfa6c..03f1188d0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ bin/ *.dll *.so *.dylib -*.jar *.class *.lst @@ -53,7 +52,7 @@ test/system/generator/generator scripts/collectors/ # java -deployments/kubehound/kubegraph/dsl/kubehound/target +deployments/kubehound/graph/dsl/kubehound/target # personal settings .vscode/settings.json @@ -100,4 +99,4 @@ override.tf.json # Ignore CLI configuration files .terraformrc -terraform.rc \ No newline at end of file +terraform.rc diff --git a/deployments/kubehound/docker-compose.dev.datadog.yaml b/deployments/kubehound/docker-compose.dev.datadog.yaml index 95cf6a7f3..790a95c40 100644 --- a/deployments/kubehound/docker-compose.dev.datadog.yaml +++ b/deployments/kubehound/docker-compose.dev.datadog.yaml @@ -1,6 +1,5 @@ services: datadog: - image: gcr.io/datadoghq/agent:7-jmx build: context: datadog dockerfile: Dockerfile diff --git a/deployments/kubehound/docker-compose.dev.graph.yaml b/deployments/kubehound/docker-compose.dev.graph.yaml index 184cefe30..a032f9b72 100644 --- a/deployments/kubehound/docker-compose.dev.graph.yaml +++ b/deployments/kubehound/docker-compose.dev.graph.yaml @@ -1,7 +1,7 @@ name: kubehound-dev services: kubegraph: - build: ./kubegraph/ + build: ./graph/ ports: - "127.0.0.1:8182:8182" - "127.0.0.1:8099:8099" diff --git a/deployments/kubehound/docker-compose.dev.ingestor.yaml b/deployments/kubehound/docker-compose.dev.ingestor.yaml index 6319176e6..96751b20d 100644 --- a/deployments/kubehound/docker-compose.dev.ingestor.yaml +++ b/deployments/kubehound/docker-compose.dev.ingestor.yaml @@ -3,7 +3,7 @@ services: grpc: build: context: ../../ - dockerfile: deployments/kubehound/ingestor/Dockerfile + dockerfile: deployments/kubehound/kubehound/Dockerfile restart: unless-stopped ports: - "127.0.0.1:9000:9000" diff --git a/deployments/kubehound/docker-compose.release.datadog.yaml b/deployments/kubehound/docker-compose.release.datadog.yaml index 07a91b41d..53042241f 100644 --- a/deployments/kubehound/docker-compose.release.datadog.yaml +++ b/deployments/kubehound/docker-compose.release.datadog.yaml @@ -1,9 +1,6 @@ services: datadog: image: gcr.io/datadoghq/agent:7-jmx - build: - context: datadog - dockerfile: Dockerfile restart: unless-stopped ports: - "127.0.0.1:8225:8125/UDP" diff --git a/deployments/kubehound/docker-compose.testing.yaml b/deployments/kubehound/docker-compose.testing.yaml index 294891c80..15e021cc3 100644 --- a/deployments/kubehound/docker-compose.testing.yaml +++ b/deployments/kubehound/docker-compose.testing.yaml @@ -5,7 +5,7 @@ services: - "127.0.0.1:27018:27017" kubegraph: - build: ./kubegraph/ + build: ./graph/ ports: - "127.0.0.1:8183:8182" - "127.0.0.1:8090:8099" diff --git a/deployments/kubehound/kubegraph/Dockerfile b/deployments/kubehound/graph/Dockerfile similarity index 100% rename from deployments/kubehound/kubegraph/Dockerfile rename to deployments/kubehound/graph/Dockerfile diff --git a/deployments/kubehound/kubegraph/conf/jvm.options b/deployments/kubehound/graph/conf/jvm.options similarity index 100% rename from deployments/kubehound/kubegraph/conf/jvm.options rename to deployments/kubehound/graph/conf/jvm.options diff --git a/deployments/kubehound/kubegraph/dsl/kubehound/README.md b/deployments/kubehound/graph/dsl/kubehound/README.md similarity index 100% rename from deployments/kubehound/kubegraph/dsl/kubehound/README.md rename to deployments/kubehound/graph/dsl/kubehound/README.md diff --git a/deployments/kubehound/kubegraph/dsl/kubehound/pom.xml b/deployments/kubehound/graph/dsl/kubehound/pom.xml similarity index 100% rename from deployments/kubehound/kubegraph/dsl/kubehound/pom.xml rename to deployments/kubehound/graph/dsl/kubehound/pom.xml diff --git a/deployments/kubehound/kubegraph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/EndpointExposure.java b/deployments/kubehound/graph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/EndpointExposure.java similarity index 100% rename from deployments/kubehound/kubegraph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/EndpointExposure.java rename to deployments/kubehound/graph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/EndpointExposure.java diff --git a/deployments/kubehound/kubegraph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalDsl.java b/deployments/kubehound/graph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalDsl.java similarity index 100% rename from deployments/kubehound/kubegraph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalDsl.java rename to deployments/kubehound/graph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalDsl.java diff --git a/deployments/kubehound/kubegraph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalSourceDsl.java b/deployments/kubehound/graph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalSourceDsl.java similarity index 100% rename from deployments/kubehound/kubegraph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalSourceDsl.java rename to deployments/kubehound/graph/dsl/kubehound/src/main/java/com/datadog/ase/kubehound/KubeHoundTraversalSourceDsl.java diff --git a/deployments/kubehound/kubegraph/dsl/kubehound/src/test/java/com/datadog/ase/kubehound/KubeHoundDslTest.java b/deployments/kubehound/graph/dsl/kubehound/src/test/java/com/datadog/ase/kubehound/KubeHoundDslTest.java similarity index 100% rename from deployments/kubehound/kubegraph/dsl/kubehound/src/test/java/com/datadog/ase/kubehound/KubeHoundDslTest.java rename to deployments/kubehound/graph/dsl/kubehound/src/test/java/com/datadog/ase/kubehound/KubeHoundDslTest.java diff --git a/deployments/kubehound/kubegraph/kubehound-db-init.groovy b/deployments/kubehound/graph/kubehound-db-init.groovy similarity index 100% rename from deployments/kubehound/kubegraph/kubehound-db-init.groovy rename to deployments/kubehound/graph/kubehound-db-init.groovy diff --git a/deployments/kubehound/kubegraph/lib/exporter-config.yaml b/deployments/kubehound/graph/lib/exporter-config.yaml similarity index 100% rename from deployments/kubehound/kubegraph/lib/exporter-config.yaml rename to deployments/kubehound/graph/lib/exporter-config.yaml diff --git a/deployments/kubehound/kubegraph/lib/jmx_prometheus_javaagent-0.18.0.jar b/deployments/kubehound/graph/lib/jmx_prometheus_javaagent-0.18.0.jar similarity index 100% rename from deployments/kubehound/kubegraph/lib/jmx_prometheus_javaagent-0.18.0.jar rename to deployments/kubehound/graph/lib/jmx_prometheus_javaagent-0.18.0.jar diff --git a/deployments/kubehound/kubegraph/scripts/health-check.groovy b/deployments/kubehound/graph/scripts/health-check.groovy similarity index 100% rename from deployments/kubehound/kubegraph/scripts/health-check.groovy rename to deployments/kubehound/graph/scripts/health-check.groovy diff --git a/deployments/kubehound/kubegraph/scripts/kubehound-dsl-init.groovy b/deployments/kubehound/graph/scripts/kubehound-dsl-init.groovy similarity index 100% rename from deployments/kubehound/kubegraph/scripts/kubehound-dsl-init.groovy rename to deployments/kubehound/graph/scripts/kubehound-dsl-init.groovy diff --git a/deployments/kubehound/ingestor/Dockerfile b/deployments/kubehound/kubehound/Dockerfile similarity index 100% rename from deployments/kubehound/ingestor/Dockerfile rename to deployments/kubehound/kubehound/Dockerfile diff --git a/deployments/kubehound/notebook/BlueTeam.ipynb b/deployments/kubehound/ui/BlueTeam.ipynb similarity index 100% rename from deployments/kubehound/notebook/BlueTeam.ipynb rename to deployments/kubehound/ui/BlueTeam.ipynb diff --git a/deployments/kubehound/notebook/Dockerfile b/deployments/kubehound/ui/Dockerfile similarity index 100% rename from deployments/kubehound/notebook/Dockerfile rename to deployments/kubehound/ui/Dockerfile diff --git a/deployments/kubehound/notebook/InitialSetup.ipynb b/deployments/kubehound/ui/InitialSetup.ipynb similarity index 100% rename from deployments/kubehound/notebook/InitialSetup.ipynb rename to deployments/kubehound/ui/InitialSetup.ipynb diff --git a/deployments/kubehound/notebook/KindCluster_Demo.ipynb b/deployments/kubehound/ui/KindCluster_Demo.ipynb similarity index 100% rename from deployments/kubehound/notebook/KindCluster_Demo.ipynb rename to deployments/kubehound/ui/KindCluster_Demo.ipynb diff --git a/deployments/kubehound/notebook/KubeHound.ipynb b/deployments/kubehound/ui/KubeHound.ipynb similarity index 100% rename from deployments/kubehound/notebook/KubeHound.ipynb rename to deployments/kubehound/ui/KubeHound.ipynb diff --git a/deployments/kubehound/notebook/KubehoundDSL_101.ipynb b/deployments/kubehound/ui/KubehoundDSL_101.ipynb similarity index 100% rename from deployments/kubehound/notebook/KubehoundDSL_101.ipynb rename to deployments/kubehound/ui/KubehoundDSL_101.ipynb diff --git a/deployments/kubehound/notebook/LowHangingFruit-ContainerEscape.ipynb b/deployments/kubehound/ui/LowHangingFruit-ContainerEscape.ipynb similarity index 100% rename from deployments/kubehound/notebook/LowHangingFruit-ContainerEscape.ipynb rename to deployments/kubehound/ui/LowHangingFruit-ContainerEscape.ipynb diff --git a/deployments/kubehound/notebook/LowHangingFruit-Endpoints.ipynb b/deployments/kubehound/ui/LowHangingFruit-Endpoints.ipynb similarity index 100% rename from deployments/kubehound/notebook/LowHangingFruit-Endpoints.ipynb rename to deployments/kubehound/ui/LowHangingFruit-Endpoints.ipynb diff --git a/deployments/kubehound/notebook/RedTeam.ipynb b/deployments/kubehound/ui/RedTeam.ipynb similarity index 100% rename from deployments/kubehound/notebook/RedTeam.ipynb rename to deployments/kubehound/ui/RedTeam.ipynb diff --git a/deployments/kubehound/notebook/SecurityPosture.ipynb b/deployments/kubehound/ui/SecurityPosture.ipynb similarity index 100% rename from deployments/kubehound/notebook/SecurityPosture.ipynb rename to deployments/kubehound/ui/SecurityPosture.ipynb diff --git a/deployments/kubehound/ui/build_notebooks.sh b/deployments/kubehound/ui/build_notebooks.sh new file mode 100644 index 000000000..92492f18f --- /dev/null +++ b/deployments/kubehound/ui/build_notebooks.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +source /tmp/venv/bin/activate + +init_setup_path="${find . -iname "initial_setup.ipynb}" + +for i in $(find . -iname "*.ipynb" -maxdepth 1); do nbmerge $init_setup_path "$i";done \ No newline at end of file diff --git a/deployments/kubehound/notebook/notebook.json b/deployments/kubehound/ui/notebook.json similarity index 100% rename from deployments/kubehound/notebook/notebook.json rename to deployments/kubehound/ui/notebook.json diff --git a/deployments/kubehound/notebook/service.sh b/deployments/kubehound/ui/service.sh similarity index 100% rename from deployments/kubehound/notebook/service.sh rename to deployments/kubehound/ui/service.sh diff --git a/deployments/kubehound/notebook/shared/shared.ipynb b/deployments/kubehound/ui/shared/shared.ipynb similarity index 100% rename from deployments/kubehound/notebook/shared/shared.ipynb rename to deployments/kubehound/ui/shared/shared.ipynb