fortify / fcli

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

Integrate SC-SAST/SC-DAST functionality into SSC module #551

Open rsenden opened 5 months ago

rsenden commented 5 months ago

Enhancement Request

With the current command structure, users and CI/CD integrations potentially need to run three session login (and logout) commands; they need to create an SC-SAST/SC-DAST session to be able to submit scan requests and wait for scan completion, and then create an SSC session to access the results of those scans.

Also, current structure is not ideal if we implement pipeline-style actions (#549) that cover packaging, submitting scan requests, and exporting results. As described above, such a pipeline-style action would need to manage both SC-SAST (or SC-DAST) and SSC sessions, and we'd need to decide where such actions should live; fcli sc-sast action run scan or fcli ssc action run sast-scan (or both).

We can easily create an SSC command structure that's similar to FoD command structure, for example having commands like:

To avoid this resulting in a major fcli release, we could potentially just leave the existing sc-sast and sc-dast modules in place (just adding a deprecation notice), and only remove those modules upon the next major fcli release.

Primary difficulty is session management:

MikeTheSnowman commented 5 months ago

Heyr @rsenden , I just wanted to add my thoughts to the discussion.

rsenden commented 5 months ago

Hi @MikeTheSnowman, thanks for your input.

Unfortunately, there's no clear plan/ETA if/when SC-SAST will get rid of the client-auth-token, so until then, we have no other choice than to support this token. As a temporary work-around, I've proposed an SSC enhancement to allow the client-auth-token to be stored in SSC, allowing any (REST) client like fcli to retrieve this token (potentially restricted through a new SSC role permission). This way, assuming the user has the proper SSC rights, fcli could retrieve the client-auth-token from SSC instead of requiring the user to specify the client-auth-token token on the fcli sc-sast session login command.

The primary reason for not sharing SSC sessions with SC-SAST module is again due to the client-auth-token, as an SSC session (currently) has no knowledge about the required client-auth-token. For consistency, we're also not sharing SSC sessions with SC-DAST module, having each product module being responsible for its own sessions. Once we can somehow get rid of the requirement for users to explicitly specify the client-auth-token, we can reconsider this.

As for actual command structure, I'm open to both approaches; either integrate SC-SAST/SC-DAST commands into SSC module (to be more consistent with FoD module), or keeping separate sc-sast and sc-dast modules that share their sessions with SSC.