about summary refs log tree commit diff
path: root/README.md
blob: bb045482947ac77e6fa118e873b29a4a077095b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# circus-manager [![Go Report Card](https://goreportcard.com/badge/git.darknebu.la/circus/circus-manager)](https://goreportcard.com/report/git.darknebu.la/circus/circus-manager)

This container will provide the challenges for the companion container making it possible to dynamically change challenges and host the circus in docker-swarm. It will serve as a central manager making it possible to controll the challenge properties such as name, desription, flag, container to run, points and other.

## Function

The challenge-manager is part of the docker swarm providing the challenges for
the individual companion containers.
The spawned companion containers access the challenge-manager, requesting the
challenges, recieving them and hosting them for the users.

In order to not transfer the flag over a possibly insecure connection, the
sha256 sum of the flag is transmitted. The companion containers can verify the
flag by hashing it (sha256), comparing the hashes and so defining if a challenge
is solved or not.

## api

### [pad with sequence diagrams](https://md.darknebu.la/uWwaEZkxRHiepsOQOHFjYA?view)



The manager exposes the challenges for the companion containers to use. The
endpoint for this is `/api/getChallenges` returning some json in the following
form:

```json
{
  "categories": {
    "guess": 1,
    "misc": 2,
    "pwn": 1
  },
  "challenges": [
    {
      "name": "random challenge name",
      "description": "some bad description",
      "flaghash": "6a1e963371a64b32aff302ef7f3a7d6df8df903fce10f3db6ee918f18ac11f2a",
      "container": "container-randomchallenge",
      "category": "guess",
      "points": 100,
      "static": false
    },
    {
      "name": "challenge 3",
      "description": "This is a rather long description describing how the challenge works, what might be helpful and other boring stuff...",
      "flaghash": "f87f2dc623bb1896707c68532993e434e3484c2316629814e8919dfeb5993a0a",
      "container": "container-challengethree",
      "category": "misc",
      "points": 300,
      "static": true
    },
    ...
  ]
}

```