Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
d0g0x01 committed Aug 15, 2023
1 parent 201328b commit 9a14439
Show file tree
Hide file tree
Showing 30 changed files with 42 additions and 2,220 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
# push:
# tags:
# - "*"
# - "v*"

env:
REGISTRY: ghcr.io
Expand All @@ -20,10 +20,8 @@ jobs:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
matrix:
include:
- dockerfile: ./Dockerfile
component: core
- dockerfile: deployments/kubehound/janusgraph/Dockerfile
image: janusgraph
image: kubegraph
permissions:
contents: read
packages: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: KubeHound Release
on:
push:
tags:
- "*"
- "v*"

permissions:
contents: read
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ bin/
*.so
*.dylib
*.jar
*.class
*.lst

# Test binary, built with `go test -c`
*.test
Expand Down
26 changes: 0 additions & 26 deletions Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions deployments/kubehound/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,6 @@ services:
container_name: ${COMPOSE_PROJECT_NAME}-graphdb
networks:
- kubenet
environment:
# Optimize for writes https://docs.janusgraph.org/operations/bulk-loading/
- janusgraph.ids.block-size=3000000
# Enforce strict schema constrains as per https://docs.janusgraph.org/configs/configuration-reference/#schema
- janusgraph.schema.constraints=true
- janusgraph.schema.default=none
# Bump content length of web-socket buffer to enable bulk insert queries
- gremlinserver.maxContentLength=2097152
# Bump evaluation timeout to support our large datasets
- gremlinserver.evaluationTimeout=240000
# enabling metrics only for jmxReporter
- gremlinserver.metrics.jmxReporter.enabled=true
- gremlinserver.metrics.consoleReporter.enabled=false
- gremlinserver.metrics.slf4jReporter.enabled=false
- gremlinserver.metrics.graphiteReporter.enabled=false
- gremlinserver.metrics.csvReporter.enabled=false
# Performance tweaks based on: https://www.sailpoint.com/blog/souping-up-the-gremlin/
- gremlinserver.gremlinPool=0 # will default to Runtime.availableProcessors()
- gremlinserver.threadPoolWorker=8 # should be 2x VCPU (TODO: can we set dynamically?)
# Custom SCRIPT plugin for DSL support
- gremlinserver.scriptEngines.gremlin-groovy.plugins[org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin].classImports[+]=com.datadog.ase.kubehound.KubeHoundTraversalSource
- gremlinserver.scriptEngines.gremlin-groovy.plugins[org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin].classImports[+]=com.datadog.ase.kubehound.EndpointExposure
- gremlinserver.scriptEngines.gremlin-groovy.plugins[org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin].files[+]=scripts/kubehound-dsl-init.groovy
healthcheck:
test: ["CMD", "bin/gremlin.sh", "-e", "scripts/remote-connect.groovy"]
interval: 60s
Expand Down
39 changes: 37 additions & 2 deletions deployments/kubehound/janusgraph/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM janusgraph/janusgraph:1.0.0-rc2
FROM janusgraph/janusgraph:1.0.0-20230627-064806.4d9975e
LABEL org.opencontainers.image.source="https://github.com/DataDog/kubehound/"

ENV JAVA_OPTIONS_FILE ${JANUS_HOME}/conf/jvm.options
# TODO TODO build DSL JAR FILE

# Add our initialization script for the database schema to the startup directory
# See https://github.com/JanusGraph/janusgraph-docker#initialization
COPY --chown=janusgraph:janusgraph kubehound-db-init.groovy /docker-entrypoint-initdb.d/
Expand All @@ -17,3 +18,37 @@ COPY --chown=janusgraph:janusgraph scripts/health-check.groovy ${JANUS_HOME}/scr

# DSL support
COPY --chown=janusgraph:janusgraph kubehound-dsl-init.groovy ${JANUS_HOME}/scripts/

# Set JVM configuration
ENV JAVA_OPTIONS_FILE ${JANUS_HOME}/conf/jvm.options

# Optimize for writes
ENV janusgraph.ids.block-size=3000000

# Enforce strict schema constraints as per https://docs.janusgraph.org/configs/configuration-reference/#schema
ENV janusgraph.schema.constraints=true
ENV janusgraph.schema.default=none

# Bump content length of web-socket buffer to enable bulk insert queries
ENV gremlinserver.maxContentLength=2097152

# Bump evaluation timeout
ENV gremlinserver.evaluationTimeout=240000

# Enable metrics only for jmxReporter
ENV gremlinserver.metrics.jmxReporter.enabled=true
ENV gremlinserver.metrics.consoleReporter.enabled=false
ENV gremlinserver.metrics.slf4jReporter.enabled=false
ENV gremlinserver.metrics.graphiteReporter.enabled=false
ENV gremlinserver.metrics.csvReporter.enabled=false

# Performance tweaks based on: https://www.sailpoint.com/blog/souping-up-the-gremlin/
# gremlinPool will default to Runtime.availableProcessors()
ENV gremlinserver.gremlinPool=0
# threadPoolWorker should be 2x VCPU (TODO: can we set dynamically?)
ENV gremlinserver.threadPoolWorker=8

# Custom SCRIPT plugin for DSL support
ENV gremlinserver.scriptEngines.gremlin-groovy.plugins[org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin].classImports[+]=com.datadog.ase.kubehound.KubeHoundTraversalSource
ENV gremlinserver.scriptEngines.gremlin-groovy.plugins[org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin].classImports[+]=com.datadog.ase.kubehound.EndpointExposure
ENV gremlinserver.scriptEngines.gremlin-groovy.plugins[org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin].files[+]=scripts/kubehound-dsl-init.groovy
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Loading

0 comments on commit 9a14439

Please sign in to comment.