CTFd v1.0.0 published on Monday, Jun 3, 2024 by CTFer.io
ctfd.Flag
Explore with Pulumi AI
A flag to solve the challenge.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ctfd from "@ctfer-io/pulumi-ctfd";
const http = new ctfd.Challenge("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}",
});
import pulumi
import ctfer-io_pulumi-ctfd as ctfd
http = ctfd.Challenge("http",
category="misc",
description="...",
value=500,
decay=100,
minimum=50,
state="visible",
function="logarithmic",
topics=["Misc"],
tags=[
"misc",
"basic",
])
http_flag = ctfd.Flag("httpFlag",
challenge_id=http.id,
content="CTF{some_flag}")
package main
import (
"github.com/ctfer-io/pulumi-ctfd/sdk/go/ctfd"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
http, err := ctfd.NewChallenge(ctx, "http", &ctfd.ChallengeArgs{
Category: pulumi.String("misc"),
Description: pulumi.String("..."),
Value: pulumi.Int(500),
Decay: pulumi.Int(100),
Minimum: pulumi.Int(50),
State: pulumi.String("visible"),
Function: pulumi.String("logarithmic"),
Topics: pulumi.StringArray{
pulumi.String("Misc"),
},
Tags: pulumi.StringArray{
pulumi.String("misc"),
pulumi.String("basic"),
},
})
if err != nil {
return err
}
_, err = ctfd.NewFlag(ctx, "httpFlag", &ctfd.FlagArgs{
ChallengeId: http.ID(),
Content: pulumi.String("CTF{some_flag}"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ctfd = CTFerio.Ctfd;
return await Deployment.RunAsync(() =>
{
var http = new Ctfd.Challenge("http", new()
{
Category = "misc",
Description = "...",
Value = 500,
Decay = 100,
Minimum = 50,
State = "visible",
Function = "logarithmic",
Topics = new[]
{
"Misc",
},
Tags = new[]
{
"misc",
"basic",
},
});
var httpFlag = new Ctfd.Flag("httpFlag", new()
{
ChallengeId = http.Id,
Content = "CTF{some_flag}",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ctfd.Challenge;
import com.pulumi.ctfd.ChallengeArgs;
import com.pulumi.ctfd.Flag;
import com.pulumi.ctfd.FlagArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var http = new Challenge("http", ChallengeArgs.builder()
.category("misc")
.description("...")
.value(500)
.decay(100)
.minimum(50)
.state("visible")
.function("logarithmic")
.topics("Misc")
.tags(
"misc",
"basic")
.build());
var httpFlag = new Flag("httpFlag", FlagArgs.builder()
.challengeId(http.id())
.content("CTF{some_flag}")
.build());
}
}
resources:
http:
type: ctfd:Challenge
properties:
category: misc
description: '...'
value: 500
decay: 100
minimum: 50
state: visible
function: logarithmic
topics:
- Misc
tags:
- misc
- basic
httpFlag:
type: ctfd:Flag
properties:
challengeId: ${http.id}
content: CTF{some_flag}
Create Flag Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Flag(name: string, args: FlagArgs, opts?: CustomResourceOptions);
@overload
def Flag(resource_name: str,
args: FlagArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Flag(resource_name: str,
opts: Optional[ResourceOptions] = None,
challenge_id: Optional[str] = None,
content: Optional[str] = None,
data: Optional[str] = None,
type: Optional[str] = None)
func NewFlag(ctx *Context, name string, args FlagArgs, opts ...ResourceOption) (*Flag, error)
public Flag(string name, FlagArgs args, CustomResourceOptions? opts = null)
type: ctfd:Flag
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FlagArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FlagArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FlagArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FlagArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FlagArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var flagResource = new Ctfd.Flag("flagResource", new()
{
ChallengeId = "string",
Content = "string",
Data = "string",
Type = "string",
});
example, err := ctfd.NewFlag(ctx, "flagResource", &ctfd.FlagArgs{
ChallengeId: pulumi.String("string"),
Content: pulumi.String("string"),
Data: pulumi.String("string"),
Type: pulumi.String("string"),
})
var flagResource = new Flag("flagResource", FlagArgs.builder()
.challengeId("string")
.content("string")
.data("string")
.type("string")
.build());
flag_resource = ctfd.Flag("flagResource",
challenge_id="string",
content="string",
data="string",
type="string")
const flagResource = new ctfd.Flag("flagResource", {
challengeId: "string",
content: "string",
data: "string",
type: "string",
});
type: ctfd:Flag
properties:
challengeId: string
content: string
data: string
type: string
Flag Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Flag resource accepts the following input properties:
- Challenge
Id string - Challenge of the flag.
- Content string
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - Data string
- The flag sensitivity information, either casesensitive or caseinsensitive
- Type string
- The type of the flag, could be either static or regex
- Challenge
Id string - Challenge of the flag.
- Content string
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - Data string
- The flag sensitivity information, either casesensitive or caseinsensitive
- Type string
- The type of the flag, could be either static or regex
- challenge
Id String - Challenge of the flag.
- content String
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data String
- The flag sensitivity information, either casesensitive or caseinsensitive
- type String
- The type of the flag, could be either static or regex
- challenge
Id string - Challenge of the flag.
- content string
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data string
- The flag sensitivity information, either casesensitive or caseinsensitive
- type string
- The type of the flag, could be either static or regex
- challenge_
id str - Challenge of the flag.
- content str
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data str
- The flag sensitivity information, either casesensitive or caseinsensitive
- type str
- The type of the flag, could be either static or regex
- challenge
Id String - Challenge of the flag.
- content String
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data String
- The flag sensitivity information, either casesensitive or caseinsensitive
- type String
- The type of the flag, could be either static or regex
Outputs
All input properties are implicitly available as output properties. Additionally, the Flag resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Flag Resource
Get an existing Flag resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FlagState, opts?: CustomResourceOptions): Flag
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
challenge_id: Optional[str] = None,
content: Optional[str] = None,
data: Optional[str] = None,
type: Optional[str] = None) -> Flag
func GetFlag(ctx *Context, name string, id IDInput, state *FlagState, opts ...ResourceOption) (*Flag, error)
public static Flag Get(string name, Input<string> id, FlagState? state, CustomResourceOptions? opts = null)
public static Flag get(String name, Output<String> id, FlagState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Challenge
Id string - Challenge of the flag.
- Content string
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - Data string
- The flag sensitivity information, either casesensitive or caseinsensitive
- Type string
- The type of the flag, could be either static or regex
- Challenge
Id string - Challenge of the flag.
- Content string
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - Data string
- The flag sensitivity information, either casesensitive or caseinsensitive
- Type string
- The type of the flag, could be either static or regex
- challenge
Id String - Challenge of the flag.
- content String
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data String
- The flag sensitivity information, either casesensitive or caseinsensitive
- type String
- The type of the flag, could be either static or regex
- challenge
Id string - Challenge of the flag.
- content string
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data string
- The flag sensitivity information, either casesensitive or caseinsensitive
- type string
- The type of the flag, could be either static or regex
- challenge_
id str - Challenge of the flag.
- content str
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data str
- The flag sensitivity information, either casesensitive or caseinsensitive
- type str
- The type of the flag, could be either static or regex
- challenge
Id String - Challenge of the flag.
- content String
- The actual flag to match. Consider using the convention
MYCTF{value}
withMYCTF
being the shortcode of your event's name andvalue
depending on each challenge. - data String
- The flag sensitivity information, either casesensitive or caseinsensitive
- type String
- The type of the flag, could be either static or regex
Package Details
- Repository
- ctfd ctfer-io/pulumi-ctfd
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ctfd
Terraform Provider.