Skip to content
Open
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If you're looking for the source code of playCTF, the frontend powered by Beast,
- An optional automated health check service to periodically check the status of challenges and report if there is some sort of problem with one.
- Single source of truth for all the static content related to all the challenges making it easy to debug, monitor and manage
static content through a single interface.
- Use of sidecar mechanism for stateful workloads which can be shared by multiple challenges at once, MySQL for example.
- **[DEPRECATED]** Use of sidecar mechanism for stateful workloads which can be shared by multiple challenges at once, MySQL for example.
- Support for various notification channels like slack, discord.
- Everything embedded to a single go binary which can be easily used anywhere.

Expand Down
3 changes: 2 additions & 1 deletion _examples/example.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ scripts_dir = "$HOME/.beast/scripts"
# Base OS image that beast allows the challenges to use.
allowed_base_images = ["ubuntu:18.04", "ubuntu:16.04", "debian:jessie"]

# DEPRECATED
# The sidecar that we support with beast, currently we only support two MySQL and
# MongoDB.
available_sidecars = ["mysql", "mongodb"]
# available_sidecars = ["mysql", "mongodb"]

# For authentication purposes beast uses JWT based authentication, this is the
# key used for encrypting the claims of a user. Keep this strong.
Expand Down
127 changes: 0 additions & 127 deletions cmd/agents/mongo/main.go

This file was deleted.

122 changes: 0 additions & 122 deletions cmd/agents/mysql/main.go

This file was deleted.

10 changes: 5 additions & 5 deletions core/config/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (Metadata *ChallengeMetadata) PopulateChallengeMetadata() {
Metadata.Type = "ChallengeType"
Metadata.DynamicFlag = false
Metadata.Flag = "ChallengeFlag"
Metadata.Sidecar = "SidecarHelper"
// Metadata.Sidecar = "SidecarHelper"
}

func (Env *ChallengeEnv) PopulateChallengeEnv() {
Expand Down Expand Up @@ -134,7 +134,7 @@ type ChallengeMetadata struct {
Name string `toml:"name"`
Type string `toml:"type"`
Tags []string `toml:"tags"`
Sidecar string `toml:"sidecar"`
// Sidecar string `toml:"sidecar"`
Description string `toml:"description"`
Hints []struct {
Text string `toml:"text"`
Expand Down Expand Up @@ -167,9 +167,9 @@ func (config *ChallengeMetadata) ValidateRequiredFields() (error, bool) {
config.MaxAttemptLimit = -1
}

if !(utils.StringInSlice(config.Sidecar, Cfg.AvailableSidecars) || config.Sidecar == "") {
return fmt.Errorf("sidecar provided is not an available sidecar"), false
}
// if !(utils.StringInSlice(config.Sidecar, Cfg.AvailableSidecars) || config.Sidecar == "") {
// return fmt.Errorf("sidecar provided is not an available sidecar"), false
// }

// Check if the config type is static here and if it is
// then return an indication for that, so that caller knows if it need
Expand Down
2 changes: 1 addition & 1 deletion core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ type BeastConfig struct {
AuthorizedKeysFile string `toml:"authorized_keys_file"`
BeastScriptsDir string `toml:"scripts_dir"`
AllowedBaseImages []string `toml:"allowed_base_images"`
AvailableSidecars []string `toml:"available_sidecars"`
// AvailableSidecars []string `toml:"available_sidecars"`
AvailableServers map[string]AvailableServer `toml:"available_servers"`
GitRemotes []GitRemote `toml:"remote"`
PsqlConf PsqlConfig `toml:"psql_config"`
Expand Down
30 changes: 15 additions & 15 deletions core/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,23 @@ var USER_ROLES = map[string]string{
"maintainer": "maintainer",
}

const MYSQL_SIDECAR_HOST = "mysql"
const MONGO_SIDECAR_HOST = "mongo"
// const MYSQL_SIDECAR_HOST = "mysql"
// const MONGO_SIDECAR_HOST = "mongo"

var SIDECAR_CONTAINER_MAP = map[string]string{
"mysql": "mysql",
"mongo": "mongo",
}
// var SIDECAR_CONTAINER_MAP = map[string]string{
// "mysql": "mysql",
// "mongo": "mongo",
// }

var SIDECAR_NETWORK_MAP = map[string]string{
"mysql": "beast-mysql",
"mongo": "beast-mongo",
}
// var SIDECAR_NETWORK_MAP = map[string]string{
// "mysql": "beast-mysql",
// "mongo": "beast-mongo",
// }

var SIDECAR_ENV_PREFIX = map[string]string{
"mysql": "MYSQL",
"mongo": "MONGO",
}
// var SIDECAR_ENV_PREFIX = map[string]string{
// "mysql": "MYSQL",
// "mongo": "MONGO",
// }

// Available challenge types
var AVAILABLE_CHALLENGE_TYPES = []string{STATIC_CHALLENGE_TYPE_NAME, SERVICE_CHALLENGE_TYPE_NAME, BARE_CHALLENGE_TYPE_NAME, WEB_CHALLENGE_TYPE_NAME}
Expand Down Expand Up @@ -208,4 +208,4 @@ var USER_STATUS = map[string]string{
const (
LEADERBOARD_SIZE = 25
LEADERBOARD_GRAPH_SIZE = 12
)
)
2 changes: 1 addition & 1 deletion core/database/challenges.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type Challenge struct {
Difficulty string `gorm:"not null;default:'medium'"`
MaxAttemptLimit int `gorm:"default:-1"`
PreReqs string `gorm:"type:text"`
Sidecar string `gorm:"type:varchar(64)"`
// Sidecar string `gorm:"type:varchar(64)"` TODO: remove sidecars completely
Assets string `gorm:"type:text"`
AdditionalLinks string `gorm:"type:text"`
Description string `gorm:"type:text"`
Expand Down
3 changes: 2 additions & 1 deletion core/manager/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,8 @@ func undeployChallenge(challengeName string, purge bool) error {
if err != nil {
return err
}
err = cleanSidecar(&cfg)
// TODO: remove sidecars completely
// err = cleanSidecar(&cfg)
if err != nil {
return err
}
Expand Down
Loading