Skip to content

CLI specification

eyjhbb@gmail.com edited this page Nov 3, 2018 · 11 revisions

Syntax

  • Square brackets [] are required arguments
  • Round brackets () are optional arguments

Supported commands

For cli version 1.0 we consider the same functionality that go-ntp also provided beforehand. The commands to implement are as follows:

  • ntp user invite - generates a signup key (superuser only).
  • ntp user signup - prompt for signup key, username and password.
  • ntp user login - prompt for username and password.
  • ntp event create [event tag] [-n name] (-b buffer) (-c capacity) (-f frontends) (-ex exercises) - creates a event
  • ntp event stop [event tag] - stop a event with that tag.
  • ntp event teams [event tag] - list the teams that participate in the event.
  • ntp event ls - list all currently running events.
  • ntp events - list all currently running events. Example output:
  • ntp exercise - list all currently running events. Example output:
  • ntp exercise reset [tag] [-ev event_id] (-t team_ids) - reset a certain exercise for an event for a set of teams (used to fix exercises that have been broken by the teams themselves).
  • ntp exercise ls - list all available exercises to use in events
  • ntp exercises - list all available exercises to use in events
  • ntp frontend ls - list all available frontends to use in events
  • ntp frontends - list all available frontends to use in events

Example output - ntp events

EVENT TAG   NAME            # TEAMS    # EXERCISES     CAPACITY
test        Test event      13          4               20
exam        Important exam  25          2               25
htx         HTX event       56          8               60

Example output - ntp event teams [event tag]

TEAM ID          NAME              EMAIL
f58a13m          BestTeam          kh@es.aau.dk
jg018do          WorstTeam         tkp@es.aau.dk

Upcoming commands

And a non-exhaustive list of future additions:

  • ntp exercise update [id] (-ev event_id) - update a certain exercise to its newest version (from the docker registry) and update running instances with the updated version (used for fixing broken exercises on the fly).
  • ntp event list [tag] exercises - list the exercises used in the event. Example output:
EXERCISE ID
sql
xss
phishing
  • ntp event list [id] instances (-t team_ids) (-i image_ids) - list the images for a certain event, with the option to filter on team- and image identifiers. Will be used to get an overview of what versions of images certain teams are running and to identify outliers. Example output (note that the N denotes the newest version of the image):
IMAGE ID                   TYPE      DIGEST         TEAM ID
aau/sqlinjection-client    docker    N jb8mn21      f58a13m, jg018do
aau/sqlinjection-server    docker    N f81jbz9      f58a13m, jg018do
tpanum/unbound             docker    N 4efh9a       f58a13m
                                       8al134a      jg018do
windows                    vm        N 74ab21a      f58a13m, jg018do
  • ntp team reset [team id] lab - Reset the lab of a team. In case of complete failure (for instance breaking their kali VM).