Skip to content

Fix for ui, explanations, and new container #64

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

Merged
merged 1 commit into from
Sep 30, 2022
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
2 changes: 1 addition & 1 deletion aws/build-an-deploy-aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ wait
DEFAULT_PASSWORD=thankyou
#TODO: REWRITE ABOVE, REWRITE THE HARDCODED DEPLOYMENT VALS INTO VALUES AND OVERRIDE THEM HERE!
echo "default password is ${DEFAULT_PASSWORD}"
helm upgrade --install mj ../helm/wrongsecrets-ctf-party --set="imagePullPolicy=Always" --set="balancer.env.K8S_ENV=aws" --set"balancer.env.IRSA_ROLE=arn:aws:iam::${ACCOUNT_ID}:role/wrongsecrets-secret-manager" --set="balancer.env.REACT_APP_ACCESS_PASSWORD=${DEFAULT_PASSWORD}" --set="balancer.cookie.cookieParserSecret=thisisanewrandomvaluesowecanworkatit" --set="balancer.repository=jeroenwillemsen/wrongsecrets-balancer" --set="balancer.tag=0.92aws" --set="balancer.replicas=4" --set="wrongsecretsCleanup.repository=jeroenwillemsen/wrongsecrets-ctf-cleaner" --set="wrongsecretsCleanup.tag=0.2"
helm upgrade --install mj ../helm/wrongsecrets-ctf-party --set="imagePullPolicy=Always" --set="balancer.env.K8S_ENV=aws" --set"balancer.env.IRSA_ROLE=arn:aws:iam::${ACCOUNT_ID}:role/wrongsecrets-secret-manager" --set="balancer.env.REACT_APP_ACCESS_PASSWORD=${DEFAULT_PASSWORD}" --set="balancer.cookie.cookieParserSecret=thisisanewrandomvaluesowecanworkatit" --set="balancer.repository=jeroenwillemsen/wrongsecrets-balancer" --set="balancer.tag=0.93aws" --set="balancer.replicas=4" --set="wrongsecretsCleanup.repository=jeroenwillemsen/wrongsecrets-ctf-cleaner" --set="wrongsecretsCleanup.tag=0.2"
2 changes: 1 addition & 1 deletion helm/wrongsecrets-ctf-party/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ balancer:
# -- Set this to a fixed random alpa-numeric string (recommended length 24 chars). If not set this get randomly generated with every helm upgrade, each rotation invalidates all active cookies / sessions requirering users to login again.
cookieParserSecret: null
repository: jeroenwillemsen/wrongsecrets-balancer
tag: 0.92aws
tag: 0.93aws
# -- Number of replicas of the wrongsecrets-balancer deployment
replicas: 1
service:
Expand Down
72 changes: 48 additions & 24 deletions wrongsecrets-balancer/ui/src/pages/JoinPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const CenterLogo = styled.img`
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
width: 75%;
`;

export const JoinPage = injectIntl(({ intl }) => {
Expand All @@ -52,7 +52,7 @@ export const JoinPage = injectIntl(({ intl }) => {

async function sendJoinRequest() {
try {
if(!teamname || teamname.length === 0){
if (!teamname || teamname.length === 0) {
setFailed(true);
return;
}
Expand Down Expand Up @@ -142,26 +142,36 @@ export const JoinPage = injectIntl(({ intl }) => {
<li>This domain: here is where you can do your exercises</li>
<li>
The domain where you provide your responses in exchange for a CTF key:{' '}
<a href={dynamics.heroku_wrongsecret_ctf_url}>{dynamics.heroku_wrongsecret_ctf_url}</a>
<a style={{ color: 'white' }} href={dynamics.heroku_wrongsecret_ctf_url}>
{dynamics.heroku_wrongsecret_ctf_url}
</a>
</li>
<li>
The domain where you provide your CTF key:{' '}
<a href={dynamics.ctfd_url}>{dynamics.ctfd_url}</a>
<a style={{ color: 'white' }} href={dynamics.ctfd_url}>
{dynamics.ctfd_url}
</a>
</li>
<li>
Optionally: the storage bucket with Terraform state for the cloud challneges:{' '}
<a href={dynamics.s3_bucket_url}>{dynamics.s3_bucket_url}</a>
<a style={{ color: 'white' }} href={dynamics.s3_bucket_url}>
{dynamics.s3_bucket_url}
</a>
. For this you will need credentials that will be provided to you as part of the CTF
instructions.
</li>
</ul>
<FormattedMessage
id="welcome_text_2"
defaultMessage={`
We need multiple domains, as you will be able to steal the CTF key after a few challenges.
We need to usse multiple domains, as you will be able to steal the CTF key after a few challenges.
`}
values={{
strong: (msg) => <strong>{msg}</strong>,
}}
/>
<br />
<br />

<H2>
<FormattedMessage id="getting_started" defaultMessage="Getting Started" />
Expand All @@ -179,6 +189,20 @@ export const JoinPage = injectIntl(({ intl }) => {
}}
/>

{dynamics.enable_password ? (
<p>
<FormattedMessage
id="getting_started_password"
defaultMessage={`
In the password field you have to enter the password you received as part of your CTF instructions.
This can be different from the CTFD passswords.
`}
values={{
strong: (msg) => <strong>{msg}</strong>,
}}
/>
</p>
) : null}
{failed ? (
<p>
<strong>
Expand Down Expand Up @@ -206,24 +230,24 @@ export const JoinPage = injectIntl(({ intl }) => {
onChange={({ target }) => setTeamname(target.value)}
/>
{dynamics.enable_password ? (
<p>
<Label htmlFor="password">
<FormattedMessage id="password" defaultMessage="Password" />
</Label>
<Input
type="password"
id="password"
data-test-id="password-input"
name="password"
disabled={!dynamics.enable_password}
value={password}
title={formatMessage(messages.passwordValidationConstraints)}
pattern="^[a-zA-Z0-9]([-a-z-A-Z0-9])+[a-zA-Z0-9]$"
maxLength="64"
onChange={({ target }) => setPassword(target.value)}
/>
</p>
) : null}
<p>
<Label htmlFor="password">
<FormattedMessage id="password" defaultMessage="Password" />
</Label>
<Input
type="password"
id="password"
data-test-id="password-input"
name="password"
disabled={!dynamics.enable_password}
value={password}
title={formatMessage(messages.passwordValidationConstraints)}
pattern="^[a-zA-Z0-9]([-a-z-A-Z0-9])+[a-zA-Z0-9]$"
maxLength="64"
onChange={({ target }) => setPassword(target.value)}
/>
</p>
) : null}
<Button data-test-id="create-join-team-button" type="submit">
<FormattedMessage id="create_or_join_team_label" defaultMessage="Create / Join Team" />
</Button>
Expand Down