public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(Resources.TmtObjectPropertySchema, Resources.DefaultNamespace);

            if (result == null)
            {
                result             = _model.AddSchema(Resources.TmtObjectPropertySchema, Resources.DefaultNamespace);
                result.AppliesTo   = Scope.Entity | Scope.DataFlow | Scope.TrustBoundary;
                result.Priority    = 30;
                result.Visible     = false;
                result.System      = true;
                result.AutoApply   = false;
                result.Description = Resources.TmtObjectPropertySchemaDescription;
            }

            var id = result.GetPropertyType(ThreatModelObjectId);

            if (id == null)
            {
                id             = result.AddPropertyType(ThreatModelObjectId, PropertyValueType.String);
                id.Visible     = false;
                id.Description = Resources.ThreatModelObjectIdDescription;
            }

            var instanceId = result.GetPropertyType(ThreatModelInstanceId);

            if (instanceId == null)
            {
                instanceId             = result.AddPropertyType(ThreatModelInstanceId, PropertyValueType.String);
                instanceId.Visible     = false;
                instanceId.Description = Resources.ThreatModelInstanceIdDescription;
            }

            return(result);
        }
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Properties.Resources.DefaultNamespace);

            if (result == null)
            {
                result                       = _model.AddSchema(SchemaName, Properties.Resources.DefaultNamespace);
                result.AppliesTo             = Scope.ThreatType | Scope.ThreatEvent;
                result.AutoApply             = true;
                result.Priority              = 10;
                result.Visible               = true;
                result.System                = true;
                result.RequiredExecutionMode = ExecutionMode.Expert;
                result.Description           = Properties.Resources.ThreatsPropertySchemaDescription;
            }

            var keywords = result.GetPropertyType("Keywords");

            if (keywords == null)
            {
                keywords             = result.AddPropertyType("Keywords", PropertyValueType.Tokens);
                keywords.Visible     = true;
                keywords.Description = Resources.PropertyKeywords;
            }

            return(result);
        }
예제 #3
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            result.AppliesTo     = Scope.ThreatModel;
            result.AutoApply     = true;
            result.Priority      = 10;
            result.Visible       = false;
            result.System        = true;
            result.NotExportable = true;
            result.Description   = Resources.ThreatModelConfigPropertySchemaDescription;

            var horizontalSpacing = result.GetPropertyType("Diagram Layout Horizontal Spacing") ?? result.AddPropertyType("Diagram Layout Horizontal Spacing", PropertyValueType.Integer);

            horizontalSpacing.Visible     = false;
            horizontalSpacing.DoNotPrint  = true;
            horizontalSpacing.Description = Resources.PropertyHorizontalSpacing;

            var verticalSpacing = result.GetPropertyType("Diagram Layout Vertical Spacing") ?? result.AddPropertyType("Diagram Layout Vertical Spacing", PropertyValueType.Integer);

            verticalSpacing.Visible     = false;
            verticalSpacing.DoNotPrint  = true;
            verticalSpacing.Description = Resources.PropertyVerticalSpacing;

            return(result);
        }
예제 #4
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace);

            if (result == null)
            {
                result             = _model.AddSchema(SchemaName, Resources.DefaultNamespace);
                result.AppliesTo   = Scope.Entity;
                result.Priority    = 30;
                result.Visible     = true;
                result.System      = true;
                result.AutoApply   = false;
                result.Description = Resources.EntitiesPropertySchemaDescription;
            }

            var id = result.GetPropertyType(ThreatModelEntityId);

            if (id == null)
            {
                id             = result.AddPropertyType(ThreatModelEntityId, PropertyValueType.String);
                id.Visible     = false;
                id.Description = Resources.ThreatModelEntityIdDescription;
            }

            return(result);
        }
