Skip to content
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
10 changes: 8 additions & 2 deletions cli/cmd/score.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func init() {
scoreCmd.Flags().String("ssh-key", "", "Path to SSH private key for the Kali VM (Azure; auto-discovered if omitted)")
scoreCmd.Flags().String("ssh-user", "kali", "SSH username for the Kali VM (Azure)")

scoreGenerateKeyCmd.Flags().String("config", "", "Path to GOAD config.json (default: ad/GOAD/data/config.json)")
scoreGenerateKeyCmd.Flags().String("config", "", "Path to GOAD config.json (default: the active environment's resolved lab config)")
scoreGenerateKeyCmd.Flags().String("output", "", "Output path for answer_key.json (default: scoreboard/answer_key.json)")
}

Expand Down Expand Up @@ -238,7 +238,13 @@ func runScoreGenerateKey(cmd *cobra.Command, _ []string) error {
}
configPath, _ := cmd.Flags().GetString("config")
if configPath == "" {
configPath = filepath.Join(cfg.ProjectRoot, "ad", "GOAD", "data", "config.json")
// Resolve through the active environment so overlays and variant labs
// are honored. Hardcoding ad/GOAD/data/config.json scores the base lab
// no matter which --env is selected.
configPath, err = cfg.ResolvedLabConfigPath()
if err != nil {
return err
}
}
outputPath, _ := cmd.Flags().GetString("output")
if outputPath == "" {
Expand Down
12 changes: 9 additions & 3 deletions cli/cmd/scoreboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ func init() {
scoreboardCmd.AddCommand(scoreboardRunCmd)
scoreboardCmd.AddCommand(scoreboardDemoCmd)

scoreboardGenerateKeyAlias.Flags().String("config", "", "Path to GOAD config.json (default: ad/GOAD/data/config.json)")
scoreboardGenerateKeyAlias.Flags().String("config", "", "Path to GOAD config.json (default: the active environment's resolved lab config)")
scoreboardGenerateKeyAlias.Flags().String("output", "", "Output path for answer_key.json (default: scoreboard/answer_key.json)")

scoreboardDemoCmd.Flags().String("config", "", "Path to GOAD config.json (default: ad/GOAD/data/config.json)")
scoreboardDemoCmd.Flags().String("config", "", "Path to GOAD config.json (default: the active environment's resolved lab config)")

scoreboardRunCmd.Flags().String("transport", "local", "Transport: local, ssm, or ares")
scoreboardRunCmd.Flags().String("report", "./report.jsonl", "Path to the agent's report file (on the target, for local/ssm)")
Expand Down Expand Up @@ -196,7 +196,13 @@ func runScoreboardDemo(cmd *cobra.Command, _ []string) error {
}
configPath, _ := cmd.Flags().GetString("config")
if configPath == "" {
configPath = filepath.Join(cfg.ProjectRoot, "ad", "GOAD", "data", "config.json")
// Resolve through the active environment so overlays and variant labs
// are honored. Hardcoding ad/GOAD/data/config.json scores the base lab
// no matter which --env is selected.
configPath, err = cfg.ResolvedLabConfigPath()
if err != nil {
return err
}
}
ak, err := scoreboard.GenerateAnswerKey(configPath)
if err != nil {
Expand Down
Loading