A starting point for creating a Trustero Receptor
For a working example of a Receptor, please refer to the GitLab example receptor found in the Trustero SDK
Documentation for the Trustero Receptor SDK.
To create a new Receptor, fork this repository and change "receptorName" to the name of the Receptor you are implementing.
The Receptor consists of these 2 files:
- A markdown file containing instructions on how to generate credentials that will allow your Receptor to connect to a Service Provider like AWS
- Source code that implements the Receptor interface from the SDK
There is a "Receptor Developer Guide" located in the docs directory for detailed instructions on how to write a Receptor
All API calls made in the receptor must be logged within the receptor via the evidence.AddSource call
The makefile contains the code quality, code coverage, and unit testing. Before running the makefile install
goreportcard. To run the tests in the makefile you can run
$ make test-all
You should be able to run your receptor code via the command line to confirm the Verify and Scan functions produce the correct output. You can run the Receptor code with the “dryrun” flag and it will print the output to the console. You can compile the Receptor code into a binary or run the main file directly.
If you run the main file directly, your command should look something like this:
$ go run main.go scan dryrun --find-evidence
This command will run the Verify, Discover, and Report functions that you wrote and print their output to the console. You should be able to see the final Evidences that are generated by the receptor.