Skip to content

Commit a50beca

Browse files
authored
update README (#9)
1 parent 6fdfe46 commit a50beca

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# bashRPC
22
Simple HTTP server that executes configured commands remotely.
33

4+
### Why use bashRPC instead of chef/ansible/saltstack/etc?
5+
6+
Use bashRPC when you don't want to give complete super user privileges. That prevents situations like:
7+
8+
```
9+
salt "*" cmd.run "rm -rf /"
10+
# - or -
11+
ansible -i production all -a "rm -rf /"
12+
```
13+
14+
Instead, you can configure an endpoint that does only a select few super user tasks, such as restarting a system service, etc.
415

516
### Installation
617

@@ -63,7 +74,34 @@ sudo systemctl start bashrpc
6374
3) ping server
6475

6576
```bash
66-
curl -k -H "Authorization: supersecret" https://localhost:8675/uptime
77+
$ curl -k -H "Authorization: supersecret" https://localhost:8675/uptime
78+
```
79+
80+
### Security
81+
82+
There are few security measures implemented in bashRPC:
83+
84+
* No HTTP traffic. HTTPS is required.
85+
* User can specify their own SSL certificate, if desired.
86+
* Restricted to whitelist of IP addresses.
87+
* `Authorization` header is required for authentication on every request.
88+
* No parameterized inputs. Every command must be pre-configured in `bashrpc.yml`.
89+
90+
### Output
91+
92+
bashRPC returns plain text responses, very similar if you were to be executing a command over SSH. This makes it easy to save responses to a variable, check for status code, etc. Both STDOUT and STDERR are combined in the output.
93+
6794
```
95+
$ curl -k -H "Authorization: supersecret" https://localhost:8675/uptime
96+
14:31:29 up 1 day, 1:16, 2 users, load average: 1.77, 1.47, 1.43
97+
```
98+
99+
If you care about whether or not your command fails, you can check the response. Using `curl`, for example, you can exit non-zero if a command fails using the `--fail` argument:
68100

101+
```
102+
$ curl -k -H --fail "Authorization: supersecret" https://localhost:8675/iwillfail
103+
iwillfail: command not found
69104
105+
$ echo "$?"
106+
1
107+
```

0 commit comments

Comments
 (0)