Commit graph

178 commits

Author SHA1 Message Date
Stéphane Lesimple f3ce9dfb06 enh: clearer error message on non-existing group 2021-04-08 12:57:47 +02:00
Stéphane Lesimple 2a905aca96 release v3.03.01 2021-03-25 11:55:04 +01:00
Stéphane Lesimple 003052530e feat: preparatory work to support Debian 11 "Bullseye"
We still need to replacee pam_tally2 by pam_faillock
Debian 11 is NOT yet supported, and won't be before it's released as stable.
2021-03-24 17:41:29 +01:00
Stéphane Lesimple e37e235bf5 enh: install.inc: try harder to hit GitHub API in CI 2021-03-24 10:47:11 +01:00
Stéphane Lesimple 7b7c395c55 enh: osh-orphaned-homedir.sh: add more security checks to ensure we don't archive still-used home dirs 2021-03-19 14:39:31 +01:00
Stéphane Lesimple 7dabfc7135 fix: install-yubico-piv-checker: ppc64le installation was broken 2021-03-17 15:14:13 +01:00
Stéphane Lesimple 89e49ac8b7 fix: add a case to the ignored perl panic race condition 2021-03-01 09:30:30 +01:00
Stéphane Lesimple b6c7503a73 release v3.03.00 2021-02-22 17:09:12 +01:00
Stéphane Lesimple 3764d652da enh: interactive: avoid a warn() when TERM is undef 2021-02-22 11:56:33 +01:00
Stéphane Lesimple 383f2a011c enh: guests: groupAddGuestAccess now supports setting a comment
If no comment is set, the comment is inherited from the group ACL,
as seen in groupListServers.

selfAddPersonalAccess now also return details
about the added server in the returned JSON.

Closes #18
Closes #17
2021-02-22 11:56:19 +01:00
Stéphane Lesimple b480316386 fix: groupDelGuestAccess: deleting a guest access returned an error on TTL-forced groups 2021-02-22 11:56:19 +01:00
Stéphane Lesimple ed77c1ef3e feat: transmit PIV enforcement status to remote realms
Closes #33
2021-02-18 16:05:02 +01:00
Stéphane Lesimple 2327c4dfa1 chore: remove useless '## no critic', perltidy 2021-02-17 10:03:40 +01:00
Stéphane Lesimple 5eb5135d26 doc: update 2021-02-17 10:03:40 +01:00
Stéphane Lesimple 488ec6382e enh: move unexpected-sudo messages from security to code-warning type 2021-02-17 10:03:40 +01:00
Stéphane Lesimple e760cf6142 feat: add groupGenerateEgressKey and groupDelEgressKey 2021-02-17 10:03:40 +01:00
Stéphane Lesimple fe58cf1d14 enh: egress ssh key: compute an ID so that keys can be pointed to and deleted 2021-02-17 10:03:40 +01:00
Stéphane Lesimple c88be2def1 enh: get_group_keys: return the keyhome to avoid hardcoding it on several places 2021-02-17 10:03:40 +01:00
Stéphane Lesimple 02b76d301a fix: groupSetRole: pass sudo param to subfuncs to avoid a security warning 2021-02-17 10:03:40 +01:00
Stéphane Lesimple 4624f71ea2 fix: execute: remove osh_warn on tainted params to avoid exposing arguments on coding error 2021-02-17 10:03:40 +01:00
Stéphane Lesimple 3b37242317 chore: more readable version of sql statements
Signed-off-by: Stéphane Lesimple <stephane.lesimple+bastion@ovhcloud.com>
2021-02-15 11:25:45 +01:00
Stéphane Lesimple 70feff2c2d enh: install: use in-place overwrite for sudoers files
This fixes a race condition in sudo where it would log a log of
error messages to syslog if used while we're running the install
script: files around sudoers.d/ are then moved around, and it'll
yell for each file it previously listed if the file no longer
exists when it tries to stat() it. It also deprecates the --no-wait
flag of the install script, as now the sudoers.d/ directory will
always have integrity at all times.

