the-bastion/bin/helper
Stéphane Lesimple a479810d83
feat: revamp logs
All connections and plugin executions emit two logs, an 'open' and
a 'close' log. We now add all the details of the connection to
the 'close' logs, those that were previously only available in the
corresponding 'open' log. This way, it is no longer required to
correlate both logs with their uniqid to have all the data:
the 'close' log should suffice. The 'open' log is still there if
for some reason the 'close' log can't be emitted (kill -9, system
crash, etc.), or if the 'open' and the 'close' log are several
hours, days or months appart.

An additional field "duration" has been added to the 'close' logs,
this represents the number of seconds (with millisecond precision)
the connection lasted.

Two new fields "globalsql" and "accountsql" have been added to the
'open'-type logs. These will contain either "ok" if we successfully
logged to the corresponding log database, "no" if it is disabled,
or "error $aDetailedMessage" if we got an error trying to insert
the row. The 'close'-type log also has the new "accountsql_close"
field, but misses the "globalsql_close" field as we never update
the global database on this event. On the 'close' log, we can also
have the value "missing", indicating that we couldn't update the
access log row in the database, as the corresponding 'open' log
couldn't insert it.

The "ttyrecsize" log field for the 'close'-type logs has been removed,
as it was never completely implemented, and contains bogus data if
ttyrec log rotation occurs. It has also been removed from the sqlite
log databases.

The 'open' and 'close' events are now pushed to our own log files,
in addition to syslog, if logging to those files is enabled (see
``enableGlobalAccesssLog`` and ``enableAccountAccessLog``), previously
the 'close' events were only pushed to syslog.

The /home/osh.log is no longer used for ``enableGlobalAccessLog``, the
global log is instead written to /home/logkeeper/global-log-YYYYMM.log.

The global sql file, enabled with ``enableGlobalSqlLog``, is now
split by year-month instead of by year, to
/home/logkeeper/global-log-YYYYMM.sqlite.
2020-12-29 16:14:50 +00:00
..
osh-accountAddGroupServer fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountCreate feat: revamp logs 2020-12-29 16:14:50 +00:00
osh-accountDelete fix: osh-accountDelete: fix typo 2020-12-14 21:49:32 +01:00
osh-accountGeneratePassword fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountGetPasswordInfo fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountListEgressKeys fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountListIngressKeys nh: remove hardcoded .ssh/authorized_keys2 everywhere 2020-11-26 18:08:03 +00:00
osh-accountListPasswords fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountMFAResetPassword fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountMFAResetTOTP fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountModify feat: accountModify: add --osh-only (closes #97) 2020-12-18 11:04:33 +00:00
osh-accountModifyCommand fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountModifyPersonalAccess fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountPIV fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-accountUnexpire fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-adminMaintenance fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-groupAddServer fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-groupAddSymlinkToAccount fix: Enable perl-tidy.sh test 2020-11-22 21:37:34 +00:00
osh-groupCreate chore: shellcheck & perltidy 2020-12-08 14:42:31 +00:00
osh-groupDelete chore: fix an error message 2020-12-15 13:57:58 +00:00
osh-groupGeneratePassword fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-groupModify fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-groupSetRole fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-selfMFASetupPassword fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00
osh-selfMFASetupTOTP fix: freebsd: replace 'root' by '0' so that it works even if uid0's name is not root 2020-11-17 11:12:53 +01:00