mirror of
https://github.com/ovh/the-bastion.git
synced 2026-05-09 16:35:33 +02:00
[GH-ISSUE #392] Enforce connecting with user login8 on group access server #106
Labels
No labels
answered
bug
documentation
enhancement
enhancement
feature
feature
kept-open-for-info
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/the-bastion#106
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @al26p on GitHub (Apr 27, 2023).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/392
Hi,
Currently there is only the possibility to connect as (any) or as a certain user with Group Access.
Having the possibility to connect as (self) would be perfect !
On this example I should only be able to connect as
apratson mysuperserver.ovhThanks for your work !
@speed47 commented on GitHub (Apr 27, 2023):
Interesting, I think we can extend
--user <user>and--user-anywith--user-selfindeed@speed47 commented on GitHub (Jun 1, 2023):
So, I've implemented this feature a bit differently in
cf405badfb.The idea is that if I had implemented something like
--user-selfin groups, this would have implied that all accounts on the remote server would have to share the same SSH key (namely, the group's egress key).For example if we have 5 members in a group, and these 5 members would connect remotely using their own account name as the remote user name, because an ACL targeting the remote server would have been added with
--user-self, the remote server would need to have 5 Linux accounts bearing these names, all sharing the group's egress key. This is already a bad practice per se, but it also means that if one of the group's ACLKeeper later added a new ACL with--user-anytargeting the same remote server (or any CIDR in which the remote server would be included), any of these 5 members could connect using any of the 5 remote accounts on the remote server, which is probably not wanted at all. This would be an error on the ACLKeepers side, but it's not extremely obvious hence I don't want to add a feature that would make it too easy to make the mistake.So, back to the feature I've implemented instead: two new options are available in the
selfAddPersonalAccessplugin:widest_v4_prefixandself_remote_user_only, the documentation is available here. You can use this to allow this command to everyone (as explained here, but settingself_remote_user_onlywill ensure that accounts can only add accesses with their own account name as the remote user name.widest_v4_prefixoptionally helps to further prevent abuse/misuse of this.Another option is to auto-add such accesses directly on account creation (without requiring to grant
selfAddPersonalAccessto users), as explained here.