taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

README.md (5799B)


      1 # Splitops
      2 ================
      3 
      4 Splitops is a script to allow execution of commands only after the approval of
      5 multiple users. 
      6 
      7 It is intended to be used with OpenSSH by specifiying it as the "command" option
      8 for authorized users in `~/.ssh/authorized_keys` (explained below).
      9 
     10 Server requirements:
     11 =====================
     12 
     13 GNU/linux server.
     14 The Splitops program is written in the Python programming language, so you will need to have installed the 
     15 python3 package in your server, please check in your terminal by typing "python3 -V", to see if you have this package already installed. 
     16 
     17 Please do before using the program
     18 =====================================
     19 
     20 1) From your local computer git clone the deployment.git repository, and within the "splitops" folder, 
     21 copy the file "splitops" from your computer to the remote server (path:/usr/local/bin/). There is no need for you
     22 to clone the whole deployment.git repository from the remote server to grab this program.  
     23 
     24 You can use the command "scp" for this. 
     25 
     26 scp /home/user/deployment/splitops/splitops root@server:/usr/local/bin/
     27 
     28 2) In your remote server SSH configuration (/etc/ssh/sshd_config), 
     29 please make sure you have the option "PubkeyAuthentication yes" is 
     30 de-commented. If not, decomment the line, and --reload your ssh service. 
     31 
     32 3) In your /root/.ssh/authorized_keys, please add the next lines:
     33 
     34 command="/usr/local/bin/splitops alice" [... key of alice ...]
     35 command="/usr/local/bin/splitops bob" [... key of bob ...]
     36 
     37 (one for each user, that you want to have approval from for each command request)
     38 
     39 "Alice" and "Bob" are just usernames, they don't need to be real user system accounts in the remote server. 
     40 
     41 The way the splitops program works, is by associating a public SSH key to a username, but this username doesn't need to match, 
     42 with the real username you are using for a specific SSH public key. 
     43 
     44 Having these 2 lines in the .ssh/authorized_key files, will *force* --anyone trying to login in as root through SSH, 
     45 to execute the program: "splitops", so any other user not listed in this root/.ssh/authorized_key file, won't be able to do anything. 
     46 
     47 4) Logout from the remote server, and from your client machine, in order to start using the program Splitops, 
     48 try to "request" your very first command. This is done by using the splitops sub-command "propose". 
     49 
     50 e.g: ssh root@server propose rm -rf /opt/something
     51 
     52 After executing this, you will have some sort of answer from the server such as next:
     53 
     54 - authenticated as: bob
     55 - requested command: ['rm', '-rf', '/opt/something']
     56 - assigned id: ccafbd
     57 
     58 That means, your new command request, is waiting for approval. 
     59 
     60 Now, you (if you are either Alice or Bob), you can "approve" this command request, and afterwards wait for
     61 others to do the same thing (until the approval is complete for the number of users listed on the .ssh/authorized keys of the remote server).  
     62 
     63 Let's say you are Bob for now,
     64 ---------------------------------
     65 
     66 bob@computer:~$ root@server get # To see if you have anything pending to approve
     67 
     68 And you will see a list of pending requests. Now get the the ID of any request you want to approve, 
     69 let's say "ccafbd", then type:
     70 
     71 bob@computer:~$ root@server approve ccafbd
     72 
     73 Now you have to ask Alice, to approve the same request "ccafbd"
     74 
     75 Alice will do,
     76 
     77 alice@computer:~$ root@server approve ccafbd
     78 
     79 And finally you will be able to --remotely execute "as root", that specific and --approved command:
     80 
     81 bob@computer:~$ ssh root@server run ccafbd
     82 
     83 Summary
     84 ========
     85 
     86 Once the production remote server is up an running using the "splitops" command, a routine for you as "double-check systems administrator"
     87 would be to use the next splitops sub-commands (get, propose,approve, discargd, run...)
     88 
     89 alice@computer:~$ root@server get # To see if you any pending commands to approve
     90 alice@computer:~$ root@server approve "some ID" # To approve a specific command
     91 alice@computer:~$ root@server run "some ID" # To run, a specific approved command
     92 alice@computer:~$ root@server propose cp /opt/something /usr/local/something # (and wait)
     93 
     94 e.g 1) IF you try to "run" a command, but you don't have enough approvals, you will receive some output as this:
     95 
     96 - authenticated as: --user=javier
     97 - running command with ID bcb6a5
     98 - not enough approvals, got 1 but need 2
     99 
    100 e.g 2) If you try to connect to the remote server as --root, and without using any Splitops sub-command, you will receive the 
    101 next answer from the server:
    102 
    103 alice@computer:~$ ssh root@server
    104 - authenticated as: --user=alice
    105 - no command provided, try help
    106 - Connection to 78.141.227.64 closed.
    107 
    108 
    109 Full command list
    110 ===================
    111 CMDID= The hash assigned to each command request. 
    112 
    113 whoami: Check authentication
    114 propose CMD ...: Propose a new command
    115 get: Get the currently proposed command
    116 approve CMDID: Approve a command
    117 run CMDID: Run a sufficiently approved command
    118 discard: Discard the currently proposed command
    119 
    120 Please remember you have to use this sub-command remotely from your computer, towards the remote server, by using the "root" user. 
    121 Or with the user of your choice, who has on its .ssh/authorized_key file, the users list, with the OpenSSH "command= ..." option.
    122 
    123 [*]- Also take into account, if any other user "propose" a new command, the last "proposed" command will be discarded. The program doesn't use a stack 
    124 to store all requests, it works just with 1 single request. So even if you have been approved by several users, a specific CMDID, you won't be able 
    125 to run it, if a new command --proposal has been requested.
    126 
    127 [*] We encourage all users interested in using the Splitops command to use it first with a --normal user, and not with the root user. 
    128 So this way you can learn how the program behaves, without losing the connection with your server as the root user.