sunggun-yu / snyk-iac-parsers

This golang project contains the file parsing functionality used in Snyk Infrastructure as Code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

snyk-iac-parsers


CircleCI Regression Tests

Latest release version Latest release date

Golang Version

This project includes parsers that are used for Snyk Infrastructure As Code product. Parsers convert the files they take as input into JSON.

Supported formats

The following file formats are supported:

  • HCL2: Terraform's default configuration format, parser's source can be found here.
  • Terraform Plan(JSON): Terraform plan output in json is parsed and resource_changes element is extracted. Parser's source can be found here.
  • YAML: Parser's source can be found here.

All the formats above are transformed into JSON so that they can be used as input into tools such as Open Policy Agent.

Development

Tests can be run using the go test command:

% go test ./...

Before committing code should be formatted with go fmt and linted with golangci-lint run. The CircleCI runner will enforce this for each opened pull request.

Contributing

This project is developed in open as a dependency of the snyk/snyk-iac-rules project. Should you wish to make a contribution please open a pull request against this repository with a clear description of the change with tests demonstrating the functionality. You will also need to agree to the Contributor Agreement before the code can be accepted and merged.

License

Available under the Mozilla Public License 2.0

About

This golang project contains the file parsing functionality used in Snyk Infrastructure as Code.

License:Mozilla Public License 2.0


Languages

Language:Go 97.6%Language:HCL 2.4%