[GH-ISSUE #60] selfListAccesses : add search filter #17

Closed
opened 2026-05-07 00:17:29 +02:00 by BreizhHardware · 2 comments

Originally created by @snk33 on GitHub (Nov 20, 2020).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/60

Hello,

On my bastion I've got a few groups and... hundred of servers, which can make it hard to find a specific access.
We've added a server name in comment + internal DNS to be able to connect easily to a server but searching one can be tricky.

I've managed to add some shell function to make it work by doing "grep" to the stdout but a filter implemented in the selfListAccesses command itself would be nice to make it work more directly (mostly on 3rd party SSH clients) :

function bls() {
    ssh -i ~/.ssh/key -t user@bastion -- --osh selfListAccesses | grep $1
}

Usage :
bls nameofserver

As the IP is always resolved when adding a server, I guess this search could only be on "comment" but if for some reason we're looking for servers in some network, filtering "ip/host" too could be nice aswell.

I guess it could be useful for many bastion's users, including OVH teams ? ;)

Originally created by @snk33 on GitHub (Nov 20, 2020). Original GitHub issue: https://github.com/ovh/the-bastion/issues/60 Hello, On my bastion I've got a few groups and... hundred of servers, which can make it hard to find a specific access. We've added a server name in comment + internal DNS to be able to connect easily to a server but searching one can be tricky. I've managed to add some shell function to make it work by doing "grep" to the stdout but a filter implemented in the selfListAccesses command itself would be nice to make it work more directly (mostly on 3rd party SSH clients) : ``` function bls() { ssh -i ~/.ssh/key -t user@bastion -- --osh selfListAccesses | grep $1 } Usage : bls nameofserver ``` As the IP is always resolved when adding a server, I guess this search could only be on "comment" but if for some reason we're looking for servers in some network, filtering "ip/host" too could be nice aswell. I guess it could be useful for many bastion's users, including OVH teams ? ;)
BreizhHardware 2026-05-07 00:17:29 +02:00
Author
Owner

@Alkorin commented on GitHub (Nov 20, 2020):

Hello,

Yes :)
I've a WIP branch somewhere at home to add filtering, include/exclude on List plugins.

Side note: if the comment is not set, and the server is added by hostname, we could set the comment to the hostname for future search. I don't think it is already done

<!-- gh-comment-id:731306566 --> @Alkorin commented on GitHub (Nov 20, 2020): Hello, Yes :) I've a WIP branch somewhere at home to add filtering, include/exclude on *List* plugins. Side note: if the comment is not set, and the server is added by hostname, we could set the comment to the hostname for future search. I don't think it is already done
Author
Owner

@snk33 commented on GitHub (Nov 20, 2020):

Ok nice to read ! I didn't think about exclude feature but in some cases it can help indeed.

Side note: if the comment is not set, and the server is added by hostname, we could set the comment to the hostname for future search. I don't think it is already done

I can confirm it doesn't put hostname as comment, we've done it by ourselves :)

<!-- gh-comment-id:731307428 --> @snk33 commented on GitHub (Nov 20, 2020): Ok nice to read ! I didn't think about exclude feature but in some cases it can help indeed. ``` Side note: if the comment is not set, and the server is added by hostname, we could set the comment to the hostname for future search. I don't think it is already done ``` I can confirm it doesn't put hostname as comment, we've done it by ourselves :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/the-bastion#17
No description provided.