Commit graph

41 commits

Author SHA1 Message Date
Stéphane Lesimple 521836b17b fix: rare race condition introduced by b7f4909
Under some specific conditions, the execute() call could get deadlocked with the program it started,
both waiting for each other to read or write data. This is easier to reproduce with the `scp` plugin,
where the transfer would just stall. Introduce an additional intermediate buffer to avoid this race condition.
2022-11-15 17:34:47 +01:00
Stéphane Lesimple 21f29680b6 fix: basic mitigation for scp's CVE-2020-15778
This CVE will not be fixed by scp authors, and as far as The Bastion
is concerned, this can't be achieved by anybody that doesn't already
have shell access to the remote server in addition to the scp rights,
but let's still block it for good measure.
2022-11-15 14:56:49 +01:00
Stéphane Lesimple 720222c423 fix: batch: don't attempt to read if stdin is closed 2022-09-21 11:57:55 +02:00
Stéphane Lesimple 7b3c721f66 doc: add a missing parameter in ping's help 2022-07-29 11:34:43 +02:00
Stéphane Lesimple a86f25470a chore: selfListEgressKeys: fix typo 2022-07-29 11:29:58 +02:00
Stéphane Lesimple 72cefa6417 fix: performance issues introduced by effab4a
Commit that introduced the performance degradation is effab4a
(fix: workaround for undocumented caching in getpw/getgr funcs)

Rewrote caching at the getpwent/getpwnam/getgrent/getgrnam level,
which restores performance pre-effab4a and even enhances it in somes cases,
for example on a 2000-accounts and 2000-groups bastion, we are:

