Exemplo n.º 1
0
        public static CvssV3TemporalScore FromCvssV2TemporalScore(CvssV2TemporalScore cvssV2TemporalScore)
        {
            var cvssV3TemporalScore = new CvssV3TemporalScore();

            switch (cvssV2TemporalScore.Exploitability)
            {
            case CvssV2Enums.Exploitability.NotDefined:
                cvssV3TemporalScore.ExploitCodeMaturity = CvssV3Enums.ExploitCodeMaturity.NotDefined;
                break;

            case CvssV2Enums.Exploitability.Unproven:
                cvssV3TemporalScore.ExploitCodeMaturity = CvssV3Enums.ExploitCodeMaturity.Unproven;
                break;

            case CvssV2Enums.Exploitability.ProofOfConcept:
                cvssV3TemporalScore.ExploitCodeMaturity = CvssV3Enums.ExploitCodeMaturity.ProofOfConcept;
                break;

            case CvssV2Enums.Exploitability.Functional:
                cvssV3TemporalScore.ExploitCodeMaturity = CvssV3Enums.ExploitCodeMaturity.Functional;
                break;

            case CvssV2Enums.Exploitability.High:
                cvssV3TemporalScore.ExploitCodeMaturity = CvssV3Enums.ExploitCodeMaturity.High;
                break;
            }

            switch (cvssV2TemporalScore.RemediationLevel)
            {
            case CvssV2Enums.RemediationLevel.NotDefined:
                cvssV3TemporalScore.RemediationLevel = CvssV3Enums.RemediationLevel.NotDefined;
                break;

            case CvssV2Enums.RemediationLevel.OfficialFix:
                cvssV3TemporalScore.RemediationLevel = CvssV3Enums.RemediationLevel.OfficialFix;
                break;

            case CvssV2Enums.RemediationLevel.TemporaryFix:
                cvssV3TemporalScore.RemediationLevel = CvssV3Enums.RemediationLevel.TemporaryFix;
                break;

            case CvssV2Enums.RemediationLevel.Workaround:
                cvssV3TemporalScore.RemediationLevel = CvssV3Enums.RemediationLevel.Workaround;
                break;

            case CvssV2Enums.RemediationLevel.Unavailable:
                cvssV3TemporalScore.RemediationLevel = CvssV3Enums.RemediationLevel.Unavailable;
                break;
            }

            switch (cvssV2TemporalScore.ReportConfidence)
            {
            case CvssV2Enums.ReportConfidence.NotDefined:
                cvssV3TemporalScore.ReportConfidence = CvssV3Enums.ReportConfidence.NotDefined;
                break;

            case CvssV2Enums.ReportConfidence.Confirmed:
                cvssV3TemporalScore.ReportConfidence = CvssV3Enums.ReportConfidence.Confirmed;
                break;

            case CvssV2Enums.ReportConfidence.Uncorroborated:
                cvssV3TemporalScore.ReportConfidence = CvssV3Enums.ReportConfidence.Reasonable;
                break;

            case CvssV2Enums.ReportConfidence.Unconfirmed:
                cvssV3TemporalScore.ReportConfidence = CvssV3Enums.ReportConfidence.Unknown;
                break;
            }

            return(cvssV3TemporalScore);
        }
Exemplo n.º 2
0
 public CvssV2Score()
 {
     BaseScore          = new CvssV2BaseScore();
     TemporalScore      = new CvssV2TemporalScore();
     EnvironmentalScore = new CvssV2EnvironmentalScore();
 }