예제 #5
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            result.AppliesTo     = Scope.ThreatModel;
            result.AutoApply     = true;
            result.Priority      = 10;
            result.Visible       = false;
            result.System        = true;
            result.NotExportable = true;
            result.Description   = Resources.ReportingConfigPropertySchemaDescription;

            var excelSelectedFields = result.GetPropertyType("ExcelSelectedFields") ?? result.AddPropertyType("ExcelSelectedFields", PropertyValueType.Array);

            excelSelectedFields.Visible     = false;
            excelSelectedFields.DoNotPrint  = true;
            excelSelectedFields.Description = Resources.PropertyExcelSelectedFields;

            var wordDocumentPath = result.GetPropertyType("WordDocumentPath") ?? result.AddPropertyType("WordDocumentPath", PropertyValueType.SingleLineString);

            wordDocumentPath.Visible     = false;
            wordDocumentPath.DoNotPrint  = true;
            wordDocumentPath.Description = Resources.PropertyWordDocumentPath;

            var wordSections = result.GetPropertyType("WordSections") ?? result.AddPropertyType("WordSections", PropertyValueType.JsonSerializableObject);

            wordSections.Visible     = false;
            wordSections.DoNotPrint  = true;
            wordSections.Description = Resources.PropertyWordSections;

            return(result);
        }
예제 #6
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Properties.Resources.DefaultNamespace);

            if (result == null)
            {
                result             = _model.AddSchema(SchemaName, Properties.Resources.DefaultNamespace);
                result.AppliesTo   = Scope.ThreatModel;
                result.AutoApply   = true;
                result.Priority    = 10;
                result.Visible     = false;
                result.System      = true;
                result.Description = Properties.Resources.WordPropertySchemaDescription;
            }

            var ignoredListFields = result.GetPropertyType("IgnoredListFields");

            if (ignoredListFields == null)
            {
                ignoredListFields             = result.AddPropertyType("IgnoredListFields", PropertyValueType.Array);
                ignoredListFields.Visible     = false;
                ignoredListFields.Description = Resources.PropertyIgnoredListFields;
            }

            var columnWidth = result.GetPropertyType("ColumnWidth");

            if (columnWidth == null)
            {
                columnWidth             = result.AddPropertyType("ColumnWidth", PropertyValueType.Array);
                columnWidth.Visible     = false;
                columnWidth.Description = Resources.PropertyColumnWidths;
            }

            return(result);
        }
예제 #7
0
        public IPropertySchema GetSchema()
        {
            var schema = _model.GetSchema(Questions, Resources.DefaultNamespace) ?? _model.AddSchema(Questions, Resources.DefaultNamespace);

            schema.Description   = Resources.QuestionsPropertySchemaDescription;
            schema.Visible       = false;
            schema.AppliesTo     = Scope.ThreatModel;
            schema.System        = true;
            schema.AutoApply     = false;
            schema.NotExportable = false;

            return(schema);
        }
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            result.AppliesTo   = Scope.ThreatType | Scope.ThreatEvent;
            result.Priority    = 30;
            result.Visible     = true;
            result.System      = false;
            result.AutoApply   = false;
            result.Description = Resources.ThreatsPropertySchemaDescription;

            return(result);
        }
예제 #9
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            result.AppliesTo     = Scope.ThreatModel;
            result.AutoApply     = false;
            result.Priority      = 100;
            result.Visible       = false;
            result.System        = true;
            result.NotExportable = true;
            result.Description   = Resources.ResidualRiskEstimatorConfigurationPropertySchemaDescription;

            return(result);
        }
예제 #10
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            result.AppliesTo     = Scope.All;
            result.AutoApply     = false;
            result.Priority      = 10;
            result.Visible       = false;
            result.System        = true;
            result.NotExportable = false;
            result.Description   = Resources.AutoGenRulePropertySchemaDescription;

            return(result);
        }
예제 #11
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(Resources.TmtTrustBoundaryPropertySchema, Resources.DefaultNamespace) ??
                         _model.AddSchema(Resources.TmtTrustBoundaryPropertySchema, Resources.DefaultNamespace);

            result.AppliesTo   = Scope.TrustBoundary;
            result.Priority    = 90;
            result.Visible     = true;
            result.System      = false;
            result.AutoApply   = true;
            result.Description = Resources.TrustBoundaryPropertySchemaDescription;

            return(result);
        }
예제 #12
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            result.AppliesTo     = Scope.Entity;
            result.AutoApply     = true;
            result.Priority      = 10;
            result.Visible       = true;
            result.System        = true;
            result.NotExportable = true;
            result.Description   = Resources.AssociatedDiagramPropertySchemaDescription;

            return(result);
        }
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(Resources.TmtExternalInteractorPropertySchema, Resources.DefaultNamespace) ??
                         _model.AddSchema(Resources.TmtExternalInteractorPropertySchema, Resources.DefaultNamespace);

            result.AppliesTo   = Scope.ExternalInteractor;
            result.Priority    = 90;
            result.Visible     = true;
            result.System      = false;
            result.AutoApply   = true;
            result.Description = Resources.EntityPropertySchemaDescription;

            return(result);
        }
        public IPropertySchema GetSchema()
        {
            var schema = _model.GetSchema(Properties.Resources.SchemaName, Properties.Resources.DefaultNamespace);

            if (schema == null)
            {
                schema           = _model.AddSchema(Properties.Resources.SchemaName, Properties.Resources.DefaultNamespace);
                schema.Visible   = false;
                schema.AppliesTo = Scope.All;
                schema.System    = true;
                schema.AutoApply = false;
            }

            return(schema);
        }