- 11% faster on --osh help
- 35% faster on --osh selfListAccesses (reduces syscalls by 87%)
2022-07-12 10:07:16 +02:00
Thomas Soëte da6d80bef1 fix: Bad plugin name 2022-07-05 10:02:37 +02:00
Stéphane Lesimple 3540dc309c enh: groupInfo: clearer message for disabled idle/kill timeout policies 2022-07-01 15:33:44 +02:00
Stéphane Lesimple 46a01a546a feat: groupModify: add --idle-lock-timeout and --idle-kill-timeout for group-specific timeouts 2022-07-01 15:33:44 +02:00
Stéphane Lesimple 6fb528ccf1 chore: rename some vars for clarity 2022-07-01 15:33:44 +02:00
Stéphane Lesimple e040afb074 chore: new perltidy rules 2022-07-01 10:21:19 +02:00
Stéphane Lesimple bd2f069c7e enh: print a msg when no ingress keys are found 2022-07-01 10:10:17 +02:00
Stéphane Lesimple 4f99c4fe6c fix: ping: force a deadline, and restore default sighandlers 2022-06-29 11:34:24 +02:00
Romain Beuque c1ca9b6374 fix: typo in the 'alive' command
Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>
2022-06-08 12:01:10 +02:00
Stéphane Lesimple effab4a5c2 fix: workaround for undocumented caching in getpw/getgr funcs 2022-03-14 12:42:26 +01:00
Stéphane Lesimple f609565fe8 enh: batch: detect when asked to start a plugin requiring MFA 2021-12-29 11:20:55 +01:00
Stéphane Lesimple f8f193b298 enh: selfMFASetupPassword: add more messages for the user 2021-12-28 09:54:17 +01:00
Stéphane Lesimple 373f4907de fix: tests under OpenSUSE (fping raw sockets) 2021-12-13 09:32:52 +01:00
Stéphane Lesimple 89ecb2c0d7 feat: add support for Duo PAM auth as MFA (#249) 2021-11-03 15:50:10 +01:00
Stéphane Lesimple 00aa2e7efc fix: selfMFASetupTOTP: bad return func 2021-10-20 13:42:13 +02:00
Stéphane Lesimple f64cf79260 chore: rename an envvar for clarity 2021-09-21 12:06:40 +02:00
thibault.dewailly 5415ed2793 Feat: Add admin and super owner accounts list in info plugin
For auditing purposes, get admin and super owner list in info plugin
Available for auditor role only
Closes #206
2021-06-28 11:13:30 +02:00
Stéphane Lesimple d400ceeb9f doc: clush: document --user and --port
Partly fixes #201
2021-06-23 12:24:32 +02:00
Thomas Soëte c61a3eaae9 Remove duplicate groupAddGuestAccess groupDelGuestAccess
groupAddGuestAccess groupDelGuestAccess are present twice in help
2021-06-21 09:39:35 +02:00
Stéphane Lesimple 8cc990ad57 feat: add filtering options to several cmds,nicify print_acls()
The commands selfListAccesses, accountListAccesses,
groupList, groupListServers, groupListGuestAccesses and
accountList now have options to filter their output through
pattern matching, with --include and --exclude.

The output from the commands using print_acls() is also more
human-friendly, with auto-adjusting column length, and empty
columns omitted.

Closes #60.
2021-05-25 09:42:28 +02:00
Stéphane Lesimple adb9d8c374 feat: add UTF-8 chars to output when supported and allowed
To enhance the readability and visibility of important messages
(such as critical ones). This can be disabled with the `allowUTF8`
global option set to `false`. It's never enabled if the user locale
or their terminal don't seem to support it.
2021-05-24 16:44:35 +02:00
Stéphane Lesimple c2b4bb192a fix: osh-help: put groupDelEgressKey in the proper category
Fixes #174
2021-04-16 09:09:26 +02:00
Stéphane Lesimple 255f0684cc fix: scp: abort early if host is not found to avoid a warn()
The following warn would happen if the scp wrapper was called with an invalid hostname:

Use of uninitialized value  in bitwise and (&) at /usr/share/perl5/Net/Netmask.pm line 699.
 at /opt/bastion/bin/plugin/open/../../../lib/perl/OVH/Bastion.pm line 41.
 OVH::Bastion::__ANON__("Use of uninitialized value \ in bitwise and (&) at /usr/shar"...) called at /usr/share/perl5/Net/Netmask.pm line 697
 Net::Netmask::match(Net::Netmask=HASH(0x55b1d5f11860), undef) called at /opt/bastion/lib/perl/OVH/Bastion/allowdeny.inc line 214
 OVH::Bastion::is_access_way_granted("port", 22, "exactUserMatch", 1, "ipfrom", "X.X.X.X", "ip", undef, ...) called at /opt/bastion/lib/perl/OVH/Bastion/allowdeny.inc line 688
 OVH::Bastion::is_access_granted(\"account\", \"johndoe\", \"user\", \"!scpupload\", \"ipfrom\", \"X.X.X.X\", \"ip\", undef, ...) called at /opt/bastion/bin/plugin/open/scp line 136
2021-03-01 09:31:38 +01:00
Stéphane Lesimple 5eb5135d26 doc: update 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 7eeccb7c5d enh: groupInfo: nicer message when no egress key exists 2021-02-17 10:03:40 +01:00
Stéphane Lesimple efe3710e4c feat: groupList/accountList: add --include --exclude 2021-01-21 15:56:59 +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 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 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
Thomas SOËTE 632076565e Fix sort of the list of past sessions 2020-11-18 09:50:56 +00:00
Stéphane Lesimple 60cea897f8 enh: osh.pl: replace harcoded selfMFASetupPassword logic by configuration 2020-11-17 11:28:05 +01:00
Stéphane Lesimple 5c72c92bdd
chore: fix typos everywhere 2020-11-05 17:36:17 +00:00
Romain Beuque cb1e54b42a
clush: change description for --no-pause-on-failure to represent the actual behavior
Signed-off-by: Romain Beuque <romain.beuque@ovhcloud.com>
2020-10-22 12:21:29 +02:00
Stéphane Lesimple fde20136ef
Initial commit 2020-10-20 14:30:27 +00:00