@ctfer-io/pulumi-ctfd
Version:
The CTFd provider for Pulumi, to manage its resources as code.
290 lines • 11.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* CTFd is built around the Challenge resource, which contains all the attributes to define a part of the Capture The Flag event.
*
* This implementation has support of a more dynamic behavior for its scoring through time/solves thus is different from a standard challenge.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as ctfd from "@ctfer-io/pulumi-ctfd";
* import * as fs from "fs";
*
* const http = new ctfd.ChallengeDynamic("http", {
* category: "misc",
* description: "...",
* value: 500,
* decay: 100,
* minimum: 50,
* state: "visible",
* "function": "logarithmic",
* topics: ["Misc"],
* tags: [
* "misc",
* "basic",
* ],
* });
* const httpFlag = new ctfd.Flag("httpFlag", {
* challengeId: http.id,
* content: "CTF{some_flag}",
* });
* const httpHint1 = new ctfd.Hint("httpHint1", {
* challengeId: http.id,
* content: "Some super-helpful hint",
* cost: 50,
* });
* const httpHint2 = new ctfd.Hint("httpHint2", {
* challengeId: http.id,
* content: "Even more helpful hint !",
* cost: 50,
* requirements: [httpHint1.id],
* });
* const httpFile = new ctfd.File("httpFile", {
* challengeId: http.id,
* contentb64: fs.readFileSync(".../image.png", { encoding: "base64" }),
* });
* ```
*/
export declare class ChallengeDynamic extends pulumi.CustomResource {
/**
* Get an existing ChallengeDynamic resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ChallengeDynamicState, opts?: pulumi.CustomResourceOptions): ChallengeDynamic;
/**
* Returns true if the given object is an instance of ChallengeDynamic. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is ChallengeDynamic;
/**
* Attribution to the creator(s) of the challenge.
*/
readonly attribution: pulumi.Output<string | undefined>;
/**
* Category of the challenge that CTFd groups by on the web UI.
*/
readonly category: pulumi.Output<string>;
/**
* Connection Information to connect to the challenge instance, useful for pwn, web and infrastructure pentests.
*/
readonly connectionInfo: pulumi.Output<string>;
/**
* The decay defines from each number of solves does the decay function triggers until reaching minimum. This function is defined by CTFd and could be configured through `.function`.
*/
readonly decay: pulumi.Output<number>;
/**
* Description of the challenge, consider using multiline descriptions for better style.
*/
readonly description: pulumi.Output<string>;
/**
* Decay function to define how the challenge value evolve through solves, either linear or logarithmic.
*/
readonly function: pulumi.Output<string>;
/**
* The flag validation logic.
*/
readonly logic: pulumi.Output<string>;
/**
* Maximum amount of attempts before being unable to flag the challenge.
*/
readonly maxAttempts: pulumi.Output<number>;
/**
* The minimum points for a dynamic-score challenge to reach with the decay function. Once there, no solve could have more value.
*/
readonly minimum: pulumi.Output<number>;
/**
* Name of the challenge, displayed as it.
*/
readonly name: pulumi.Output<string>;
/**
* Suggestion for the end-user as next challenge to work on.
*/
readonly next: pulumi.Output<number | undefined>;
/**
* The challenge position as displayed to players.
*/
readonly position: pulumi.Output<number>;
/**
* List of required challenges that needs to get flagged before this one being accessible. Useful for skill-trees-like strategy CTF.
*/
readonly requirements: pulumi.Output<outputs.ChallengeDynamicRequirements | undefined>;
/**
* State of the challenge, either hidden or visible.
*/
readonly state: pulumi.Output<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.
*/
readonly tags: pulumi.Output<string[]>;
/**
* List of challenge topics that are displayed to the administrators for maintenance and planification.
*/
readonly topics: pulumi.Output<string[]>;
/**
* The value (points) of the challenge once solved. It is mapped to `initial` under the hood, but displayed as `value` for consistency with the standard challenge.
*/
readonly value: pulumi.Output<number>;
/**
* Create a ChallengeDynamic resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ChallengeDynamicArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ChallengeDynamic resources.
*/
export interface ChallengeDynamicState {
/**
* Attribution to the creator(s) of the challenge.
*/
attribution?: pulumi.Input<string>;
/**
* Category of the challenge that CTFd groups by on the web UI.
*/
category?: pulumi.Input<string>;
/**
* Connection Information to connect to the challenge instance, useful for pwn, web and infrastructure pentests.
*/
connectionInfo?: pulumi.Input<string>;
/**
* The decay defines from each number of solves does the decay function triggers until reaching minimum. This function is defined by CTFd and could be configured through `.function`.
*/
decay?: pulumi.Input<number>;
/**
* Description of the challenge, consider using multiline descriptions for better style.
*/
description?: pulumi.Input<string>;
/**
* Decay function to define how the challenge value evolve through solves, either linear or logarithmic.
*/
function?: pulumi.Input<string>;
/**
* The flag validation logic.
*/
logic?: pulumi.Input<string>;
/**
* Maximum amount of attempts before being unable to flag the challenge.
*/
maxAttempts?: pulumi.Input<number>;
/**
* The minimum points for a dynamic-score challenge to reach with the decay function. Once there, no solve could have more value.
*/
minimum?: pulumi.Input<number>;
/**
* Name of the challenge, displayed as it.
*/
name?: pulumi.Input<string>;
/**
* Suggestion for the end-user as next challenge to work on.
*/
next?: pulumi.Input<number>;
/**
* The challenge position as displayed to players.
*/
position?: pulumi.Input<number>;
/**
* List of required challenges that needs to get flagged before this one being accessible. Useful for skill-trees-like strategy CTF.
*/
requirements?: pulumi.Input<inputs.ChallengeDynamicRequirements>;
/**
* State of the challenge, either hidden or visible.
*/
state?: pulumi.Input<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.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* List of challenge topics that are displayed to the administrators for maintenance and planification.
*/
topics?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The value (points) of the challenge once solved. It is mapped to `initial` under the hood, but displayed as `value` for consistency with the standard challenge.
*/
value?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a ChallengeDynamic resource.
*/
export interface ChallengeDynamicArgs {
/**
* Attribution to the creator(s) of the challenge.
*/
attribution?: pulumi.Input<string>;
/**
* Category of the challenge that CTFd groups by on the web UI.
*/
category: pulumi.Input<string>;
/**
* Connection Information to connect to the challenge instance, useful for pwn, web and infrastructure pentests.
*/
connectionInfo?: pulumi.Input<string>;
/**
* The decay defines from each number of solves does the decay function triggers until reaching minimum. This function is defined by CTFd and could be configured through `.function`.
*/
decay: pulumi.Input<number>;
/**
* Description of the challenge, consider using multiline descriptions for better style.
*/
description: pulumi.Input<string>;
/**
* Decay function to define how the challenge value evolve through solves, either linear or logarithmic.
*/
function?: pulumi.Input<string>;
/**
* The flag validation logic.
*/
logic?: pulumi.Input<string>;
/**
* Maximum amount of attempts before being unable to flag the challenge.
*/
maxAttempts?: pulumi.Input<number>;
/**
* The minimum points for a dynamic-score challenge to reach with the decay function. Once there, no solve could have more value.
*/
minimum: pulumi.Input<number>;
/**
* Name of the challenge, displayed as it.
*/
name?: pulumi.Input<string>;
/**
* Suggestion for the end-user as next challenge to work on.
*/
next?: pulumi.Input<number>;
/**
* The challenge position as displayed to players.
*/
position?: pulumi.Input<number>;
/**
* List of required challenges that needs to get flagged before this one being accessible. Useful for skill-trees-like strategy CTF.
*/
requirements?: pulumi.Input<inputs.ChallengeDynamicRequirements>;
/**
* State of the challenge, either hidden or visible.
*/
state?: pulumi.Input<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.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* List of challenge topics that are displayed to the administrators for maintenance and planification.
*/
topics?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The value (points) of the challenge once solved. It is mapped to `initial` under the hood, but displayed as `value` for consistency with the standard challenge.
*/
value: pulumi.Input<number>;
}
//# sourceMappingURL=challengeDynamic.d.ts.map