brexhq / substation

Substation is a toolkit for routing, normalizing, and enriching security event and audit logs.
https://substation.readme.io
MIT License
330 stars 21 forks source link

Create CLI Tool #241

Closed jshlbrd closed 1 month ago

jshlbrd commented 1 month ago

Is your feature request related to a problem? Please describe.

This was brought up by @britton-from-notion in https://github.com/brexhq/substation/issues/239:

... I would hope to see this functionality built into a single substation binary. I would prefer to be able to write substation test *.jsonnet directly in my CLI and also be able to write substation build *.jsonnet to build a substation app or substation run *.json to run it (this could be opened as a separate issue, since I know this deviates from how substation works. But a central, vended, entrypoint for my substation workflow including unit testing mentally clicks a lot better in my head than a dedicated unit testing CLI .)

All Substation apps are tightly coupled to their source (ex. AWS Lambda, K8s, etc.) and that is also true for apps that support local development. This is proposing to build a new app that is a CLI tool that centralizes the user experience (and over time refactor existing development apps into the new tool).

Describe the solution you'd like A substation CLI tool that centralizes common user tasks, like:

This should not be used to manage cloud deployments -- those are decentralized and managed by Terraform, and we can't make any assumptions about how or where deployments will be run. Thego tool is a good reference point for what this tool should do.

Describe alternatives you've considered None, but the existing pattern of creating one app per use case is an option.

Additional context cobra seems to be the standard for creating complex CLI tools in Go.