Signed-off-by: Stéphane Lesimple <stephane.lesimple+bastion@ovhcloud.com>
2021-02-14 22:25:50 +01:00
Stéphane Lesimple 59187fcf4c fix: interactive: omit inactivity msg warning when set to 0 seconds
Signed-off-by: Stéphane Lesimple <stephane.lesimple+bastion@ovhcloud.com>
2021-02-13 16:09:36 +01:00
Stéphane Lesimple d430c602bf release v3.02.00 2021-02-02 15:02:51 +01:00
Stéphane Lesimple a913c5aa8a bump to v3.01.99-rc4 2021-01-25 12:18:27 +01:00
Stéphane Lesimple 5d36e820ca fix: admins no longer inherited superowner powers
Regression since rc1
2021-01-25 12:18:04 +01:00
Stéphane Lesimple 3bb1db3a4d bump to v3.01.99-rc3 2021-01-21 15:57:11 +01:00
Stéphane Lesimple fd97845c1c chore: update autoload list accordingly 2021-01-21 15:56:59 +01:00
Stéphane Lesimple efe3710e4c feat: groupList/accountList: add --include --exclude 2021-01-21 15:56:59 +01:00
Stéphane Lesimple 80ade2ba4c fix: debian9: create_file_if_not_exists couldn't chgrp by filehanddle 2021-01-20 14:01:55 +01:00
Stéphane Lesimple 69778815bb enh: groupList: use cache to speedup calls
On bastions with thousands of group, the speedup is ~x10
2021-01-20 14:01:55 +01:00
Stéphane Lesimple 928bf0c7b0 enh: config: detect warnBefore/idleTimeout misconfiguration
Before, an inconsistency in the configuration settings of the warnBefore(Lock|Kill)Seconds
and idle(Lock|Kill)Timeout could break any new connection (ttyrec refuses to launch).

Now we detect this case properly, and fallback to a sane setting for
warnBefore(Lock|Kill)Seconds (zero) if those were set without enabling the corresponding
idle(Lock|Kill)Timeout setting. We also log an error to syslog when it happens,
so that the sysadmin can fix their configuration.

Added hints about how these configuration options work together in the bastion.conf.dist file.

Fixes #125
2021-01-19 12:26:09 +01:00
Stéphane Lesimple 8d0004f8aa fix: config: be more permissive for documentationURL regex 2021-01-15 16:13:11 +01:00
Stéphane Lesimple 36d0c709db bump to v3.01.99-rc2 2021-01-13 09:38:02 +01:00
Stéphane Lesimple c6446495aa fix: logs: sql dbname was not properly passed through the update logs func 2021-01-13 09:38:02 +01:00
Stéphane Lesimple 1378ba84f5 fix: re-introduce the ttyrecfile field
This field was mistakenly removed along with the ttyrecsize one
by mistake in a479810d83.

Add tests to ensure this can't break again.
2021-01-13 09:38:02 +01:00
Stéphane Lesimple 27d09e8cbe bump to v3.01.99-rc1 2021-01-12 12:05:41 +01:00
Stéphane Lesimple 1129850771 fix: global-log: directly set proper perms on file creation 2021-01-12 12:05:20 +01:00
Stéphane Lesimple 1676979913 feat: add PIV keys support and policy enforcement
A new global option 'ingressRequirePIV' was added, to enable or disable a
bastion-wide policy forcing everybody to use only PIV keys.
2021-01-12 12:05:06 +01:00
Stéphane Lesimple 62d6393d56 feat: add yubico-piv-checker install script 2021-01-12 12:05:06 +01:00
Stéphane Lesimple 41121f7723
fix: proper sqlite log location for invalid realm accounts 2021-01-07 17:20:54 +00:00
Stéphane Lesimple 16323667e2
Merge pull request #106 from ovh/logs
feat: revamp logs
2021-01-05 18:50:25 +01:00
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 2117773945
fix: groupList: remove 9K group limit 2020-12-29 10:41:04 +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