| 1 |
# Description |
| 2 |
A parser that will search for unauthorized (401) status code in a log file that gotify is outputting its stdout to. |
| 3 |
From testing it seems gotify returns a 401 for unknown user, bad password, and incorrect tokens. There is no way to |
| 4 |
determine which is which so this parser will only search for 401 status code. |
| 5 |
|
| 6 |
# HOW TO INSTALL PROPERLY |
| 7 |
- REQUIRED - example `acquis.yaml` entry - The `type` **MUST** be exactly as shown here or the parser will never be successful. |
| 8 |
|
| 9 |
```yaml |
| 10 |
filenames: |
| 11 |
- /path/to/gotify.log |
| 12 |
labels: |
| 13 |
type: gotify |
| 14 |
``` |
| 15 |
:exclamation: The `type` **MUST** be `gotify` :exclamation: |
| 16 |
|
| 17 |
# Statics |
| 18 |
- The IP is the only data grabbed from the log and is stored in `evt.Parsed.source_ip` and `evt.Meta.source_ip` |
| 19 |
|
| 20 |
# How to - Have Gotify (Docker) log to a file |
| 21 |
- You must create your own `Dockerfile` and then build it. Example Dockerfile as follows. |
| 22 |
```Dockerfile |
| 23 |
FROM gotify/server |
| 24 |
ENTRYPOINT /bin/bash -c '/app/gotify-app | tee /app/data/gotify.log' |
| 25 |
``` |
| 26 |
- Build the image `sudo docker build -t <TAG NAME>` |
| 27 |
- Example `<TAG NAME>` - server/gotify:logger |
| 28 |
- Now make a docker-compose file to use the image, the log file will end up in the `gotify_data` directory |
| 29 |
```docker |
| 30 |
gotify: |
| 31 |
image: gotify/server:logger |
| 32 |
container_name: gotify |
| 33 |
restart: always |
| 34 |
ports: |
| 35 |
- 8080:80 |
| 36 |
volumes: |
| 37 |
- "./gotify_data:/app/data" |
| 38 |
|
| 39 |
``` |