https://github.com/echoCTF/docker-event-action
Monitor docker events and perform an action on a given event type
https://github.com/echoCTF/docker-event-action
Last synced: about 1 year ago
JSON representation
Monitor docker events and perform an action on a given event type
- Host: GitHub
- URL: https://github.com/echoCTF/docker-event-action
- Owner: echoCTF
- Created: 2022-01-15T22:54:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-16T09:36:54.000Z (almost 4 years ago)
- Last Synced: 2024-11-05T23:41:22.612Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker event action
Monitor docker events and perform an action on a given event.
The current daemon can run both on your docker server or a remote one (depending on the desired actions).
The examples included assume that the application will run on the host that is responsible for running the docker containers. For each container that gets started, we grab the namespace ID and inject a set of iptables rules into it. This allows us to run iptables commands without giving the containers any extra privileges.
What scripts are executed and how is left up to the user, this very simple nodejs script can be modified according to your needs 😃
## Quick 'n' Dirty install
```bash
mv docker-event-action/ /opt/
cd /opt/docker-event-action/
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
install -o root -m 0555 ctables /usr/local/bin/ctables
npm install
npm install -g pm2
pm2 startup
pm2 start /opt/docker-event-action/docker-events.js
```