Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:improve iac test json output #1309

Merged
merged 1 commit into from
Aug 11, 2020
Merged

Conversation

rontalx
Copy link
Contributor

@rontalx rontalx commented Aug 5, 2020

What does this PR do?

Formats and improves the response we get from Registry's iac-test for use in our JSON output.
Main changes:

  • Rename cloudConfigResults -> infrastructureAsCodeIssues
  • Rename cloudConfigPath -> path
  • Remove the following fields: from, name
  • Improved names & typings.
  • Reduce tons of boilerplate code in the relevant iac test and clean them up.

old structure

"cloudConfigResults": [
  {
      "id": "SNYK-CC-K8S-15",
      "from": [],
      "title": "LoadBalancer Service without SourceRange allows all traffic",
      "description": "...",
      "type": "k8s",
      "subType": "Service",
      "name": "LoadBalancer Service without SourceRange allows all traffic",
      "severity": "medium",
      "cloudConfigPath": [
        "[DocId: 3]",
        "service",
        "spec",
        "loadBalancerSourceRanges"
      ],
      "isIgnored": false
    }
]

new structure

"infrastructureAsCodeIssues": [
  {
      "id": "SNYK-CC-K8S-15",
      "title": "LoadBalancer Service without SourceRange allows all traffic",
      "description": "...",
      "type": "k8s",
      "subType": "Service",
      "severity": "medium",
      "path": [
        "[DocId: 3]",
        "service",
        "spec",
        "loadBalancerSourceRanges"
      ],
      "isIgnored": false
    }
]

Note
There's a refactor I did for the test structure.
there's more to do, but for the sake of releasing this PR I'm pushing it to a separate task.

How should this be manually tested?

Running the iac-test flows both with and without the --json flag.

Any background context you want to provide?

Slack Discussion: https://snyk.slack.com/archives/CMM9V3XPY/p1596616315051300

What are the relevant tickets?

Jira Ticket: https://snyksec.atlassian.net/browse/CC-257

@rontalx rontalx force-pushed the feat/improve-iac-test-json-output branch 7 times, most recently from ff2d55d to 7f8f627 Compare August 5, 2020 13:36
@rontalx rontalx self-assigned this Aug 5, 2020
@rontalx rontalx force-pushed the feat/improve-iac-test-json-output branch 9 times, most recently from e424189 to b8965f2 Compare August 5, 2020 19:02
@rontalx rontalx marked this pull request as ready for review August 6, 2020 06:51
@rontalx rontalx requested a review from a team as a code owner August 6, 2020 06:51
@rontalx rontalx requested a review from a team August 6, 2020 06:51
@rontalx rontalx requested a review from a team as a code owner August 6, 2020 06:51
@ghost ghost requested review from anthogez and gitphill August 6, 2020 06:51
test/acceptance/cli-test/cli-test.iac-k8s.utils.ts Outdated Show resolved Hide resolved
src/cli/commands/test/index.ts Outdated Show resolved Hide resolved
src/lib/snyk-test/iac-test-result.ts Outdated Show resolved Hide resolved
src/lib/snyk-test/iac-test-result.ts Outdated Show resolved Hide resolved
src/lib/snyk-test/iac-test-result.ts Outdated Show resolved Hide resolved
src/lib/snyk-test/iac-test-result.ts Outdated Show resolved Hide resolved
test/acceptance/cli-test/cli-test.iac-k8s.utils.ts Outdated Show resolved Hide resolved
src/lib/snyk-test/iac-test-result.ts Outdated Show resolved Hide resolved
@rontalx rontalx force-pushed the feat/improve-iac-test-json-output branch 4 times, most recently from dc562c9 to 9bfe806 Compare August 6, 2020 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants