Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds ssh mode switching; production, maintenance, status and fa… #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fnerdman
Copy link

@fnerdman fnerdman commented Nov 5, 2024

…ilsafe

chown -R ${SSH_USER_ID}:${SSH_USER_ID} ${D}${SSH_USER_HOME}

# Set up .profile to source /etc/profile
echo '. /etc/profile' > ${D}${SSH_USER_HOME}/.profile
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to source profile

# If not set, check the original environment
origenv = d.getVar("BB_ORIGENV", False)
if origenv:
ssh_key = origenv.getVar('SSH_USER_KEY')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use the already existing env var SEARCHER_SSH_KEY instead of introducing a new one?

@MoeMahhouk
Copy link
Collaborator

I guess handling how the searcher user is being forwarded back into its container upon switching to maintenance mode isn't handled here, right?
Would a change to the searcher ssh wrapper shell checking the state and forwarding the access into the container suffice?
It might be not the best solution as it could have some side effects that could potentially happen in between and would get access outside the container instead 🤔

Comment on lines +1 to +7
SUMMARY = "Adds failsafe mode user and script"
DESCRIPTION = "Creates the failsafe mode user and sets up SSH access with the provided SSH key, limit's the user to execute the failsafe.sh wrapper script"

require ssh-mode-switch.inc

SSH_USER_ID = "1103"
RDEPENDS:${PN} += "curl"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the failsafe to be also exposed and be callable by its own SSH USER?
I thought the fail safe triggers in case the production or maintenance scripts fail.

@MoeMahhouk
Copy link
Collaborator

I see that you included a failsafe fallback but I believe it is already handled from the go-bob-firewall here.
Also, do we need to expose the failsafe fallback within its own SSH user to be called too? I believe it should be triggered in case the maintenance or production SSH commands fail but not provide it as its own, right?

@fnerdman
Copy link
Author

fnerdman commented Nov 7, 2024

TODO: allow Igor to run this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants