Repository navigation
fix(aviator): 2509035 reject DAST-only versions in SAST audit when nothing to audit - #1152
Conversation
…thing to audit The SSC preflight returned SKIPPED for audited DAST versions before the FPR was downloaded and validated, so the DAST-FPR error was only raised for unaudited versions. When the preflight finds no issues, check version artifacts and fail with the same error if only DAST scans exist. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rsenden
left a comment
There was a problem hiding this comment.
I haven't reviewed the code in detail, but have some doubts about explicitly checking for DAST when SAST results are expected (or vice versa for DAST audit); SSC also supports many other scan types through parser plugins, and given that this is dynamic (depending on what parser plugins are installed on SSC), it may not be viable to explicitly check for each 'unexpected' engine type. Wouldn't it be better to just check whether the the expected results are present, throwing a generic exception message if not?
…T specifically SSC supports further scan types through parser plugins, so verify that the expected SAST (SCA) results are present and otherwise fail with a generic message. Drop the shared FprHandle message change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@rsenden Good point, thanks. Reworked in fe92c94: the explicit DAST check is gone. The SAST audit now checks that the version has at least one artifact with an SCA (SAST) scan, and otherwise fails with a generic message: 'Application version does not contain SAST (Fortify SCA) scan results, which are required by this operation.' This doesn't depend on which parser plugins are installed on SSC. Unit tests cover WEBINSPECT, SECURITYSCOPE, an unknown plugin type, SCA, SCA+WEBINSPECT, no scan info and no artifacts. The DAST audit already always downloads and validates the FPR, so it needed no change. |
…o audit (#1152) fix: `fcli aviator ssc audit-sast`: Fix inconsistency in error handling of mismatched audit types
Story
Defect 2509035 - Inconsistency in error handling of mismatched audit types (ValueEdge)
Why
fcli aviator ssc audit-saston an application version without SAST results behaved inconsistently depending on the version's audit state:Invalid FPR: ... DAST (WebInspect) scan, but this operation requires SAST scan results.Cause: when the SSC preflight issue count is 0, the command returns
SKIPPEDbefore the FPR is downloaded, so FPR validation never runs.What changed
AviatorSSCAuditHelper.failIfNoSastResults: when nothing is auditable, page the version's artifacts (embed=scans) and throw if none contains anSCA(SAST) scan. Only the presence of the expected scan type is checked, so scan types added through SSC parser plugins need no special handling.AbstractAviatorSSCSastAuditCommand: call it in the zero-issue branch, before the skip message.SSCArtifactHelper.hasEmbeddedScanType: made public for reuse.New error (only on the zero-issue path):
Application version does not contain SAST (Fortify SCA) scan results, which are required by this operation.Behaviour
audit-dastTests
AviatorSSCAuditCommandTest: new cases for DAST-only, other scan types, SAST-only, SAST+DAST (one or separate artifacts), artifact without scan info, and no artifacts. All pass.StreamInitializationTimeoutTest(3 tests,fcli-aviator-common) fails identically ondev/v3.xwithout this change.Out of scope / decisions
_embed.scans[].type = SCA, asSSCArtifactHelperalready assumes.