summaryrefslogtreecommitdiff
path: root/clean-log.sh
diff options
context:
space:
mode:
Diffstat (limited to 'clean-log.sh')
-rwxr-xr-xclean-log.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/clean-log.sh b/clean-log.sh
new file mode 100755
index 0000000..17ca209
--- /dev/null
+++ b/clean-log.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Use this sed script to clean your logs before
+# pasting it publicly
+
+# Usage:
+# Replace `your_username` and `your_domain` in this script, then:
+#
+# ./clean-log.sh LOGFILE
+
+# Todo:
+# - IPs (should be already cleaned by rsyslog)
+# - Browser user agents
+# - Generate this script from leap_cli
+
+
+sed -r '
+# Clean all email addresses
+s/((\w|[.])+)@((\w|[.])+)/<EMAIL REDACTED>/g
+
+# Replace username
+s/your_username/<USERNAME_REDACTED>/g
+
+#Replace domain
+s/your_domain/<DOMAIN_REDACTED>/g
+' "$1"