Commit graph

35 commits

Author SHA1 Message Date
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
Stéphane Lesimple 8c31ea277c
fix: remove useless warning when there is no guest access 2020-12-23 10:24:24 +00:00
Stéphane Lesimple a204313af9
feat: accountModify: add --osh-only (closes #97) 2020-12-18 11:04:33 +00:00
Stéphane Lesimple d6574221a3 fix: bastion.conf.dist & configuration.inc after #98 2020-12-17 19:52:10 +01:00
Stéphane Lesimple 4a45df4432
chore: tidy after merge, adjust & regen doc 2020-12-17 08:04:32 +00:00
Stéphane Lesimple 9c370b8ac1
Merge branch 'master' into configlint 2020-12-16 14:33:36 +01:00
Stéphane Lesimple b131395a21
Merge pull request #79 from axl89/master
Fixed wrong default values in bastion.conf comments
2020-12-16 14:29:03 +01:00
Stéphane Lesimple 163a3fd726
chore: perlcritic/perltidy passes 2020-12-16 13:01:13 +00:00
Stéphane Lesimple ef6efa6dc3
enh: config: better parsing and normalization
We now warn (to syslog) for invalid values where
we have to fallback to defaults, and for boolean
options, actual true/false JSON values are now
properly recognized. 0 and 1 will still always
be parsed correctly, to not break compatibility.
2020-12-16 08:17:38 +00:00
Stéphane Lesimple 03ad1da046
chore: perlcritic: including forgotten .inc files 2020-12-15 17:18:37 +00:00
Stéphane Lesimple 1c33903203
release v3.01.03 2020-12-15 11:35:33 +00:00
Stéphane Lesimple 790802e6da
fix: osh.pl: plugin_config 'disabled' key is a boolean 2020-12-15 10:16:35 +00:00
Stéphane Lesimple 39ddc4c462
fix: guests: get rid of ghost guest accesses in corner cases
Adding a guest access to a member of a group is now denied, to avoid having
dangling guest accesses when their membership is revoked. In effect, they
could no longer access the group servers, even as guest, because they no longer
had access to the group key, but their previous guest accesses were still
visible in groupListGuestAccesses, causing possible confusion.

We now also revoke all guest accesses of an account to a group, if any,
when it's being set as a member of this group, so that when/if the account
membership is revoked, we don't end up with the same ghost guest accesses as above.
2020-12-10 10:23:47 +00:00
Stéphane Lesimple a3b2b7d8e4
bump to v3.01.02 2020-12-08 15:41:56 +00:00
Stéphane Lesimple 18d8195027
fix: is_valid_remote_user: extend allowed size from 32 to 128 2020-12-08 10:20:25 +00:00
Axel Amigo Arnold 9b06db1461 Changed ttyrecFilenameFormat default value
See #79

Additional details: a085cc467e (r536813898)
2020-12-05 17:56:43 +01:00
Stéphane Lesimple 534ce45812
release v3.01.01 2020-12-04 16:36:08 +00:00
Stéphane Lesimple 9c1870e990
fix: interactive mode: mark non-printable chars as such to avoid readline quirks 2020-12-01 16:42:28 +00:00
Stéphane Lesimple 4cb09a9570
nh: remove hardcoded .ssh/authorized_keys2 everywhere 2020-11-26 18:08:03 +00:00
Thomas SOËTE a4dc86cfde fix: Allow dot in group name as it is allowed in account
Fixes #61
2020-11-23 13:59:23 +00:00
Stéphane Lesimple f07e00b1e9
Merge branch 'master' into adminSudo 2020-11-23 10:05:11 +01:00
Stéphane Lesimple e2a64a9d8f
enh: adminSudo: better autocompletion rules 2020-11-23 08:35:28 +00:00
Thomas SOËTE 2a51a78b54 fix: Enable perl-tidy.sh test
* Move to ubuntu-20.04 runner
* Remove check in dockers tests
2020-11-22 21:37:34 +00:00
Stéphane Lesimple 5ecab9888b
bump to v3.01.00 2020-11-20 10:53:00 +00:00
Stéphane Lesimple 15cad00c27
fix: osh.pl: validate user and host format 2020-11-20 07:20:51 +00:00
Stéphane Lesimple 8f60646c65
feat: add interactiveModeByDefault option 2020-11-19 12:44:33 +00:00
Stéphane Lesimple cb02fd2a33 fixes after review 2020-11-17 17:41:32 +01:00
Stéphane Lesimple 9f1a8b925e enh: install: better handling of non-Linux standard paths 2020-11-17 11:17:17 +01:00
Stéphane Lesimple 09bd6dffd9 fix: freebsd: add md5sum_compat()
to account for systems where md5sum's binary name is gmd5sum
2020-11-17 11:14:34 +01:00
Stéphane Lesimple b87107dd23
bump to v3.00.02 2020-11-16 10:39:06 +00:00
Stéphane Lesimple ae1bcbf223
release v3.00.01 2020-11-06 15:22:12 +00:00
Stéphane Lesimple 5c72c92bdd
chore: fix typos everywhere 2020-11-05 17:36:17 +00:00
Stéphane Lesimple 4da7a39f27
release v3.00.00 2020-10-30 10:26:01 +00:00
Stéphane Lesimple 26e78f424b
chore: fix some links in documentation 2020-10-30 10:16:08 +00:00
Stéphane Lesimple fde20136ef
Initial commit 2020-10-20 14:30:27 +00:00