imjasonh / ideas

A place for me to file issues against myself for things I want to build when I'm bored
5 stars 0 forks source link

Web-based remote shell for debugging and/or exploiting #85

Closed imjasonh closed 3 years ago

imjasonh commented 3 years ago

Services like GitHub Actions, Cloud Build, Cloud Run, plenty of others others, let users run a container in a somewhat restricted environment, where your request isn't exactly interactive. It could be fun to build a container image that you can pass to these services to interactively look around in the environment and explore


Two parts, a runner image and a controller web app:

Runner image

Controller image

Live sessions stored in Datastore, logs stored in GCS with a TTL


How it might look/work:

$ cat cloudbuild.yaml
steps:
- name: gcr.io/blah/runner
$ gcloud builds submit --no-source
...
Step #0: Created new session 1ec05323-3d34-4a9f-8869-1896a56d57cc
Step #0: Go to https://blah.com/1ec05323-3d34-4a9f-8869-1896a56d57cc to provide commands
Step #0: Waiting for commands...
Step #0: Found new commands ["echo hello"]
Step #0: ==> Running "echo hello"
Step #0: hello
Step #0: -------------------------------
Step #0: Waiting for commands...
Step #0: Found new commands ["pwd"]
Step #0: ==> Running "pwd"
Step #0: /something/cool/foo/bar/baz
Step #0: -------------------------------
Step #0: Waiting for commands...
Step #0: No new commands after 1m, exiting...
DONE

Prior Art

imjasonh commented 3 years ago

I did this. It was okay.