fortify / fcli

fcli is a command-line utility for interacting with various Fortify products
https://fortify.github.io/fcli/
Other
32 stars 22 forks source link

Common: Introduce support for storing data in variables #127

Closed rsenden closed 2 years ago

rsenden commented 2 years ago

The fcli output framework allows for outputting data in arbitrary formats to files, however it may be useful to (temporarily) store the original JSON response (or particular properties) from the remote system for later use, while at the same time having normal (human-readble) fcli output.

There are two main use cases that warrant this enhancement:

This enhancement would need to cover the following:

Instead of having the IOutputToVariable interface, we can also look into generalizing this functionality to write a predefined variable for every entity whenever a command that returns a single entity is invoked. For example, sc-dast scan get, sc-dast scan create, sc-dast scan pause, ... would all automatically set the current<entity> property (with <entity> being DastScan in this case), allowing users to use - to reference the 'current' scan id as used for the last (single-entity) sc-dast scan command.

This would allow for this functionality to be provided in a much more consistent way, without having to decide whether or not a particular command should implement the IOutputToVariable interface. The main difficulty is defining/retrieving the <entity> to be used for the variable name; you'd want to have a generic lookup mechanism for all commands related to a particular entity.

rsenden commented 2 years ago

This feature has been implemented