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

over eager dangerous commands #189

Open
michaelneale opened this issue Oct 24, 2024 · 1 comment
Open

over eager dangerous commands #189

michaelneale opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@michaelneale
Copy link
Collaborator

    dangerous_patterns = [
        # Commands that are generally unsafe
        r"\brm\b",  # rm command
        r"\bgit\s+push\b",  # git push command
        r"\bsudo\b",  # sudo command
        r"\bmv\b",  # mv command
        r"\bchmod\b",  # chmod command
        r"\bchown\b",  # chown command
        r"\bmkfs\b",  # mkfs command
        r"\bsystemctl\b",  # systemctl command
        r"\breboot\b",  # reboot command
        r"\bshutdown\b",  # shutdown command
        # Target files that are unsafe
        

rm and mv may be ok in many cases as the user has specifically asked goose to do some work and it can be a little over eager. Could we make it smarter:

  • have a global "go ahead" say when running "goose run"
  • if it is running commands in current dir and there file isn't unstaged (ie git has it backed up) then it may be ok to go ahead within that context of current project?
@michaelneale
Copy link
Collaborator Author

@baxen it may be time to bring back the accelerator check: only in this case use it to decide based on system if it should continue as lower risk than on face of it?

@michaelneale michaelneale added bug Something isn't working enhancement New feature or request labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant