# README
Producers
A producer is a program that parses the output of a tool and converts it into Smithy compatible file that can be used by the enrichers and consumers.
Writing Producers
Producers can be written in any language that supports protobufs, we have examples in Golang and Python. They are all structured the same way:
- Parse program arguments:
in
: the raw tool results file locationout
: where to place the Smithy compatible output file location
- Parse the
in
file into Protobufs (LaunchToolResponse
) - Add metadata to Protobufs (e.g. git/source-code information)
- Write the protobuf bytes to the
out
file
Producer API
For convenience, there are helper functions in the ./producers
pkg/module for
Golang/Python.
The WriteSmithyOut
/write_smithy_out
method expects a list of issues to write
as the LaunchToolResponse
protobuf. Your producer should parse the output of
a tool results into Issue
protobufs which are then passed into this method.
# Packages
No description provided by the author
No description provided by the author
Package main of the cdxgen producer parses the CycloneDX output of cdxgen and create a singular Smithy issue from it.
No description provided by the author
No description provided by the author
Package main of the dependency track producer reads a dependency track export and translates it to smithy format.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package main implements the binary for parsing trufflehog results into the smithy format.
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
EnsureValidFileTarget takes a file target string from an untrusted source, e.g.
EnsureValidPURLTarget takes a purl target string from an untrusted source, e.g.
GetFileTarget returns a file target string for a given file path.
GetPartsFromFileTarget takes a file target string and returns the parts.
GetPURLTarget returns a purl target string for a given package.
ParseFlags will parse the input flags for the producer and perform simple validation.
ParseMultiJSONMessages provides method to parse tool results in JSON format.
ReadInFile returns the contents of the file given by InResults.
TestEndToEnd is a helper function to test the end-to-end functionality of a producer.
WriteSmithyOut provides a generic method to write the resulting protobuf to the output file.
# Constants
No description provided by the author