@ctfer-io/pulumi-ctfd
Version:
The CTFd provider for Pulumi, to manage its resources as code.
226 lines (225 loc) • 8.27 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.
*
* It is the first historic implementation of its kind, with basic functionalities.
*
* ## 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.ChallengeStandard("http", {
* category: "misc",
* description: "...",
* value: 500,
* 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 ChallengeStandard extends pulumi.CustomResource {
/**
* Get an existing ChallengeStandard 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?: ChallengeStandardState, opts?: pulumi.CustomResourceOptions): ChallengeStandard;
/**
* Returns true if the given object is an instance of ChallengeStandard. 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 ChallengeStandard;
/**
* 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>;
/**
* Description of the challenge, consider using multiline descriptions for better style.
*/
readonly description: pulumi.Output<string>;
/**
* Maximum amount of attempts before being unable to flag the challenge.
*/
readonly maxAttempts: 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>;
/**
* 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.ChallengeStandardRequirements | 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.
*/
readonly value: pulumi.Output<number>;
/**
* Create a ChallengeStandard 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: ChallengeStandardArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ChallengeStandard resources.
*/
export interface ChallengeStandardState {
/**
* 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>;
/**
* Description of the challenge, consider using multiline descriptions for better style.
*/
description?: pulumi.Input<string>;
/**
* Maximum amount of attempts before being unable to flag the challenge.
*/
maxAttempts?: 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>;
/**
* 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.ChallengeStandardRequirements>;
/**
* 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.
*/
value?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a ChallengeStandard resource.
*/
export interface ChallengeStandardArgs {
/**
* 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>;
/**
* Description of the challenge, consider using multiline descriptions for better style.
*/
description: pulumi.Input<string>;
/**
* Maximum amount of attempts before being unable to flag the challenge.
*/
maxAttempts?: 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>;
/**
* 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.ChallengeStandardRequirements>;
/**
* 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.
*/
value: pulumi.Input<number>;
}