예제 #15
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Properties.Resources.DefaultNamespace) ??
                         _model.AddSchema(SchemaName, Properties.Resources.DefaultNamespace);

            result.AppliesTo             = Scope.Process | Scope.DataStore;
            result.AutoApply             = false;
            result.Priority              = 10;
            result.Visible               = true;
            result.System                = true;
            result.NotExportable         = true;
            result.RequiredExecutionMode = ExecutionMode.Pioneer;
            result.Description           = Properties.Resources.AssetSchemaDescription;

            var descriptionPT = result.GetPropertyType("Asset Description") ??
                                result.AddPropertyType("Asset Description", PropertyValueType.String);

            descriptionPT.Visible     = true;
            descriptionPT.Description = "Description of the Asset.";

            var minValuePT = result.GetPropertyType("Min Value") ?? result.AddPropertyType("Min Value", PropertyValueType.Decimal);

            minValuePT.Visible     = true;
            minValuePT.Description =
                "Minimum estimated value of the Asset, expressed in the main currency for the Threat Model.";

            var maxValuePT = result.GetPropertyType("Max Value") ?? result.AddPropertyType("Max Value", PropertyValueType.Decimal);

            maxValuePT.Visible     = true;
            maxValuePT.Description =
                "Maximum estimated value of the Asset, expressed in the main currency for the Threat Model.";

            var effects = result.GetPropertyType("Concerns");

            if (effects == null)
            {
                effects = result.AddPropertyType("Concerns", PropertyValueType.ListMulti);
                if (effects is IListMultiPropertyType listMultiPropertyType)
                {
                    listMultiPropertyType.SetListProvider(new EffectsListProvider());
                }
            }
            effects.Visible     = true;
            effects.Description = "Main concerns for the Asset.";

            return(result);
        }
예제 #16
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Properties.Resources.DefaultNamespace);

            if (result == null)
            {
                result             = _model.AddSchema(SchemaName, Properties.Resources.DefaultNamespace);
                result.AppliesTo   = Scope.ThreatType;
                result.AutoApply   = true;
                result.Priority    = 10;
                result.Visible     = false;
                result.System      = true;
                result.Description = Resources.AutoThreatGenPropertySchemaDescription;
            }

            return(result);
        }
예제 #17
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(Resources.TmtProcessPropertySchema, Resources.DefaultNamespace);

            if (result == null)
            {
                result             = _model.AddSchema(Resources.TmtProcessPropertySchema, Resources.DefaultNamespace);
                result.AppliesTo   = Scope.Process;
                result.Priority    = 90;
                result.Visible     = true;
                result.System      = false;
                result.AutoApply   = true;
                result.Description = Resources.EntityPropertySchemaDescription;
            }

            return(result);
        }
예제 #18
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Namespace);

            if (result == null)
            {
                result             = _model.AddSchema(SchemaName, Namespace);
                result.AppliesTo   = Scope.ThreatModel;
                result.AutoApply   = false;
                result.Priority    = 10;
                result.Visible     = false;
                result.System      = true;
                result.Description = "This is a description for the Property Schema.";
            }

            return(result);
        }
        public IPropertySchema GetSchema()
        {
            var schema = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            schema.Description   = Resources.CalculatedSeverityPropertySchemaDescription;
            schema.Visible       = true;
            schema.AppliesTo     = Scope.ThreatEvent;
            schema.System        = true;
            schema.AutoApply     = true;
            schema.NotExportable = true;
            schema.Priority      = 500;

            var propertyType = schema.GetPropertyType(PropertyName) ?? schema.AddPropertyType(PropertyName, PropertyValueType.JsonSerializableObject);

            propertyType.DoNotPrint           = true;
            propertyType.Visible              = true;
            propertyType.CustomPropertyViewer = "Calculated Severity Property Viewer";
            propertyType.Description          = Resources.CalculatedSeverityDescription;

            return(schema);
        }
