コード例 #1
0
        public static void SastReportOutput(ScanDescriptor scan, Transformer inst)
        {
            _log.Debug($"Retrieving XML Report for scan {scan.ScanId}");
            try
            {
                using (var report = CxSastXmlReport.GetXmlReport(inst.RestContext,
                                                                 inst.CancelToken, scan.ScanId))
                {
                    _log.Debug($"XML Report for scan {scan.ScanId} retrieved.");

                    _log.Debug($"Processing XML report for scan {scan.ScanId}");
                    inst.ProcessSASTReport(scan, report);
                    _log.Debug($"XML Report for scan {scan.ScanId} processed.");
                }

                inst.OutputSASTScanSummary(scan);
            }
            catch (AggregateException aex)
            {
                _log.Warn($"Multiple exceptions caught attempting to retrieve the SAST XML report for {scan.ScanId}" +
                          $" in project {scan.Project.ProjectId}: {scan.Project.ProjectName}. ");

                _log.Warn("BEGIN exception report");

                int exCount = 0;

                aex.Handle((x) =>
                {
                    _log.Warn($"Exception #{++exCount}", x);

                    return(true);
                });

                _log.Warn("END exception report");
            }
            catch (Exception ex)
            {
                _log.Warn($"Error attempting to retrieve the SAST XML report for {scan.ScanId}" +
                          $" in project {scan.Project.ProjectId}: {scan.Project.ProjectName}. ", ex);
            }
        }
コード例 #2
0
ファイル: Transformer.cs プロジェクト: GemAppSec/CxAnalytix
        public static void SastReportOutput(ScanDescriptor scan, Transformer inst)
        {
            _log.Debug($"Retrieving XML Report for scan {scan.ScanId}");
            try
            {
                using (var report = CxSastXmlReport.GetXmlReport(inst.RestContext,
                                                                 inst.CancelToken, scan.ScanId))
                {
                    _log.Debug($"XML Report for scan {scan.ScanId} retrieved.");

                    _log.Debug($"Processing XML report for scan {scan.ScanId}");
                    inst.ProcessSASTReport(scan, report);
                    _log.Debug($"XML Report for scan {scan.ScanId} processed.");
                }

                inst.OutputSASTScanSummary(scan);
            }
            catch (Exception ex)
            {
                _log.Warn($"Error attempting to retrieve the SAST XML report for {scan.ScanId}" +
                          $" in project {scan.Project.ProjectId}: {scan.Project.ProjectName}. ", ex);
            }
        }