ipabusedb-docker-reporter: pin docker CLI image, add make push, fix stale names
Pin the docker:cli source to 29.9.3 plus its manifest list digest, tag the image as git.eeqj.de/sneak/ipabusedb-docker-reporter with the date and latest, add a push target, and rename the remaining ipabusedb-docker-ssh references in the README and package doc.
This commit is contained in:
1 parent
1aa7d84401
commit
bce9d01142
4 files changed
+29
-14
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# ipabusedb-docker-ssh
|
||||
# ipabusedb-docker-reporter
|
||||
|
||||
Reads the logs of a dockerised sshd with `docker logs -t`, extracts
|
||||
brute-force / invalid-user login attempts, and emits a CSV in the format
|
||||
@@ -52,14 +52,14 @@ Flags:
|
||||
```
|
||||
$ make build
|
||||
$ export DOCKER_CONTAINER_NAME=sshd IPABUSEDB_API_KEY=...
|
||||
$ ./ipabusedb-docker-ssh --since 24h -o reports.csv
|
||||
$ ./ipabusedb-docker-ssh --since 24h --submit
|
||||
$ ./ipabusedb-docker-reporter --since 24h -o reports.csv
|
||||
$ ./ipabusedb-docker-reporter --since 24h --submit
|
||||
```
|
||||
|
||||
Submitting manually with curl instead of `--submit`:
|
||||
|
||||
```
|
||||
$ ./ipabusedb-docker-ssh --since 24h > reports.csv && curl https://api.abuseipdb.com/api/v2/bulk-report -F csv=@reports.csv -H "Key: $IPABUSEDB_API_KEY"
|
||||
$ ./ipabusedb-docker-reporter --since 24h > reports.csv && curl https://api.abuseipdb.com/api/v2/bulk-report -F csv=@reports.csv -H "Key: $IPABUSEDB_API_KEY"
|
||||
```
|
||||
|
||||
## Running as a container
|
||||
@@ -68,8 +68,9 @@ The `Dockerfile` builds on `git.eeqj.de/sneak/baseimage` and installs the
|
||||
program as a runit service (`sv/ipabusedb-docker-reporter/run`) that
|
||||
sleeps `INTERVAL` seconds, then runs the reporter with
|
||||
`--since ${INTERVAL}s --submit`, and repeats. The docker CLI is copied in
|
||||
from the `docker:cli` image so the program can read logs through the
|
||||
host's docker socket.
|
||||
from the official `docker` CLI image (pinned by tag and digest in the
|
||||
`Dockerfile`) so the program can read logs through the host's docker
|
||||
socket.
|
||||
|
||||
| Variable | Purpose |
|
||||
| ----------------------- | -------------------------------------------------- |
|
||||
@@ -77,14 +78,20 @@ host's docker socket.
|
||||
| `IPABUSEDB_API_KEY` | AbuseIPDB API key (required) |
|
||||
| `INTERVAL` | seconds between runs, and the report window (1200) |
|
||||
|
||||
`make image` builds the image, tagged locally as
|
||||
`ipabusedb-docker-reporter` and as
|
||||
`git.eeqj.de/sneak/ipabusedb-docker-reporter` with today's date and
|
||||
`latest`. `make push` builds and pushes both registry tags (log in once
|
||||
with `docker login git.eeqj.de`).
|
||||
|
||||
```
|
||||
$ make image
|
||||
$ make push
|
||||
$ docker run -d --restart unless-stopped \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-e DOCKER_CONTAINER_NAME=sshd \
|
||||
-e IPABUSEDB_API_KEY=... \
|
||||
-e INTERVAL=1200 \
|
||||
ipabusedb-docker-reporter
|
||||
git.eeqj.de/sneak/ipabusedb-docker-reporter:latest
|
||||
```
|
||||
|
||||
Each run's CSV and the AbuseIPDB response go to the container log. If a
|
||||
|
||||
Reference in new issue
Block a user