-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
426 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "ctfd_challenges Data Source - terraform-provider-ctfd" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# ctfd_challenges (Data Source) | ||
|
||
|
||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Read-Only | ||
|
||
- `challenges` (Attributes List) (see [below for nested schema](#nestedatt--challenges)) | ||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedatt--challenges"></a> | ||
### Nested Schema for `challenges` | ||
|
||
Read-Only: | ||
|
||
- `category` (String) Category of the challenge that CTFd groups by on the web UI. | ||
- `connection_info` (String) Connection Information to connect to the challenge instance, usefull for pwn or web pentest. | ||
- `decay` (Number) | ||
- `description` (String) Description of the challenge, consider using multiline descriptions for better style. | ||
- `files` (Attributes List) List of files given to players to flag the challenge. (see [below for nested schema](#nestedatt--challenges--files)) | ||
- `flags` (Attributes List) List of challenge flags that solves it. (see [below for nested schema](#nestedatt--challenges--flags)) | ||
- `function` (String) Decay function to define how the challenge value evolve through solves, either linear or logarithmic. | ||
- `hints` (Attributes List) List of hints about the challenge displayed to the end-user. (see [below for nested schema](#nestedatt--challenges--hints)) | ||
- `id` (String) Identifier of the challenge. | ||
- `initial` (Number) | ||
- `max_attempts` (Number) Maximum amount of attempts before being unable to flag the challenge. | ||
- `minimum` (Number) | ||
- `name` (String) Name of the challenge, displayed as it. | ||
- `requirements` (Attributes) List of required challenges that needs to get flagged before this one being accessible. Usefull for skill-trees-like strategy CTF. (see [below for nested schema](#nestedatt--challenges--requirements)) | ||
- `state` (String) State of the challenge, either hidden or visible. | ||
- `tags` (List of String) List of challenge tags that will be displayed to the end-user. You could use them to give some quick insights of what a challenge involves. | ||
- `topics` (List of String) List of challenge topics that are displayed to the administrators for maintenance and planification. | ||
- `type` (String) Type of the challenge defining its layout, either standard or dynamic. | ||
- `value` (Number) | ||
|
||
<a id="nestedatt--challenges--files"></a> | ||
### Nested Schema for `challenges.files` | ||
|
||
Read-Only: | ||
|
||
- `content` (String) | ||
- `contentb64` (String) | ||
- `id` (String) | ||
- `location` (String) | ||
- `name` (String) | ||
|
||
|
||
<a id="nestedatt--challenges--flags"></a> | ||
### Nested Schema for `challenges.flags` | ||
|
||
Read-Only: | ||
|
||
- `content` (String) | ||
- `data` (String) | ||
- `id` (String) | ||
- `type` (String) | ||
|
||
|
||
<a id="nestedatt--challenges--hints"></a> | ||
### Nested Schema for `challenges.hints` | ||
|
||
Read-Only: | ||
|
||
- `content` (String) | ||
- `cost` (Number) | ||
- `id` (String) | ||
- `requirements` (List of String) | ||
|
||
|
||
<a id="nestedatt--challenges--requirements"></a> | ||
### Nested Schema for `challenges.requirements` | ||
|
||
Read-Only: | ||
|
||
- `behavior` (String) Behavior if not unlocked, either hidden or anonymized. | ||
- `prerequisites` (List of String) List of the challenges ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "ctfd Provider" | ||
subcategory: "" | ||
description: |- | ||
Interact with a CTFd https://github.com/ctfd/ctfd. | ||
--- | ||
|
||
# ctfd Provider | ||
|
||
Interact with a [CTFd](https://github.com/ctfd/ctfd). | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "ctfd" { | ||
url = "https://my-ctfd.lan" | ||
api_key = "ctfd_somerandomvalue" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `api_key` (String, Sensitive) User API key. Could use `CTFD_API_KEY` environment variable instead. Despite being the most convenient way to authenticate yourself, we do not recommend it as you will probably generate a long-live token without any rotation policy. | ||
- `nonce` (String, Sensitive) User session nonce, comes with session. Could use `CTFD_NONCE` environment variable instead. | ||
- `session` (String, Sensitive) User session token, comes with nonce. Could use `CTFD_SESSION` environment variable instead. | ||
- `url` (String) CTFd base URL (e.g. `https://my-ctf.lan`). Could use `CTFD_URL` environment variable instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "ctfd_challenge Resource - terraform-provider-ctfd" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# ctfd_challenge (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "ctfd_challenge" "http" { | ||
name = "HTTP Authentication" | ||
category = "network" | ||
description = <<-EOT | ||
Oh no ! I did not see my connection was no encrypted ! | ||
I hope no one spied me... | ||
Authors: | ||
- NicolasFgrx | ||
EOT | ||
value = 500 | ||
initial = 500 | ||
decay = 17 | ||
minimum = 50 | ||
state = "visible" | ||
function = "logarithmic" | ||
flags = [{ | ||
content = "24HIUT{Http_1s_n0t_s3cuR3}" | ||
}] | ||
topics = [ | ||
"Network" | ||
] | ||
tags = [ | ||
"network", | ||
"http" | ||
] | ||
hints = [{ | ||
content = "HTTP exchanges are not ciphered." | ||
cost = 50 | ||
}, { | ||
content = "Content is POSTed in HTTP :)" | ||
cost = 50 | ||
}] | ||
files = [{ | ||
name = "capture.pcapng" | ||
contentb64 = filebase64("${path.module}/capture.pcapng") | ||
}] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `category` (String) Category of the challenge that CTFd groups by on the web UI. | ||
- `description` (String) Description of the challenge, consider using multiline descriptions for better style. | ||
- `name` (String) Name of the challenge, displayed as it. | ||
|
||
### Optional | ||
|
||
- `connection_info` (String) Connection Information to connect to the challenge instance, usefull for pwn or web pentest. | ||
- `decay` (Number) | ||
- `files` (Attributes List) List of files given to players to flag the challenge. (see [below for nested schema](#nestedatt--files)) | ||
- `flags` (Attributes List) List of challenge flags that solves it. (see [below for nested schema](#nestedatt--flags)) | ||
- `function` (String) Decay function to define how the challenge value evolve through solves, either linear or logarithmic. | ||
- `hints` (Attributes List) List of hints about the challenge displayed to the end-user. (see [below for nested schema](#nestedatt--hints)) | ||
- `initial` (Number) | ||
- `max_attempts` (Number) Maximum amount of attempts before being unable to flag the challenge. | ||
- `minimum` (Number) | ||
- `requirements` (Attributes) List of required challenges that needs to get flagged before this one being accessible. Usefull for skill-trees-like strategy CTF. (see [below for nested schema](#nestedatt--requirements)) | ||
- `state` (String) State of the challenge, either hidden or visible. | ||
- `tags` (List of String) List of challenge tags that will be displayed to the end-user. You could use them to give some quick insights of what a challenge involves. | ||
- `topics` (List of String) List of challenge topics that are displayed to the administrators for maintenance and planification. | ||
- `type` (String) Type of the challenge defining its layout, either standard or dynamic. | ||
- `value` (Number) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Identifier of the challenge. | ||
|
||
<a id="nestedatt--files"></a> | ||
### Nested Schema for `files` | ||
|
||
Required: | ||
|
||
- `name` (String) Name of the file as displayed to end-users. | ||
|
||
Optional: | ||
|
||
- `content` (String, Sensitive) Raw content of the file, perfectly fit the use-cases of a .txt document or anything with a simple binary content. You could provide it from the file-system using `file("${path.module}/...")`. | ||
- `contentb64` (String, Sensitive) Base 64 content of the file, perfectly fit the use-cases of complex binaries. You could provide it from the file-system using `filebase64("${path.module}/...")`. | ||
|
||
Read-Only: | ||
|
||
- `id` (String) Identifier of the file, used internally to handle the CTFd corresponding object. | ||
- `location` (String) Location where the file is stored on the CTFd instance, for download purposes. | ||
|
||
|
||
<a id="nestedatt--flags"></a> | ||
### Nested Schema for `flags` | ||
|
||
Required: | ||
|
||
- `content` (String, Sensitive) The actual flag to match. Consider using the convention `MYCTF{value}` with `MYCTF` being the shortcode of your event's name and `value` depending on each challenge. | ||
|
||
Optional: | ||
|
||
- `data` (String) The flag sensitivity information, either case_sensitive or case_insensitive | ||
- `type` (String) The type of the flag, could be either static or regex | ||
|
||
Read-Only: | ||
|
||
- `id` (String) Identifier of the flag, used internally to handle the CTFd corresponding object. | ||
|
||
|
||
<a id="nestedatt--hints"></a> | ||
### Nested Schema for `hints` | ||
|
||
Required: | ||
|
||
- `content` (String) Content of the hint as displayed to the end-user. | ||
|
||
Optional: | ||
|
||
- `cost` (Number) Cost of the hint, and if any specified, the end-user will consume its own (or team) points to get it. | ||
- `requirements` (List of String) Other hints required to be consumed before getting this one. Usefull for cost-increasing hint strategies with more and more help. | ||
|
||
Read-Only: | ||
|
||
- `id` (String) Identifier of the hint, used internally to handle the CTFd corresponding object. | ||
|
||
|
||
<a id="nestedatt--requirements"></a> | ||
### Nested Schema for `requirements` | ||
|
||
Optional: | ||
|
||
- `behavior` (String) Behavior if not unlocked, either hidden or anonymized. | ||
- `prerequisites` (List of String) List of the challenges ID. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# Challenge can be imported by the CTFd ID (check URLs) | ||
terraform import ctfd_challenge.http 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
provider "ctfd" { | ||
url = "https://my-ctfd.lan" | ||
api_key = "ctfd_somerandomvalue" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Challenge can be imported by the CTFd ID (check URLs) | ||
terraform import ctfd_challenge.http 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
resource "ctfd_challenge" "http" { | ||
name = "HTTP Authentication" | ||
category = "network" | ||
description = <<-EOT | ||
Oh no ! I did not see my connection was no encrypted ! | ||
I hope no one spied me... | ||
Authors: | ||
- NicolasFgrx | ||
EOT | ||
value = 500 | ||
initial = 500 | ||
decay = 17 | ||
minimum = 50 | ||
state = "visible" | ||
function = "logarithmic" | ||
|
||
flags = [{ | ||
content = "24HIUT{Http_1s_n0t_s3cuR3}" | ||
}] | ||
|
||
topics = [ | ||
"Network" | ||
] | ||
tags = [ | ||
"network", | ||
"http" | ||
] | ||
|
||
hints = [{ | ||
content = "HTTP exchanges are not ciphered." | ||
cost = 50 | ||
}, { | ||
content = "Content is POSTed in HTTP :)" | ||
cost = 50 | ||
}] | ||
|
||
files = [{ | ||
name = "capture.pcapng" | ||
contentb64 = filebase64("${path.module}/capture.pcapng") | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.