Skip to content

Commit 0e49127

Browse files
authored
Merge pull request #10 from nsec/updated_track_yaml_schema
Updated track.yaml.json schema.
2 parents 1241bec + 7220ef4 commit 0e49127

File tree

2 files changed

+164
-145
lines changed

2 files changed

+164
-145
lines changed

ctf/schemas/track.yaml.json

Lines changed: 163 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,176 @@
11
{
2-
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"description": "",
4-
"type": "object",
5-
"additionalProperties": false,
6-
"properties": {
7-
"name": {
8-
"type": "string",
9-
"minLength": 1,
10-
"description": "Name of the track."
11-
},
12-
"description": {
13-
"type": "string",
14-
"minLength": 1,
15-
"description": "Description of the track."
16-
},
17-
"integrated_with_scenario": {
18-
"type": "boolean",
19-
"description": "Set to true only if the track has been integrated with the CTF scenario. This means that Eric Boivin wrote/modified the posts."
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"description": "",
4+
"type": "object",
5+
"additionalProperties": false,
6+
"properties": {
7+
"name": {
8+
"type": "string",
9+
"minLength": 1,
10+
"description": "Name of the track."
11+
},
12+
"description": {
13+
"type": "string",
14+
"minLength": 1,
15+
"description": "Description of the track."
16+
},
17+
"integrated_with_scenario": {
18+
"type": "boolean",
19+
"description": "Set to true only if the track has been integrated with the CTF scenario. This means that Eric Boivin wrote/modified the posts."
20+
},
21+
"contacts": {
22+
"description": "Handles or real names. Ex: John Smith or jsmith",
23+
"type": "object",
24+
"properties": {
25+
"additionalProperties": false,
26+
"dev": {
27+
"description": "Who helped develop the track.",
28+
"type": "array",
29+
"uniqueItems": true,
30+
"items": {
31+
"type": "string"
32+
}
33+
},
34+
"qa": {
35+
"description": "Who helped do quality assurance for the track.",
36+
"type": "array",
37+
"uniqueItems": true,
38+
"items": {
39+
"type": "string"
40+
}
41+
},
42+
"support": {
43+
"description": "Who can provide support during the CTF for the track.",
44+
"type": "array",
45+
"uniqueItems": true,
46+
"items": {
47+
"type": "string"
48+
}
49+
}
2050
},
21-
"contacts": {
22-
"description": "Handles or real names. Ex: Émilio Gonzalez or Res260",
23-
"type": "object",
51+
"required": [
52+
"dev",
53+
"qa",
54+
"support"
55+
]
56+
},
57+
"services": {
58+
"description": "List of network services used by the track.",
59+
"type": "array",
60+
"uniqueItems": true,
61+
"items": {
62+
"required": [
63+
"name",
64+
"address",
65+
"port",
66+
"check"
67+
],
2468
"properties": {
2569
"additionalProperties": false,
26-
"dev": {
27-
"description": "Who helped develop the track.",
28-
"type": "array",
29-
"uniqueItems": true,
30-
"items": {
31-
"type": "string"
32-
}
70+
"name": {
71+
"description": "Name of the network servic. Example: Tomcat Web Server",
72+
"type": "string",
73+
"minLength": 1
3374
},
34-
"qa": {
35-
"description": "Who helped do quality assurance for the track.",
36-
"type": "array",
37-
"uniqueItems": true,
38-
"items": {
39-
"type": "string"
40-
}
75+
"address": {
76+
"description": "IPv6 address of the network service.",
77+
"type": "string",
78+
"minLength": 36,
79+
"maxLength": 39
4180
},
42-
"support": {
43-
"description": "Who can provide support during the CTF for the track.",
44-
"type": "array",
45-
"uniqueItems": true,
46-
"items": {
47-
"type": "string"
48-
}
49-
}
50-
},
51-
"required": [
52-
"dev",
53-
"qa",
54-
"support"
55-
]
56-
},
57-
"services": {
58-
"description": "List of network services used by the track.",
59-
"type": "array",
60-
"uniqueItems": true,
61-
"items": {
62-
"required": [
63-
"name",
64-
"address",
65-
"port",
66-
"check"
67-
],
68-
"properties": {
69-
"additionalProperties": false,
70-
"name": {
71-
"description": "Name of the network servic. Example: Tomcat Web Server",
72-
"type": "string",
73-
"minLength": 1
74-
},
75-
"address": {
76-
"description": "IPv6 address of the network service.",
77-
"type": "string",
78-
"minLength": 36,
79-
"maxLength": 39
80-
},
81-
"port": {
82-
"description": "Port number where the network service listens on.",
83-
"type": "number"
84-
},
85-
"check": {
86-
"description": "Type of check to do to make sure this service is up and alert us during the CTF if it's down.",
87-
"type": "string",
88-
"enum": ["http", "https", "ssh", "tcp"]
89-
},
90-
"dev_port_mapping": {
91-
"type": "integer",
92-
"minimum": 1,
93-
"maximum": 65535,
94-
"description": "During development, this service will be accessible from localhost:<value>. This allows to access the services outside the host (for example from the Windows Host if using WSL or from your host machine if using GitHub Codespaces)."
95-
}
81+
"port": {
82+
"description": "Port number where the network service listens on.",
83+
"type": "number"
84+
},
85+
"check": {
86+
"description": "Type of check to do to make sure this service is up and alert us during the CTF if it's down.",
87+
"type": "string",
88+
"enum": [
89+
"http",
90+
"https",
91+
"ssh",
92+
"tcp"
93+
]
94+
},
95+
"dev_port_mapping": {
96+
"type": "integer",
97+
"minimum": 1,
98+
"maximum": 65535,
99+
"description": "During development, this service will be accessible from localhost:<value>. This allows to access the services outside the host (for example from the Windows Host if using WSL or from your host machine if using GitHub Codespaces)."
96100
}
97101
}
98-
},
99-
"flags": {
100-
"description": "The list of flags in the track.",
101-
"type": "array",
102-
"minItems": 0,
103-
"maxItems": 20,
104-
"uniqueItems": true,
105-
"items": {
106-
"description": "A flag definition.",
107-
"type": "object",
108-
"required": ["flag", "value", "return_string"],
109-
"additionalProperties": false,
110-
"properties": {
111-
"flag": {
112-
"type": "string",
113-
"description": "The flag string. Ex: FLAG-SalutLaGang.",
114-
"minLength": 5,
115-
"maxLength": 200
116-
},
117-
"value": {
118-
"type": "integer",
119-
"description": "The value of the flag. Minimum: 0.",
120-
"minimum": 0,
121-
"maximum": 20
122-
},
123-
"description": {
124-
"type": "string",
125-
"description": "INTERNAL description of the flag. Example: Free flag in source of index.php.",
126-
"minLength": 1
127-
},
128-
"return_string": {
129-
"type": "string",
130-
"description": "The text the participants see AFTER they submit the flag. Example: [mytrackname] 1/1 Good job! Track completed.",
131-
"minLength": 1
132-
},
133-
"tags": {
134-
"type": "object",
135-
"description": "Askgod tags for this flag. Use tag `discourse: sometriggername` to define triggers for posts in the posts/ directory.",
136-
"additionalProperties": true,
137-
"properties": {
138-
"discourse": {
139-
"type": "string",
140-
"description": "Discourse trigger for this flag. This value can be used in a discourse post defined in the posts/ directory to post a message when this flag is submitted.",
141-
"pattern": "^[a-z][a-z0-9_]{0,61}[a-z0-9]$"
142-
}
102+
}
103+
},
104+
"flags": {
105+
"description": "The list of flags in the track.",
106+
"type": "array",
107+
"minItems": 0,
108+
"maxItems": 20,
109+
"uniqueItems": true,
110+
"items": {
111+
"description": "A flag definition.",
112+
"type": "object",
113+
"required": [
114+
"flag",
115+
"value",
116+
"return_string"
117+
],
118+
"additionalProperties": false,
119+
"properties": {
120+
"flag": {
121+
"type": "string",
122+
"description": "The flag string. Ex: FLAG-SalutLaGang.",
123+
"minLength": 5,
124+
"maxLength": 200
125+
},
126+
"value": {
127+
"type": "integer",
128+
"description": "The value of the flag. Minimum: 0.",
129+
"minimum": 0,
130+
"maximum": 20
131+
},
132+
"description": {
133+
"type": "string",
134+
"description": "INTERNAL description of the flag. Example: Free flag in source of index.php.",
135+
"minLength": 1
136+
},
137+
"return_string": {
138+
"type": "string",
139+
"description": "The text the participants see AFTER they submit the flag. Example: [mytrackname] 1/1 Good job! Track completed.",
140+
"minLength": 1
141+
},
142+
"tags": {
143+
"type": "object",
144+
"description": "Askgod tags for this flag. Use tag `discourse: sometriggername` to define triggers for posts in the posts/ directory.",
145+
"additionalProperties": true,
146+
"properties": {
147+
"discourse": {
148+
"type": "string",
149+
"description": "Discourse trigger for this flag. This value can be used in a discourse post defined in the posts/ directory to post a message when this flag is submitted.",
150+
"pattern": "^[a-z][a-z0-9_]{0,61}[a-z0-9]$"
151+
},
152+
"ui_sound": {
153+
"type": "string",
154+
"description": "Fireworks sound trigger for this flag. This value can be used to trigger a specific sound in the timeline when this flag is submitted. The chosen file can be any of the default ones which can be found at https://github.com/nsec/askgod-webui/blob/master/components/Fireworks.vue#L72-L88 or new ones added in \"challenges/your-track/files/askgod/sounds/*.mp3\".",
155+
"pattern": "^[a-zA-Z0-9_-]{1,251}\\.[a-zA-Z0-9]{2,5}$"
156+
},
157+
"ui_gif": {
158+
"type": "string",
159+
"description": "Fireworks gif trigger for this flag. This value can be used to trigger a specific gif in the timeline when this flag is submitted. The chosen file can be any of the default ones which can be found at https://github.com/nsec/askgod-webui/blob/master/components/Fireworks.vue#L39-L70 or new ones added in \"challenges/your-track/files/askgod/gifs/*.gif\".",
160+
"pattern": "^[a-zA-Z0-9_-]{1,251}\\.[a-zA-Z0-9]{2,5}$"
143161
}
144162
}
145163
}
146164
}
147165
}
148-
},
149-
"required": [
150-
"name",
151-
"description",
152-
"integrated_with_scenario",
153-
"contacts",
154-
"services",
155-
"flags"
156-
]
157-
}
166+
}
167+
},
168+
"required": [
169+
"name",
170+
"description",
171+
"integrated_with_scenario",
172+
"contacts",
173+
"services",
174+
"flags"
175+
]
176+
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"black",
1919
"tabulate==0.9.0",
2020
]
21-
version = "1.0.1"
21+
version = "1.0.2"
2222
classifiers = [
2323
"Programming Language :: Python :: 3",
2424
"Operating System :: OS Independent",

0 commit comments

Comments
 (0)