Exemplo n.º 1
0
 public ThreatInfo(Asset a, int _value, ThreatMath.Rating _vulnerability, ThreatMath.Rating tLevel)
 {
     asset         = a;
     value         = _value;
     riskId        = ++_riskId;
     vulnerability = _vulnerability;
     riskValue     = ThreatMath.CalculateRiskRating(a.GetValue(), tLevel, vulnerability);
 }
Exemplo n.º 2
0
    // Конструктор класса
    public Threat(string _name, Rating _level, Rating _ease, IEnumerable <Asset> _assets)
    {
        name  = _name;
        level = _level;
        ease  = _ease;

        foreach (var asset in _assets)
        {
            int    pRating = ThreatMath.ProbabilityRating(asset.GetValue(), _level, ease);
            Rating vRating = ThreatMath.VulnerabilityLevel(pRating, asset.GetValue(), level);
            info.Add(new ThreatInfo(asset, pRating, vRating, level));
        }
    }