diff --git a/schema/json/metaschema-datatypes.json b/schema/json/metaschema-datatypes.json new file mode 100644 index 000000000..133f56eb0 --- /dev/null +++ b/schema/json/metaschema-datatypes.json @@ -0,0 +1,148 @@ +{ + "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/oscal/1.0/metaschema-datatypes-schema.json", + "$comment" : "OSCAL Unified Model of Models", + "type" : "object", + "definitions" : { + "Base64Datatype": { + "description": "Binary data encoded using the Base 64 encoding algorithm as defined by RFC4648.", + "type": "string", + "pattern": "^[0-9A-Za-z+/]+={0,2}$", + "contentEncoding": "base64" + }, + "BooleanDatatype": { + "description": "A binary value that is either: true or false.", + "type": "boolean" + }, + "DateDatatype": { + "description": "A string representing a 24-hour period with an optional timezone.", + "type": "string", + "pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))(Z|[+-][0-9]{2}:[0-9]{2})?$" + }, + "DateWithTimezoneDatatype": { + "description": "A string representing a 24-hour period with a required timezone.", + "type": "string", + "pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "DateTimeDatatype": { + "description": "A string representing a point in time with an optional timezone.", + "type": "string", + "pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]*[1-9])?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|\\+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))?$" + }, + "DateTimeWithTimezoneDatatype": { + "description": "A string representing a point in time with a required timezone.", + "type": "string", + "format": "date-time", + "pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]*[1-9])?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|\\+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))$" + }, + "DayTimeDurationDatatype": { + "description": "An amount of time quantified in days, hours, minutes, and seconds.", + "type": "string", + "format": "duration", + "pattern": "^-?P([0-9]+D(T(([0-9]+H([0-9]+M)?(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+M(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+|[0-9]+(\\.[0-9]+)?)S))?)|T(([0-9]+H([0-9]+M)?(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+M(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+|[0-9]+(\\.[0-9]+)?)S)$" + }, + "DecimalDatatype": { + "description": "A real number expressed using a whole and optional fractional part separated by a period.", + "type": "number", + "pattern": "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" + }, + "EmailAddressDatatype": { + "description": "An email address string formatted according to RFC 6531.", + "allOf": [ + {"$ref": "#/definitions/StringDatatype"}, + { + "type": "string", + "format": "email", + "pattern": "^.+@.+$" + } + ] + }, + "HostnameDatatype": { + "description": "An internationalized Internet host name string formatted according to section 2.3.2.3 of RFC5890.", + "allOf": [ + {"$ref": "#/definitions/StringDatatype"}, + { + "type": "string", + "format": "idn-hostname" + } + ] + }, + "IntegerDatatype": { + "description": "A whole number value.", + "type": "integer" + }, + "IPV4AddressDatatype": { + "description": "An Internet Protocol version 4 address represented using dotted-quad syntax as defined in section 3.2 of RFC2673.", + "type": "string", + "format": "ipv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$" + }, + "IPV6AddressDatatype": { + "description": "An Internet Protocol version 6 address represented using the syntax defined in section 2.2 of RFC3513.", + "type": "string", + "format": "ipv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))$" + }, + "MarkupLineDatatype": { + "description": "", + "type": "string", + "pattern": "^[^\n]+$" + }, + "MarkupMultilineDatatype": { + "description": "", + "type": "string" + }, + "NonNegativeIntegerDatatype": { + "description": "An integer value that is equal to or greater than 0.", + "allOf": [ + {"$ref": "#/definitions/IntegerDatatype"}, + { + "type": "number", + "minimum": 0 + } + ] + }, + "PositiveIntegerDatatype": { + "description": "An integer value that is greater than 0.", + "allOf": [ + {"$ref": "#/definitions/IntegerDatatype"}, + { + "type": "number", + "minimum": 1 + } + ] + }, + "StringDatatype": { + "description": "A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9, U+10, U+32 or [ \n\t]+", + "type": "string", + "pattern": "^\\S(.*\\S)?$" + }, + "TokenDatatype": { + "description": "A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema11-2/#NCName.", + "type": "string", + "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" + }, + "URIDatatype": { + "description": "A universal resource identifier (URI) formatted according to RFC3986.", + "type": "string", + "format": "uri", + "pattern": "^[a-zA-Z][a-zA-Z0-9+\\-.]+:.+$" + }, + "URIReferenceDatatype": { + "description": "A URI Reference, either a URI or a relative-reference, formatted according to section 4.1 of RFC3986.", + "type": "string", + "format": "uri-reference" + }, + "UUIDDatatype": { + "description": "A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122.", + "type": "string", + "pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" + }, + "YearMonthDurationDatatype": { + "description": "An amount of time quantified in years and months based on ISO-8601 durations (see also RFC3339 appendix A).", + "type": "string", + "format": "duration", + "pattern": "^-?P([0-9]+Y([0-9]+M)?)|[0-9]+M$" + } + } +} diff --git a/schema/xml/metaschema-datatypes.xsd b/schema/xml/metaschema-datatypes.xsd new file mode 100644 index 000000000..722ff2cbc --- /dev/null +++ b/schema/xml/metaschema-datatypes.xsd @@ -0,0 +1,269 @@ + + + + + + Binary data encoded using the Base 64 encoding algorithm + as defined by RFC4648. + + + + + A string with at least one character and no + leading or trailing whitespace. + + + + + + + + A binary value that is either: true (or 1) or false (or 0). + + + + + + + + + A string representing a 24-hour period with an optional timezone. + + + + + + + + + A string representing a 24-hour period with a required timezone. + + + + + + + + + A string representing a point in time with an optional timezone. + + + + + + + + + A string representing a point in time with a required timezone. + + + + + + + + + An amount of time quantified in days, hours, minutes, and seconds. + + + + + + + + + A real number expressed using a whole and optional fractional part + separated by a period. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + + An email address string formatted according to RFC 6531. + + + + + + + + + + + A host name + + + + + + + + + A whole number value. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + + An Internet Protocol version 4 address represented using + dotted-quad syntax as defined in section 3.2 of RFC2673. + + + + + + + + + An Internet Protocol version 6 address represented using + the syntax defined in section 2.2 of RFC3513. + This is based on the pattern provided here: + https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + with some customizations. + + + + + + + + + An integer value that is equal to or greater than 0. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + + An integer value that is greater than 0. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + + A non-empty string of unicode characters with leading and trailing whitespace + disallowed. Whitespace is: U+9, U+10, U+32 or [ \n\t]+ + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + + + A non-empty, non-colonized name as defined by XML Schema Part 2: Datatypes + Second Edition (https://www.w3.org/TR/xmlschema11-2/#NCName), with leading and trailing + whitespace disallowed. + + + + + + + A single token may not contain whitespace. + + + + + + + + + A universal resource identifier (URI) formatted according to RFC3986. + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + + A URI Reference, either a URI or a relative-reference, formatted according to section 4.1 of RFC3986. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + + + + + + + diff --git a/schema/xml/metaschema-markup-line.xsd b/schema/xml/metaschema-markup-line.xsd new file mode 100644 index 000000000..c430944f9 --- /dev/null +++ b/schema/xml/metaschema-markup-line.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/schema/xml/metaschema-markup-multiline.xsd b/schema/xml/metaschema-markup-multiline.xsd new file mode 100644 index 000000000..33d35f539 --- /dev/null +++ b/schema/xml/metaschema-markup-multiline.xsd @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The content model is the same as inlineMarkupType, but line endings need + to be preserved, since this is preformatted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schema/xml/metaschema-prose-base.xsd b/schema/xml/metaschema-prose-base.xsd new file mode 100644 index 000000000..2c24ceb31 --- /dev/null +++ b/schema/xml/metaschema-prose-base.xsd @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An insert can be used to identify a placeholder for dynamically inserting text related to a specific object, which is referenced by the object's identifier using an id-ref. This insert mechanism allows the selection of which text value from the object to dynamically include based on the application's display requirements. + + + + The type of object to include from (e.g., parameter, control, component, role, etc.) + + + + + The identity of the object to insert a value for. The identity will be selected from the index of objects of the specified type. The specific value to include is based on the application's display requirements, which will likely use a specific data element associated with the type (e.g., title, identifier, value, etc.) that is appropriate for the application. + + + + + + + diff --git a/schema/xml/metaschema-prose-module.xsd b/schema/xml/metaschema-prose-module.xsd new file mode 100644 index 000000000..e653c0537 --- /dev/null +++ b/schema/xml/metaschema-prose-module.xsd @@ -0,0 +1,5 @@ + + + + +