예제 #20
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Resources.DefaultNamespace);

            result.AppliesTo             = Scope.ThreatType | Scope.ThreatEvent;
            result.AutoApply             = true;
            result.Priority              = 10;
            result.Visible               = true;
            result.System                = true;
            result.NotExportable         = false;
            result.RequiredExecutionMode = ExecutionMode.Expert;
            result.Description           = Resources.ThreatsPropertySchemaDescription;

            var keywords = result.GetPropertyType("Keywords") ?? result.AddPropertyType("Keywords", PropertyValueType.Tokens);

            keywords.Visible     = true;
            keywords.DoNotPrint  = true;
            keywords.Description = Resources.PropertyKeywords;

            return(result);
        }
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(SchemaName, Properties.Resources.DefaultNamespace) ?? _model.AddSchema(SchemaName, Properties.Resources.DefaultNamespace);

            result.AppliesTo     = Scope.Mitigation | Scope.ThreatEventMitigation;
            result.AutoApply     = true;
            result.Priority      = 50;
            result.Visible       = true;
            result.System        = true;
            result.NotExportable = true;
            result.Description   = Properties.Resources.EffortPropertySchemaDescription;

            var effort = result.GetPropertyType("Effort");

            if (effort == null)
            {
                effort = result.AddPropertyType("Effort", PropertyValueType.List);
                if (effort is IListPropertyType listPropertyType)
                {
                    listPropertyType.SetListProvider(new ListProvider());
                    listPropertyType.Context = EnumExtensions.GetEnumLabels <Effort>().TagConcat();
                }
            }
            effort.Visible     = true;
            effort.Description = Resources.PropertyEffort;

            return(result);
        }
        public IPropertySchema GetLinksSchema()
        {
            var result = _model.GetSchema(LinksSchemaName, Properties.Resources.DefaultNamespace) ?? _model.AddSchema(LinksSchemaName, Properties.Resources.DefaultNamespace);

            result.AppliesTo     = Scope.Link;
            result.Priority      = 15;
            result.Visible       = false;
            result.System        = true;
            result.AutoApply     = false;
            result.NotExportable = true;
            result.Description   = Properties.Resources.LinksPropertySchemaDescription;

            var points = result.GetPropertyType("Points") ?? result.AddPropertyType("Points", PropertyValueType.Array);

            points.Visible     = false;
            points.DoNotPrint  = true;
            points.Description = Resources.PropertyPoints;

            return(result);
        }
        public IPropertySchema GetSchema()
        {
            var schema = _model.GetSchema(Annotations, Resources.DefaultNamespace) ?? _model.AddSchema(Annotations, Resources.DefaultNamespace);

            schema.Description   = Resources.AnnotationsPropertySchemaDescription;
            schema.Visible       = true;
            schema.AppliesTo     = Scope.All;
            schema.System        = true;
            schema.AutoApply     = false;
            schema.NotExportable = true;
            schema.Priority      = 1000;

            return(schema);
        }
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(Resources.QuantitativeRiskSchemaName, Resources.DefaultNamespace) ??
                         _model.AddSchema(Resources.QuantitativeRiskSchemaName, Resources.DefaultNamespace);

            result.AppliesTo             = Scope.ThreatModel;
            result.Priority              = 20;
            result.Visible               = false;
            result.System                = true;
            result.NotExportable         = true;
            result.AutoApply             = false;
            result.RequiredExecutionMode = ExecutionMode.Expert;
            result.Description           = Resources.ConfigurationPropertySchemaDescription;

            var currency = result.GetPropertyType("Currency") ?? result.AddPropertyType("Currency", PropertyValueType.SingleLineString);

            currency.Visible     = false;
            currency.DoNotPrint  = true;
            currency.Description = Resources.CurrencyProperty;

            var context = result.GetPropertyType("Context") ?? result.AddPropertyType("Context", PropertyValueType.SingleLineString);

            context.Visible     = false;
            context.DoNotPrint  = true;
            context.Description = Resources.FactContextProperty;

            var factProvider = result.GetPropertyType("FactProvider") ?? result.AddPropertyType("FactProvider", PropertyValueType.SingleLineString);

            factProvider.Visible     = false;
            factProvider.DoNotPrint  = true;
            factProvider.Description = Resources.FactProviderProperty;

            var fpParameters = result.GetPropertyType("FactProviderParams") ??
                               result.AddPropertyType("FactProviderParams", PropertyValueType.JsonSerializableObject);

            fpParameters.Visible     = false;
            fpParameters.DoNotPrint  = true;
            fpParameters.Description = Resources.FactProviderParamsProperty;

            var facts = result.GetPropertyType("Facts") ?? result.AddPropertyType("Facts", PropertyValueType.JsonSerializableObject);

            facts.Visible     = false;
            facts.DoNotPrint  = true;
            facts.Description = Resources.FactsProperty;

            var thresholds = result.GetPropertyType("Thresholds") ?? result.AddPropertyType("Thresholds", PropertyValueType.JsonSerializableObject);

            thresholds.Visible     = false;
            thresholds.DoNotPrint  = true;
            thresholds.Description = Resources.ThresholdsProperty;

            var lowerPercentile = result.GetPropertyType("LowerPercentile") ?? result.AddPropertyType("LowerPercentile", PropertyValueType.Integer);

            lowerPercentile.Visible     = false;
            lowerPercentile.DoNotPrint  = true;
            lowerPercentile.Description = Resources.LowerPercentileProperty;

            var upperPercentile = result.GetPropertyType("UpperPercentile") ?? result.AddPropertyType("UpperPercentile", PropertyValueType.Integer);

            upperPercentile.Visible     = false;
            upperPercentile.DoNotPrint  = true;
            upperPercentile.Description = Resources.UpperPercentileProperty;

            var referenceMeasure = result.GetPropertyType("ReferenceMeasure") ?? result.AddPropertyType("ReferenceMeasure", PropertyValueType.SingleLineString);

            referenceMeasure.Visible     = false;
            referenceMeasure.DoNotPrint  = true;
            referenceMeasure.Description = Resources.ReferenceMeasureProperty;

            var iterations = result.GetPropertyType("Iterations") ?? result.AddPropertyType("Iterations", PropertyValueType.Integer);

            upperPercentile.Visible     = false;
            upperPercentile.DoNotPrint  = true;
            upperPercentile.Description = Resources.IterationsProperty;

            return(result);
        }
        public IPropertySchema GetPropertySchema()
        {
            IPropertySchema result = _model.GetSchema(Properties.Resources.DevOpsPropertySchema,
                                                      Properties.Resources.DefaultNamespace) ?? _model.AddSchema(Properties.Resources.DevOpsPropertySchema,
                                                                                                                 Properties.Resources.DefaultNamespace);

            result.Description   = Properties.Resources.DevOpsPropertySchemaDescription;
            result.Visible       = false;
            result.AppliesTo     = Scope.Mitigation;
            result.System        = true;
            result.AutoApply     = false;
            result.NotExportable = true;

            return(result);
        }
