Пример #1
0
        public TableItem GetTable([NotNull] IThreatModel model)
        {
            TableItem result = null;

            var severities = model.Severities?.Where(x => x.Visible).OrderByDescending(x => x, new SeverityComparer()).ToArray();

            if (severities?.Any() ?? false)
            {
                result = new TableItem(Name, new[]
                {
                    new TableColumn("Severity", 100),
                    new TableColumn("Description", 600)
                }, GetCells(severities));
            }

            return(result);
        }
        public TableItem GetTable([NotNull] IThreatModel model)
        {
            TableItem result = null;

            var mitigations = model.GetUniqueMitigations()?.ToArray();

            if (mitigations?.Any() ?? false)
            {
                result = new TableItem(Name, new[]
                {
                    new TableColumn("Mitigation", 200),
                    new TableColumn("Related Threats", 500)
                }, GetCells(mitigations));
            }

            return(result);
        }
Пример #3
0
        public TableItem GetTable([PostSharp.Patterns.Contracts.NotNull] IThreatModel model)
        {
            TableItem result = null;

            var strengths = model.Strengths?.Where(x => x.Visible).OrderByDescending(x => x.Id).ToArray();

            if (strengths?.Any() ?? false)
            {
                result = new TableItem(Name, new[]
                {
                    new TableColumn("Strength", 100),
                    new TableColumn("Description", 600)
                }, GetCells(strengths));
            }

            return(result);
        }
Пример #4
0
        public TableItem GetTable([PostSharp.Patterns.Contracts.NotNull] IThreatModel model)
        {
            TableItem result = null;

            var threatActors = model.ThreatActors?.OrderBy(x => x.Name).ToArray();

            if (threatActors?.Any() ?? false)
            {
                result = new TableItem(Name, new[]
                {
                    new TableColumn("Threat Actor", 100),
                    new TableColumn("Description", 600)
                }, GetCells(threatActors));
            }

            return(result);
        }
Пример #5
0
        public TableItem GetTable([PostSharp.Patterns.Contracts.NotNull] IThreatModel model)
        {
            TableItem result = null;

            var threatEvents = model.GetThreatEvents()?.ToArray();

            if (threatEvents?.Any() ?? false)
            {
                result = new TableItem(Name, new[]
                {
                    new TableColumn("Threat Type", 200),
                    new TableColumn("Severity", 50),
                    new TableColumn("Mitigations", 300)
                }, GetCells(threatEvents));
            }

            return(result);
        }
        public TableItem GetTable([NotNull] IThreatModel model)
        {
            TableItem result = null;

            var threatEvents = model.GetThreatEvents()?
                               .OrderByDescending(x => x.Severity, new SeverityComparer())
                               .ThenBy(x => x.Parent.Name)
                               .ThenBy(x => x.Name)
                               .ToArray();

            if (threatEvents?.Any() ?? false)
            {
                result = new TableItem(Name, new[]
                {
                    new TableColumn("Threat Event", 200),
                    new TableColumn("Severity", 50),
                    new TableColumn("Mitigations", 300)
                }, GetCells(threatEvents));
            }

            return(result);
        }