{"id":27097267,"url":"https://github.com/elulcao/grpcremotecommands","last_synced_at":"2026-02-17T23:33:26.091Z","repository":{"id":144499735,"uuid":"442621938","full_name":"elulcao/gRPCRemoteCommands","owner":"elulcao","description":"gRPCRemoteCommands is a little application for executing commands in a remote host, connection is secured with SSL/TLS in Go. ","archived":false,"fork":false,"pushed_at":"2025-06-14T16:23:13.000Z","size":2419,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T06:49:52.609Z","etag":null,"topics":["cobra","devcontainer","go","golang","grpc","grpc-go","protobuf","remote-execution"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elulcao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-29T00:53:55.000Z","updated_at":"2025-06-14T16:22:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"e5c31d37-af86-46f9-a297-c3597fe4488e","html_url":"https://github.com/elulcao/gRPCRemoteCommands","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/elulcao/gRPCRemoteCommands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elulcao%2FgRPCRemoteCommands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elulcao%2FgRPCRemoteCommands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elulcao%2FgRPCRemoteCommands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elulcao%2FgRPCRemoteCommands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elulcao","download_url":"https://codeload.github.com/elulcao/gRPCRemoteCommands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elulcao%2FgRPCRemoteCommands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29562252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cobra","devcontainer","go","golang","grpc","grpc-go","protobuf","remote-execution"],"created_at":"2025-04-06T10:26:50.008Z","updated_at":"2026-02-17T23:33:21.075Z","avatar_url":"https://github.com/elulcao.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPCRemoteCommands\n\n[![Go CI](https://github.com/elulcao/gRPCRemoteCommands/actions/workflows/go.yaml/badge.svg)](https://github.com/elulcao/gRPCRemoteCommands/actions/workflows/go.yaml)\n[![CodeQl CI](https://github.com/elulcao/gRPCRemoteCommands/actions/workflows/codeql-analysis.yaml/badge.svg)](https://github.com/elulcao/gRPCRemoteCommands/actions/workflows/codeql-analysis.yaml)\n\n---\n\n\u003cp\n    align=\"center\"\u003e\n    \u003cimg\n        src=\".assets/demo-01.gif\"\n        alt=\"Demo 01 - localhost\"\n        width=\"600\"\n        height=\"400\"\n    /\u003e\n\u003c/p\u003e\n\n---\n\n`Unary gRPC` demo, with embedded certificates and `TLS` for secure communication between client and\nserver.\n\nIn simple `gRPC`, the client sends a single request to the server and gets a single response that is\nsent back to the client. In this case the request is a `command` to be executed on the server and the\nresponse is the `result of the command`.\n\nThe connections is secured by `TLS`, which is a transport layer security protocol. This eliminates the\nneed for SSH keys or passwords. The client and server are configured to use the same certificate\nand key; the certificates are generated locally and then embedded in the code. Having the certificates\nembedded in the code makes it easier to distribute the binary server and client, since this is a\ndemo and not a production application.\n\n```bash\n                        ┌─────────┐   ┌────────┐   ┌─────────┐\n                        │ Cert C  │◄──┤ CA Auth├──►│ Cert S  │\n                        └────x────┘   └────────┘   └────x────┘\n                             x                          x\n                        ┌────x────┐                ┌────x────┐\n                        │         ├───────────────►│         │\n                        │         │    gRPC Conn   │         │\n                        │         │                │         │\n                        │ Client  │                │ Server  │\n                        │         │◄───────────────┤         │\n                        └─────────┘    gRPC Conn   └──┬──────┘\n                                                      │\n                                                      │\n                                                   ┌──┴──────┐\n                                                   │         │\n                                                   │ Command │\n                                                   └─────────┘\n```\n\nThe service definition is in the `proto` directory, the simpliest `gRPC` service definition is:\n\n```go\n// RemoteCommand is a command to be executed on a remote machine.\nservice RemoteCommand {\n    rpc executeCommand(CommandRequest) returns (CommandResponse) {}\n}\n\n// CommandRequest is a request to execute a command.\nmessage CommandRequest {\n    string cmd = 1;\n}\n\n// CommandResponse is a response to a command.\nmessage CommandResponse {\n    string out = 1;\n}\n```\n\n## Building the server and client\n\nServer and client are using certificates to secure the communication. The certificates are generated\nlocally and then embedded in the code. This is intended to make it easier to distribute the binary,\nthere is no need to generate the certificates and propagate them to the client and server since this\nis a demo and not a production application; so, only `go 1.16` and above is supported.\n\nTo build the server and client, first generate the certificates, then build the protobuf files, then\nbuild the server and client.\n\nAll the steps can be done in a single command:\n\n- `make build`\n\nThe certificates are generated with the following script:\n\n- `scripts/certs.sh`\n\nThe protobuf file is generated with the following command:\n\n- `protoc --proto_path=proto proto/command_service.proto --go_out=proto --go-grpc_out=proto`\n\nBinary generated can be used in the local host since the certificates are generated with IP address\nlike `0.0.0.0`. Change the IP address to the IP address of the machine where the server is running\nand generate the certificates and binary again.\n\n## Building the server and client with the development environment\n\nThe devcontianer can be used, `.devcontainer/Dockerfile`, to build the server and client when running\ncloned the repo in a Windows machine. The binafiles generated must be used in Linux machines, since\nthe devcontainer is built with a Linux image.\n\n## Notes\n\nCommands with arguments are allowed but commands that require an interactive shell are not supported,\ni.e. `sudo`, `htop`, `top`, `vim`, `vi`.\n\n```bash\n./gRPCRemoteCommands client --command \"ls -la\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felulcao%2Fgrpcremotecommands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felulcao%2Fgrpcremotecommands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felulcao%2Fgrpcremotecommands/lists"}