This project includes parsers that are used for Vulnmap Infrastructure As Code product. Parsers convert the files they take as input into JSON.
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.
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.
This project is developed in open as a dependency of the khulnasoft-lab/vulnmap-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.
Available under the Mozilla Public License 2.0