Command-Line Interface (CLI)

The Command-Line Interface (CLI) allows a user to inspect the state of emulations and to execute management operations from the command-line. The commands available in the CLI are listed in Tables 24-25. An example command and the resulting output is shown below.

kim@gpu2 ~> csle ls emulations --all
CSLE emulations:
csle-level9-010 [running]
csle-level1-010 [stopped]
csle-level2-010 [stopped]
csle-level3-010 [stopped]
csle-level4-010 [stopped]
csle-level5-010 [stopped]
csle-level6-010 [stopped]
csle-level7-010 [stopped]
csle-level8-010 [stopped]
csle-level10-010 [stopped]
csle-level11-010 [stopped]
csle-level12-010 [stopped]

Listing 4: The command "csle ls emulations --all" (line 1) and the output generated by the CSLE CLI (lines 2-14).

Command Description
csle attacker <em> <execid> Opens an attacker shell in a given execution.
csle clean all Removes all containers, networks, emulations, etc.
csle clean containers Removes all Docker containers in a given execution.
csle clean emulations Removes all emulations in a given execution.
csle clean emulation_traces Removes all emulation traces in a given execution.
csle clean simulation_traces Removes all simulation traces in a given execution.
csle clean emulation_statistics Removes all emulation statistics in a given execution.
csle clean emulation_executions Removes all emulation executions in a given execution.
csle em <emname> Get status of a given emulation.
csle em <emname> --host Get status of host managers in a given emulation.
csle em <emname> --stats Get status of stats managers in a given emulation.
csle em <emname> --kafka Get status of kafka managers in a given emulation.
csle em <emname> --snortids Get status of snortids in a given emulation.
csle em <emname> --clients Get status of clients in a given emulation.
csle em <emname> --executions Get status of executions in a given emulation.
csle em <emname> --executions Get status of executions in a given emulation.
csle init Initializes CSLE and sets up management accounts.
csle install emulations Install emulation environments.
csle install simulations Install simulation environments.
csle install <emname> Install a given emulation.
csle install <simname> Install a given simulation.
csle install derived images Install derived Docker images.
csle install base images Install base Docker images.
csle install metastore Install the metastore.
csle install all Install everything.
csle ls all List all information about entities.
csle ls containers List all containers.
csle ls networks List all networks.
csle ls images List all Docker images.
csle ls emulations List all emulations.
csle ls environments List all environments.
csle ls prometheus List status of Prometheus.
csle ls node_exporter List status of node exporter.
csle ls cadvisor List status of cadvisor.
csle ls statsmanager List status of statsmanager.
csle ls managementsystem List status of management system.
csle ls simulations List status of simulations.
csle ls emulation_executions List status of emulation executions.
csle ls <entity> --all List extended information of the given entity.
csle ls <entity> --running Only list information about running entities.
csle ls <entity> --stopped Only list information about stopped entities.
csle ls hostmanagers <emulationame> --id <emulationid> --ip <ip> Lists host managers on the specified ip sever.
csle ls clientmanager <emulationame> --id <emulationid> --ip <ip> Lists the client manager on the specified ip sever.
csle ls snortmanagers <emulationame> --id <emulationid> --ip <ip> Lists snort managers on the specified ip sever.
csle ls elkmanager <emulationame> --id <emulationid> --ip <ip> Lists the Elk manager on the specified ip sever.
csle ls trafficmanagers <emulationame> --id <emulationid> --ip <ip> Lists traffic managers on the specified ip sever.
csle ls kafkamanager <emulationame> --id <emulationid> --ip <ip> Lists the Kafka manager on the specified ip sever.
csle ls ossecmanagers <emulationame> --id <emulationid> --ip <ip> Lists Ossec managers on the specified ip sever.
csle ls ryumanager <emulationame> --id <emulationid> --ip <ip> Lists the Ryu manager on the specified ip sever.
csle ls filebeats <emulationame> --id <emulationid> --ip <ip> Lists filebeats on the specified ip sever.
csle ls metricbeats <emulationame> --id <emulationid> --ip <ip> Lists metricbeats on the specified ip sever.
csle ls heartbeats <emulationame> --id <emulationid> --ip <ip> Lists heartbeats on the specified ip sever.
csle ls packetbeats <emulationame> --id <emulationid> --ip <ip> Lists packetbeats on the specified ip sever.
csle rm <network> Removes the network with the given name.
csle rm <container> Removes the container with the given name.
csle rm <image> Removes the Docker image with the given name.
csle rm networks Removes all networks.
csle rm images Removes all images.
csle rm containers Removes all containers.

Table 24: Commands available in the CSLE command-line interface (1/2).

