riotkit-org / riotkit-do

RKD - RiotKit DO. Task executor - balance between Makefile and Gradle. Written in Python. Powerful tool for every DevOps. Automates production tasks as well as local development tasks
Apache License 2.0
10 stars 2 forks source link

Production: Audit logs #10

Open blackandred opened 4 years ago

blackandred commented 4 years ago

The idea: I think that on production it would be nice to have audit logs of all operations performed in RKD (when eg. RKD_AUDIT_LOG=true).

Why?

Proposed solution: When RKD_AUDIT_LOG=true in .env is present, then log every command to a log file eg. .rkd/audit-log-2020-05-01.log in a format, example:

[Y-m-d H:i:s] [commit] [SUDO_USER if any else current user] command
[2020-05-01 08:41:31] [9f990a2] [tech.admin] rkd :harbor:service:up --name iwa_ait_api --strategy rolling
[2020-05-01 08:45:00] [9f990a2] [tech.admin] rkd :harbor:gateway:reload :harbor:ssl:reload

Potential issues: Passwords leaking - user must be aware of the risk, documentation should inform about this

blackandred commented 4 years ago

In next stages audit log can also catch events of started/stopped/killed/failed containers (can be handled by Harbor - not as part of RKD of course)

blackandred commented 4 years ago

Idea: An output of each task could be always logged in to files (file per task per execution time for example) when audit log is enabled

blackandred commented 4 years ago

Partially implemented for RKD 1.0, moving to RKD 1.1, cannot afford for so many tasks to release.