Skip to content

Commit

Permalink
Add example repo with some challenges to use for testing
Browse files Browse the repository at this point in the history
Includes one chal with only static files, and another with a container build.

Signed-off-by: Robert Detjens <[email protected]>
  • Loading branch information
detjensrobert committed Oct 12, 2024
1 parent 98bf272 commit b8b0671
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 10 deletions.
1 change: 0 additions & 1 deletion tests/repo/misc/foo/challenge.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions tests/repo/misc/garf/challenge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: garf
author: some guy
description: |
enjoy this funky image
# used for point values in rcds.yaml
# 0 for survey/rules chal?
# default: 1
difficulty: 1

# alternatively, flag: dam{wtf}
flag:
text: dam{garf}

# on-disk files or CI-generated zip of build artifacts?
provide:
- garf.webp
Binary file added tests/repo/misc/garf/garf.webp
Binary file not shown.
22 changes: 13 additions & 9 deletions tests/repo/rcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ flag_regex: dam{[a-zA-Z...]}
registry:
domain: registry.example.com/damctf
# then environment variables e.g. REG_USER/REG_PASS
user: admin
pass: admin
build:
user: admin
pass: notrealcreds
cluster:
user: cluster
pass: alsofake

defaults:
difficulty: 1
Expand All @@ -17,21 +21,21 @@ points:

deploy:
# control challenge deployment status explicitly per environment/profile
staging:
testing:
misc/foo: true
rev/bar: false

profiles:
# configure per-environment credentials etc
staging:
testing:
frontend_url: https://frontend.example
# or environment var (recommended): FRONTEND_TOKEN_$PROFILE=secretsecretsecret
frontend_token: secret
frontend_token: secretsecretsecret
challenges_domain: chals.frontend.example
kubeconfig: path/to/kubeconfig
kubecontext: damctf-cluster
s3:
endpoint: x
# local minio
endpoint: localhost:9000
region: x
accessKey: key
secretAccessKey: secret
accessKey: accesskey
secretAccessKey: secretkey
3 changes: 3 additions & 0 deletions tests/repo/web/bar/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM nginx

COPY site_source/ /var/www/html/
21 changes: 21 additions & 0 deletions tests/repo/web/bar/challenge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: bar
author: foo bar
description: |
can you order a drink from the webserver?
{{ url }}
difficulty: 1

flag:
file: ./flag

# each individual pod is gonna allow only 1 container for now
pods:
- name: bar
build: ./
replicas: 1
ports:
- internal: 80
expose:
http: bar.chals.frontend.example
Binary file added tests/repo/web/bar/site_source/blue_moon_tap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/repo/web/bar/site_source/flag
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dam{bar}
26 changes: 26 additions & 0 deletions tests/repo/web/bar/site_source/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>

<html lang="en">
<head>
<meta charset="UTF-8" />
<title>give me a drink</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="description" content="" />

<style>
body {
background: center;
background-image: url("/blue_moon_tap.jpg");
background-repeat: no-repeat;
background-size: cover;

width: 100vw;
height: 100vh;
}
</style>
</head>

<body>
<a hidden href="/flag">red team dont drink</a>
</body>
</html>

0 comments on commit b8b0671

Please sign in to comment.