Command Description
csle shell <containername> Opens shell in a given container.
csle start prometheus Starts prometheus.
csle start node_exporter Starts node exporter.
csle start grafana Starts grafana.
csle start cadvisor Starts cadvisor.
csle start managementsystem Starts the management system.
csle start <containername> Starts the given container.
csle start <emulationname> Starts the given emulation.
csle start <emulationname> --no_network Starts the given emulation without virtual networks.
csle start <emulationname> --no_traffic Starts the given emulation without traffic generators.
csle start <emulationname> --no_beats Starts the given emulation without configuring/starting beats.
csle start <emulationname> --no_clients Starts the given emulation without clients.
csle start <emulationname> --id Starts the given emulation with execution id.
csle start all Starts everything.
csle start all --id Starts everything in an execution.
csle start statsmanager <port> <logdir> <logfile> <maxworkers> Starts statsmanager.
csle start <trainingjobid> Starts trainingjob with a given id.
csle start <systemidjobid> Starts system identification job with a given id.
csle start <image> <containername> Starts a container with a given image and name.
csle start_traffic <emulationname> <executionid> Starts the traffic and clients in execution.
csle statsmanager <port> <logdir> <logfile> <maxworkers> Starts the statsmanager.
csle start hostmanagers <emulationname> --id <emulationid> --ip <ip> Starts host managers on the specified ip sever.
csle start hostmanager <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts a host manager on the specified container.
csle start clientmanager <emulationname> --id <emulationid> --ip <ip> Starts a client managers on the specified ip sever.
csle start snortmanagers <emulationname> --id <emulationid> --ip <ip> Starts snort managers on the specified ip sever.
csle start snort manager <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts a snort manager on the specified container.
csle start elkmanager <emulationname> --id <emulationid> --ip <ip> Starts an Elk managers on the specified ip sever.
csle start traffic managers <emulationname> --id <emulationid> --ip <ip> Starts traffic managers on the specified ip sever.
csle start trafficmanager <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts a traffic manager on the specified container.
csle start ossecmanagers <emulationname> --id <emulationid> --ip <ip> Starts Ossec managers on the specified ip sever.
csle start ossecmanager <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts an Ossec manager on the specified container.
csle start ryumanager <emulationname> --id <emulationid> --ip <ip> Starts a Ryu managers on the specified ip sever.
csle start filebeats <emulationname> --id <emulationid> --ip <ip> Starts filebeats on the specified ip sever.
csle start filebeat <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts the filebeat on the specified container.
csle start metricbeats <emulationname> --id <emulationid> --ip <ip> Starts metricbeats on the specified ip sever.
csle start metricbeat <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts the metricbeat on the specified container.
csle start heartbeats <emulationname> --id <emulationid> --ip <ip> Starts heartbeats on the specified ip sever.
csle start heartbeat <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts the heartbeat on the specified container.
csle start packetbeats <emulationname> --id <emulationid> --ip <ip> Starts packetbeats on the specified ip sever.
csle start packetbeat <emulationname> --id <emulationid> --ip <ip> --container_ip <containerip> Starts the packetbeat on the specified container.
csle stop <emulationname> <execid> Stops the emulation execution.
csle stop <prometheus> Stops prometheus.
csle stop <cadvisor> Stops cadvisor.
csle stop <grafana> Stops grafana.
csle stop <managementsystem> Stops the management system.
csle stop <containername> <execid> Stops the container.
csle stop <statsmanager> Stops the statsmanager.
csle stop emulation_executions Stops all emulation executions.
csle stop all Stops everything that runs.
csle stop_traffic <emulationname> <execid> Stops client population and traffic in execution.
csle stop hostmanagers <emulationname> <emulationid> --ip <ip> Stops host managers on the specified ip sever.
csle stop hostmanager <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops a host manager on the specified container.
csle stop clientmanager <emulationname> <emulationid> --ip <ip> Stops a client managers on the specified ip sever.
csle stop snortmanagers <emulationname> <emulationid> --ip <ip> Stops snort managers on the specified ip sever.
csle stop snort manager <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops a snort manager on the specified container.
csle stop elkmanager <emulationname> <emulationid> --ip <ip> Stops an Elk managers on the specified ip sever.
csle stop traffic managers <emulationname> <emulationid> --ip <ip> Stops traffic managers on the specified ip sever.
csle stop trafficmanager <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops a traffic manager on the specified container.
csle stop ossecmanagers <emulationname> <emulationid> --ip <ip> Stops Ossec managers on the specified ip sever.
csle stop ossecmanager <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops an Ossec manager on the specified container.
csle stop ryumanager <emulationname> <emulationid> --ip <ip> Stops a Ryu managers on the specified ip sever.
csle stop filebeats <emulationname> <emulationid> --ip <ip> Stops filebeats on the specified ip sever.
csle stop filebeat <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops the filebeat on the specified container.
csle stop metricbeats <emulationname> <emulationid> --ip <ip> Stops metricbeats on the specified ip sever.
csle stop metricbeat <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops the metricbeat on the specified container.
csle stop heartbeats <emulationname> <emulationid> --ip <ip> Stops heartbeats on the specified ip sever.
csle stop heartbeat <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops the heartbeat on the specified container.
csle stop packetbeats <emulationname> <emulationid> --ip <ip> Stops packetbeats on the specified ip sever.
csle stop packetbeat <emulationname> <emulationid> --ip <ip> --container_ip <containerip> Stops the packetbeat on the specified container.
csle systemidentificationjob <jobid> Starts job.
csle trainingjob <jobid> Starts job.
csle datacollectionjob <jobid> Starts job.
csle uninstall emulations Uninstalls emulation environments.
csle uninstall simulations Uninstalls simulation environments.
csle uninstall <emname> Uninstalls emulation.
csle uninstall <simname> Uninstalls simulation.
csle uninstall derived_images Uninstalls derived images.
csle uninstall base_images Uninstalls base images.
csle uninstall metastore Uninstalls metastore.
csle uninstall all Uninstalls everything.
csle help Lists all available commands

Table 25: Commands available in the CSLE command-line interface (2/2).