Commit graph

45 commits

Author SHA1 Message Date
Stéphane Lesimple
b364706f37 feat: httpproxy: add functional tests 2021-06-03 16:16:29 +02:00
Stéphane Lesimple
d6291f3ad4 feat: httpproxy: add and use execute_simple() for more performance
Also handle errors better in hand_http_request()
2021-06-03 16:16:29 +02:00
Stéphane Lesimple
60ad30ce5b fix: install: adjust a sed to be FreeBSD 13 compliant 2021-05-21 14:13:22 +02:00
Stéphane Lesimple
f4c59ca96b enh: setup-gpg.sh: clarify the use of ^D with --import
Closes #179
2021-05-19 18:56:32 +02:00
Stéphane Lesimple
e865964dd2 enh: setup-encryption.sh: check that luks-config.sh exists
As seen in #181
2021-05-19 18:56:17 +02:00
Jérémy Lecour
3e0202d914 Fix typo in unlock-home.sh
Typo : Mouting → Mounting
2021-05-19 15:30:32 +02:00
Stéphane Lesimple
90d6dc2e3c fix: superowners need to have +x on group homes 2021-04-09 09:46:14 +02: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
3b4ea53cce fix: fixrights.sh: 'chmod --' not supported under FreeBSD 2021-03-24 10:47:11 +01:00
Stéphane Lesimple
1b04b800b8 fix: packages-check.sh: centos: ensure cache is up to date before trying to install packages 2021-03-24 10:47:11 +01:00
Stéphane Lesimple
5920b09aed chore: mkdir -p doesn't fail if dir already exists 2021-03-24 10:47:11 +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
b444dc027f chore: tests: support multiple unit-tests 2021-03-01 09:30:43 +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
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
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
457a8fae82
chore: packages-check: remove unused packages 2020-12-08 14:27:38 +00:00
Stéphane Lesimple
dca45a44c5
chore: fix latest centos 8 release, add tests for last 3 minors 2020-12-08 14:27:13 +00:00
Stéphane Lesimple
c4d2cea3b0
fix: packages-check: centos8: handle new repo names 2020-12-08 10:54:57 +00:00
Stéphane Lesimple
50c016be10
fix: sudogen: properly handle accounts & groups containing '.' 2020-12-03 13:20:53 +00:00
Stéphane Lesimple
4cb09a9570
nh: remove hardcoded .ssh/authorized_keys2 everywhere 2020-11-26 18:08:03 +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
15cad00c27
fix: osh.pl: validate user and host format 2020-11-20 07:20:51 +00:00
Stéphane Lesimple
d6be60e4a2
Merge branch 'master' into centos 2020-11-18 11:24:18 +01:00
Stéphane Lesimple
4fd24a3dbc
enh: install: freebsd: check whether acls are enabled 2020-11-18 09:37:31 +00:00
Stéphane Lesimple
231c62b581
feat: install: add SELinux module for TOTP MFA
Fixes #26
2020-11-18 09:35:19 +00:00
Stéphane Lesimple
615f26af8b enh: freebsd: use ttyrec prebuild static version 2020-11-17 21:04:22 +01:00
Stéphane Lesimple
cb02fd2a33 fixes after review 2020-11-17 17:41:32 +01:00
Stéphane Lesimple
ee81bd4070 enh: packages-check.sh: better handling of FreeBSD packagees 2020-11-17 11:27:46 +01:00
Stéphane Lesimple
7ee203aa71 enh: install-ttyrec.h: error msg for non-supported OSes 2020-11-17 11:19:50 +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
234dd0768a feat: freebsd: add specific FreeBSD ssh config templates 2020-11-17 11:15:10 +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
4105c10193 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
Stéphane Lesimple
418dc3a332 feat: add more archs to dockerhub sandbox 2020-11-13 18:38:53 +01:00
Stéphane Lesimple
cfef70daef
chore: install-ttyrec.sh: adapt for multiarch 2020-11-09 16:47:57 +00:00
Stéphane Lesimple
5c72c92bdd
chore: fix typos everywhere 2020-11-05 17:36:17 +00:00
Stéphane Lesimple
619000fa84
enh: install-ttyrec.sh replaces build-and-install-ttyrec.sh
No longer build ttyrec inplace, either download and install the
Debian/RPM package, or install the prebuild static binaries.

Modify the Dockerfiles accordingly.
2020-11-05 09:56:05 +00:00
Stéphane Lesimple
202790367d enh: packages-check.sh: add qrencode-libs for rhel/centos
This enables direct printing of the qrcode on the terminal for TOTP enrollment
2020-11-01 19:45:42 +01:00
Thomas Soëte
9a23c1ce6a
Add missing dev package
Install shellcheck too

Signed-off-by: Thomas SOËTE <github@alkorin.fr>
2020-10-26 19:05:01 +01:00
Stéphane Lesimple
e453377245
chore: add some documentation and fix a few comments 2020-10-22 08:12:49 +00:00
Thomas Soëte
e766a54a35 Enhance osh-sync-watcher logs
With server name and step number
2020-10-20 16:49:27 +00:00
Stéphane Lesimple
fde20136ef
Initial commit 2020-10-20 14:30:27 +00:00