Codeanalyze analyzes local code repositories or directories for configurations and vulnerabilities. It can be run locally or as part of CI.
TODO update the below
- Add a file to
cmd/that corresponds to the sub-command name you'd like to add to thecodeanalyzeCLI - You can use
cmd/ec2.goas a template - Your file needs to be a member function of the
AwsEnumeratestruct and should be of the formInit<cmd>Command - Add a new member to the
AwsEnumeratestruct incmd/root.gothat corresponsds to your command name. Remember, the first letter must be capitalized. - Call your
Initfunction frommain.go - Add logic to your commands runtime and put it in its own package within
internal(e.g.,internal/ec2)
You can test locally without building by running
go run main.go <subcommand> <flags>You can test locally using the CLI by building it from source. Run, ./godelw clean && ./godelw build to clean out the out/ directory and rebuild. You will now have a binary at out/build/codeanalyze/<version>/darwin-arm64/codeanalyze that you can run
I have not yet figured out how to get godel to build docker for us, so at the moment, it's a bit of a pain. The best idea is to follow what the build-docker stage in .gitlab-ci.yml does