diff --git a/help/iac.txt b/help/iac.txt new file mode 100644 index 00000000000..31bc6da7955 --- /dev/null +++ b/help/iac.txt @@ -0,0 +1,24 @@ +Usage: + + $ snyk iac [command] [options] --file= + +Find security issues in your Infrastructure as Code files. + +Commands: + + test ............... Test for any known issue. + +Options: + + -h, --help + --json .................................. Return results in JSON format. + --project-name= ................. Specify a custom Snyk project name. + --policy-path= .................... Manually pass a path to a snyk policy file. + --severity-threshold=... Only report issues of provided level or higher. + +Examples: + + $ snyk iac test /path/to/Kubernetes.yaml + + +For more information see https://support.snyk.io/hc/en-us/categories/360001342678-Infrastructure-as-code diff --git a/src/cli/modes.ts b/src/cli/modes.ts index fa7358dd8db..b050f821f11 100644 --- a/src/cli/modes.ts +++ b/src/cli/modes.ts @@ -13,6 +13,14 @@ const modes: Record = { args['docker'] = true; args['experimental'] = true; + return args; + }, + }, + iac: { + allowedCommands: ['test'], + config: (args): [] => { + args['iac'] = true; + return args; }, }, diff --git a/src/lib/types.ts b/src/lib/types.ts index 01a3ef21d58..73f64a0ca33 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -41,6 +41,7 @@ export interface Options { org?: string | null; path: string; docker?: boolean; + iac?: boolean; file?: string; policy?: string; json?: boolean;