Skip to content

Commit

Permalink
Merge pull request #1967 from snyk/docs/update-help-command
Browse files Browse the repository at this point in the history
docs: Update IaC help docs with CloudFormation && --org option
  • Loading branch information
ipapast authored May 27, 2021
2 parents d8ecd4d + e5070a0 commit cad069e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion help/commands-docs/_EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ See `snyk container --help` for more details and examples:

See `snyk iac --help` for more details and examples:

$ snyk iac test /path/to/Kubernetes.yaml
$ snyk iac test /path/to/cloudformation_file.yaml
$ snyk iac test /path/to/kubernetes_file.yaml
$ snyk iac test /path/to/terraform_file.tf
$ snyk iac test /path/to/tf-plan.json
5 changes: 4 additions & 1 deletion help/commands-docs/iac-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

[For more information see IaC help page](https://snyk.co/ucT6Q)

- `Test CloudFormation file`:
\$ snyk iac test /path/to/cloudformation_file.yaml

- `Test kubernetes file`:
\$ snyk iac test /path/to/Kubernetes.yaml
\$ snyk iac test /path/to/kubernetes_file.yaml

- `Test terraform file`:
\$ snyk iac test /path/to/terraform_file.tf
Expand Down
12 changes: 11 additions & 1 deletion help/commands-docs/iac.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ Find security issues in your Infrastructure as Code files.
Save test output in JSON format directly to the specified file, regardless of whether or not you use the `--json` option.
This is especially useful if you want to display the human-readable test output via stdout and at the same time save the JSON format output to a file.

- `--org`=<ORG_NAME>:
Specify the <ORG_NAME> to run Snyk commands tied to a specific organization. This will influence private tests limits.
If you have multiple organizations, you can set a default from the CLI using:

`$ snyk config set org`=<ORG_NAME>

Setting a default will ensure all newly tested projects will be tested
under your default organization. If you need to override the default, you can use the `--org`=<ORG_NAME> argument.
Default: uses <ORG_NAME> that sets as default in your [Account settings](https://app.snyk.io/account)

- `--sarif`:
Return results in SARIF format.

Expand All @@ -49,4 +59,4 @@ Find security issues in your Infrastructure as Code files.
It enables to control whether the scan should analyse the full final state (e.g. `planned-values`), or the proposed changes only (e.g. `resource-changes`).
Default: If the `--scan` flag is not provided it would scan the proposed changes only by default.
Example #1: `--scan=planned-values` (full state scan)
Example #2: `--scan=resource-changes` (proposed changes scan)
Example #2: `--scan=resource-changes` (proposed changes scan)
4 changes: 2 additions & 2 deletions src/cli/commands/test/iac-local-execution/file-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ export class FailedToDetectJsonConfigError extends CustomError {
);
this.code = IaCErrorCodes.FailedToDetectJsonConfigError;
this.strCode = getErrorStringCode(this.code);
this.userMessage = `We were unable to detect whether the JSON file "${filename}" is a valid Kubernetes file or Terraform Plan. For Kubernetes it is missing the following fields: "${REQUIRED_K8S_FIELDS.join(
this.userMessage = `We were unable to detect whether the JSON file "${filename}" is either a valid Kubernetes file, CloudFormation file or a Terraform Plan. For Kubernetes it is missing the following fields: "${REQUIRED_K8S_FIELDS.join(
'", "',
)}". For Terraform Plan it was expected to contain fields "planned_values.root_module" and "resource_changes". Please contact [email protected], if possible with a redacted version of the file`;
)}". For CloudFormation required fields are: "Resources". For Terraform Plan it was expected to contain fields "planned_values.root_module" and "resource_changes". Please contact [email protected], if possible with a redacted version of the file`;
}
}

0 comments on commit cad069e

Please sign in to comment.