Open rsenden opened 5 months ago
Heyr @rsenden , I just wanted to add my thoughts to the discussion.
client-auth-token
for SC-SAST. A permenant pre-shared key is a really poor security mechanism and if I remember correctly, I think the SC-SAST engineers are also planning on getting rid of it as well. Maybe we can simply wait for them to produce a replacement for the client-auth-token?client-auth-token
, this also means that we won't be able to fully support older versions of SC-SAST. I'm rather okay with that as it's less technical debt and it incentivize users to upgrade.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.
Enhancement Request
With the current command structure, users and CI/CD integrations potentially need to run three
session login
(andlogout
) 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
orfcli 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:
fcli ssc sast-scan list/start/wait-for/...
fcli ssc sast-sensor list/shutdown/...
fcli ssc dast-scan list/start/wait-for/...
fcli ssc dast-sensor list/...
To avoid this resulting in a major fcli release, we could potentially just leave the existing
sc-sast
andsc-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:
--client-auth-token
option onfcli ssc session login
; of course SC-SAST commands would throw an error if no client auth token was specified upon loginfcli ssc config
orfcli config
commands--client-auth-token
option on every command that needs to interact with SC-SAST Controllerfcli ssc session login
command, we can simply use that. If the user supplies user credentials:UnifiedLoginToken
, which gets revoked upon session logout; this is not suitable for submitting SAST scan requests as the token may expire or be revoked before the scan has been published to SSC.UnifiedLoginToken
(for general fcli usage) and aCIToken
upon session login, and cache this outside of the session (i.e., shouldn't be revoked on session logout, and to avoid exceeding SSC token limits, we don't want to generate a new token on every login if a previously generated token hasn't expired yet)scan start
command, store token somewhere in SSC, ...CIToken
when user logs in using username/password, to allow for slightly longer-lived session, but such aCIToken
will not provided access to all SSC functionality. We could choose to simply use theUnifiedLoginToken
that's used for other SSC commands, or utilizeAutomationToken
to allow for longer-lived sessions. With the latter, we need to keep in mind thatAutomationToken
is not available on older SSC versions.