예제 #26
0
        public IPropertySchema GetSchema()
        {
            var result = _model.GetSchema(_schemaName, Resources.DefaultNamespace) ?? _model.AddSchema(_schemaName, Resources.DefaultNamespace);

            result.AppliesTo   = _scope;
            result.Priority    = 100;
            result.Visible     = true;
            result.System      = false;
            result.AutoApply   = false;
            result.Description = Resources.TmtPropertySchemaDescription;

            return(result);
        }
예제 #27
0
        private static IPropertyJsonSerializableObject GetExtensionConfigurationProperty([NotNull] IThreatModel model, [Required] string extensionId)
        {
            var propertySchema =
                model.GetSchema("ExtensionsConfiguration", "https://github.com/simonec73/ThreatsManager") ?? model.AddSchema("ExtensionsConfiguration", "https://github.com/simonec73/ThreatsManager");

            propertySchema.AppliesTo             = Scope.ThreatModel;
            propertySchema.AutoApply             = false;
            propertySchema.NotExportable         = true;
            propertySchema.Priority              = 100;
            propertySchema.RequiredExecutionMode = ExecutionMode.Business;
            propertySchema.System  = true;
            propertySchema.Visible = false;

            var propertyType = propertySchema.GetPropertyType(extensionId) ?? propertySchema.AddPropertyType(extensionId, PropertyValueType.JsonSerializableObject);

            propertyType.Visible    = false;
            propertyType.DoNotPrint = true;

            return((model.GetProperty(propertyType) ?? model.AddProperty(propertyType, null)) as IPropertyJsonSerializableObject);
        }