Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial example repo with some challenges to use for testing #16

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.jpg
Binary file added tests/repo/misc/garf/garf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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>