public Process([NotNull] IThreatModel model, [Required] string name) { _modelId = model.Id; _model = model; _id = Guid.NewGuid(); Name = name; model.AutoApplySchemas(this); }
public TrustBoundary([NotNull] IThreatModel model, [Required] string name) : this() { _modelId = model.Id; _model = model; _id = Guid.NewGuid(); Name = name; model.AutoApplySchemas(this); }
public ThreatType([NotNull] IThreatModel model, [Required] string name, [NotNull] ISeverity severity) : this() { _id = Guid.NewGuid(); _model = model; _modelId = model.Id; Name = name; _severity = severity; _severityId = severity.Id; model.AutoApplySchemas(this); }
public DataFlow([NotNull] IThreatModel model, [Required] string name, Guid sourceId, Guid targetId) : this() { _modelId = model.Id; _model = model; _id = Guid.NewGuid(); Name = name; _sourceId = sourceId; _targetId = targetId; FlowType = FlowType.ReadWriteCommand; model.AutoApplySchemas(this); }
public ThreatEvent([NotNull] IThreatModel model, [NotNull] IThreatType threatType, [NotNull] IIdentity parent) : this() { _id = Guid.NewGuid(); _model = model; _modelId = model.Id; _parentId = parent.Id; _parent = parent; _threatType = threatType; _threatTypeId = threatType.Id; Name = threatType.Name; Description = threatType.Description; Severity = threatType.Severity; var threatTypeProperties = threatType.Properties?.ToArray(); if (threatTypeProperties?.Any() ?? false) { foreach (var property in threatTypeProperties) { AddProperty(property); } } model.AutoApplySchemas(this); }
public Vulnerability([NotNull] IThreatModel model, [NotNull] IWeakness weakness, [NotNull] IIdentity parent) : this() { _id = Guid.NewGuid(); _model = model; _modelId = model.Id; _parentId = parent.Id; _parent = parent; _weakness = weakness; _weaknessId = weakness.Id; Name = weakness.Name; Description = weakness.Description; Severity = weakness.Severity; var properties = weakness.Properties?.ToArray(); if (properties?.Any() ?? false) { foreach (var property in properties) { AddProperty(property); } } model.AutoApplySchemas(this); }