Skip to content

Automation: Verify Server Configuration

@AlanOrlikoski edited this page Mar 21, 2018 · 8 revisions

Must complete the steps to setup the CCF-VM automation script found on Automation-Setup: CCF-VM prior to running these tests

Assumptions

  1. The otto_rsa private key is readable by user performing tests and is stored in /tmp/otto_rsa
  2. localhost resolves to 127.0.0.1
  3. No firewalls or other issues are blocking this communication
  4. If on a remote device replace localhost with the resolvable FQDN or IP address for the CCF-VM server and ensure that TCP port 22 is allowed from the testing device to the CCF-VM server

Testing OS Commands

Stop a Service (and the expected response)

~$ ssh -t -i otto_rsa ottomate@localhost os --service stop $(echo timesketch|base64)
Executing Operating System command
Attempting to stop/start/restart a service
WARNING!! This requires sudo privledges and the process will hang if a password is required
WARNING!! It is advised to only use this function with key-pair authentication
Stoping: timesketch
SUCCESS: CCF-VM Automation Engine Completed
Connection to localhost closed.

Verify TimeSketch service is stopped

~$ systemctl is-active timesketch
inactive

Start a Service (and the expected response)

~$ ssh -t -i otto_rsa [email protected] os --service start $(echo timesketch|base64)
Executing Operating System command
Attempting to stop/start/restart a service
WARNING!! This requires sudo privledges and the process will hang if a password is required
WARNING!! It is advised to only use this function with key-pair authentication
Starting / Restarting: timesketch
SUCCESS: CCF-VM Automation Engine Completed
Connection to 10.1.0.43 closed.

Verify TimeSketch service is started

~$ systemctl is-active timesketch
active

Restart the server

WARNING!!! THIS WILL RESTART THE SERVER

~$ ssh -t -i otto_rsa [email protected] os --server restart
Executing Operating System command
Attempting to stop or restart the server
WARNING!! There will not be any acknowledgment if this worked due to stopping the server
WARNING!! This requires sudo privledges and the process will hang if a password is required
WARNING!! It is advised to only use this function with key-pair authentication
Attempting to restart the server
sudo shutdown -r now

Stop the server

WARNING!!! THIS WILL STOP THE SERVER

~$ ssh -t -i otto_rsa [email protected] os --server stop
Executing Operating System command
Attempting to stop or restart the server
WARNING!! There will not be any acknowledgment if this worked due to stopping the server
WARNING!! This requires sudo privledges and the process will hang if a password is required
WARNING!! It is advised to only use this function with key-pair authentication
Attempting to restart the server
sudo shutdown -h now