Skip to content

Commit cffc8bf

Browse files
author
SOVEREIGN
committed
Initial commit
0 parents  commit cffc8bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5056
-0
lines changed

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/src/rtkcsm*
2+
/src/cpu_profile*.pprof
3+
/src/graphs.json
4+
/src/graphs/
5+
/src/static/*.js
6+
/src/static/*.js.map
7+
/src/web/node_modules/**
8+
/src/web/dist/**
9+
**/.DS_Store
10+
**.csv
11+
**/.gitignore
12+
**/.git

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.DS_Store
2+
3+
/data/
4+
/src/graphs/
5+
/src/graphs.json
6+
cpu_profile*.pprof
7+
/src/rtkcsm*
8+
*.csv
9+
__debug_bin*
10+
11+
# Web
12+
/src/web/node_modules
13+
/src/web/dist/
14+
/src/static/*.js
15+
/src/static/*.js.map

Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
FROM node AS web-builder
3+
4+
RUN npm install -g typescript rollup
5+
6+
COPY /src/web/package.json /src/web/package.json
7+
COPY /src/web/package-lock.json /src/web/package-lock.json
8+
COPY /src/web/rollup.config.js /src/web/rollup.config.js
9+
COPY /src/web/tsconfig.json /src/web/tsconfig.json
10+
11+
WORKDIR /src/web/
12+
RUN npm install
13+
14+
COPY /src/web/src/ /src/web/src/
15+
RUN tsc && rollup -c
16+
17+
COPY /src/static/ /src/static/
18+
19+
FROM golang:alpine AS builder
20+
21+
COPY --exclude=/src/web/* /src/ /src/
22+
COPY --from=web-builder /src/static/ /src/static/
23+
WORKDIR /src/
24+
25+
ARG TARGETOS TARGETARCH
26+
27+
RUN --mount=type=cache,target=/root/.cache/ GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /rtkcsm .
28+
29+
FROM golang:alpine AS passwd
30+
31+
RUN echo "nobody:x:65534:65534:Nobody:/:" > /etc_passwd
32+
33+
FROM scratch
34+
35+
COPY --from=passwd /etc_passwd /etc/passwd
36+
COPY --from=builder /rtkcsm /rtkcsm
37+
38+
ENV GIN_MODE=release
39+
WORKDIR /
40+
41+
USER nobody
42+
ENV PATH="/"
43+
44+
ENTRYPOINT ["rtkcsm"]
45+
CMD ["--reader", "suricata", "--transport", "tcp", "--listen", ":9000", "--server", ":8080"]

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Usage
2+
3+
### Command Line Options
4+
5+
**Ingesting data**
6+
7+
You have two options for getting the data in. Either via file or TCP server:
8+
- `--file /my/file` File path of your log file
9+
- `--listen 0.0.0.0:9000` TCP Server address that can be connected to using Tenzir's [TCP client connector](https://docs.tenzir.com/connectors/tcp)
10+
11+
In addition, you also need to supply the `--transport TYPE` option with either:
12+
13+
- `file` when using the `--file` option (**default**)
14+
- `tcp` when using the `--listen` option
15+
16+
17+
Using the TCP server has the advantage of enabling data streaming, thereby generating graphs in real-time.
18+
19+
**Data ingest type**
20+
21+
You can choose between different data types of your ingested data using the `--reader TYPE` option:
22+
- `zeek`
23+
- `suricata`
24+
- `ocsf`
25+
26+
27+
**Web UI**
28+
29+
By default the RT-KCSM does not expose the web interface. To view it, you must specify the address of the HTTP server:
30+
- `--server 0.0.0.0:8080`
31+
32+
You can visit the web UI at [http://localhost:8080/web/](http://localhost:8080/web/)
33+
34+
For configuring high-risks target/hosts go to the `Configure Hosts` section.
35+
36+
**Example using Docker**
37+
38+
Default options for Docker container.
39+
```
40+
docker run git.informatik.uni-hamburg.de:4567/iss/projects/sovereign/rt-kcsm/open-source:latest --reader suricata --transport tcp --listen :9000 --server :8080
41+
```

docker-compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
rtkcsm:
3+
build: .
4+
image: git.informatik.uni-hamburg.de:4567/iss/projects/sovereign/rt-kcsm/open-source:latest
5+
restart: always
6+
7+
ports:
8+
- 8080:8080 # Web interface
9+
- 9000:9000 # TCP ingest port for Tenzir

0 commit comments

Comments
 (0)