Skip to content

Commit

Permalink
Merge pull request #16 from ermetic-research/feat/kspm
Browse files Browse the repository at this point in the history
Add KSPM module support in CLI and parsing
  • Loading branch information
igofman authored Sep 4, 2023
2 parents 6ad5b24 + 5651230 commit 8757a1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ cnappgoat provision <scenario-1> <scenario-2> <scenario-N>

#### Flags:

- `--module` - Filters scenarios by module (e.g. CSPM, CIEM, CWPP, DSPM, etc.)
- `--module` - Filters scenarios by module (e.g. CSPM, CIEM, CWPP, DSPM, KSPM etc.)
- `--platform` - Filters scenarios by platform (e.g. AWS, Azure, GCP)
- `--force` - Enables force mode (unlock locked stacks with pulumi cancel)
- `--debug` - Enables debug logging.
Expand Down
2 changes: 1 addition & 1 deletion cmd/commands/common/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func CommandFlags() []cli.Flag {
},
&cli.StringFlag{
Name: "module",
Usage: "CNAPPgoat module to operate on, e.g. 'CIEM, 'CSPM', 'CWPP', 'DSPM', 'IAC'",
Usage: "CNAPPgoat module to operate on, e.g. 'CIEM, 'CSPM', 'CWPP', 'DSPM', 'KSPM'",
Aliases: []string{"m"},
},
&cli.StringFlag{
Expand Down
5 changes: 5 additions & 0 deletions scenario.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const (
CWPP Module = "CWPP"
DSPM Module = "DSPM"
IAC Module = "IAC"
KSPM Module = "KSPM"
)

type Platform string
Expand Down Expand Up @@ -83,6 +84,8 @@ func (m Module) String() string {
return "DSPM"
case IAC:
return "IAC"
case KSPM:
return "KSPM"
default:
return ""
}
Expand Down Expand Up @@ -171,6 +174,8 @@ func ModuleFromString(name string) (Module, error) {
return DSPM, nil
case strings.ToLower(IAC.String()):
return IAC, nil
case strings.ToLower(KSPM.String()):
return KSPM, nil
default:
return "", errors.New("unknown module name: " + name)
}
Expand Down

0 comments on commit 8757a1f

Please sign in to comment.