Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to OSCAL Metaschema documentation and constraints #1263

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
444b9d0
completed partial update of the Metadata object documentation.
david-waltermire May 12, 2022
09135a0
completed partial update of the Metadata object documentation.
david-waltermire May 12, 2022
fb90265
adjustments to roles
david-waltermire May 27, 2022
6c07857
adjusted the cardinality of location/address to make address optional.
david-waltermire May 27, 2022
7c1f8ab
Improved documentation and constraints related to location and parties
david-waltermire May 27, 2022
2ffea0e
continued updates to the metadata metaschema.
david-waltermire Jun 3, 2022
246b9bc
further adjustments to the metadata metaschema
david-waltermire Jun 15, 2022
ddae997
additional tweeks to the metadata metaschema
david-waltermire Jun 21, 2022
5081e0e
addressed the remainder of metadata and control feedback from @Rene2mt.
david-waltermire Jun 27, 2022
7ebafd9
Improved the introductory remarks for a profile to better describe wh…
david-waltermire Jul 8, 2022
67b2c61
Fixed a broken constraint that was not targeting the right node.
david-waltermire Jul 8, 2022
b8f8309
started refining descriptions and adding properties to describe ident…
david-waltermire Jul 15, 2022
36cf6d1
added todo items
david-waltermire Jul 25, 2022
ec3a950
Feedback from AJ during 20220718-20220722. (#48)
aj-stein-nist Jul 28, 2022
364328d
Week 30 feedback on SSP model. (#49)
aj-stein-nist Aug 12, 2022
5f5a693
Proposed metaschema docs updates (#50)
wendellpiez Aug 12, 2022
4b91b6e
A.J. Stein's Week 32 Feedback for Model Review (#52)
aj-stein-nist Aug 12, 2022
6559b37
DRAFT: Update catalog & profile metaschema documentation (#51)
Rene2mt Aug 19, 2022
bb35f7f
Fixed broken syntax and addressed consistency in wording within the P…
david-waltermire Aug 19, 2022
48abac5
Adjustments to alter, moving to to an inline definition
david-waltermire Aug 19, 2022
e59b20d
cleaned up empty remark.
david-waltermire Aug 19, 2022
57eb385
Removed redundant constraints
david-waltermire Aug 19, 2022
e1d4fc3
removed some redundant constraints
david-waltermire Aug 21, 2022
4b8c028
Preliminary work on URI documentation to address #1249.
david-waltermire Aug 22, 2022
921bf4b
Preliminary work on URI documentation to address #1249.
david-waltermire Aug 22, 2022
5294ed1
More work on document URI use in OSCAL
david-waltermire Aug 24, 2022
1a27a38
Updating data types related to usnistgov/metaschema#224.
david-waltermire Aug 24, 2022
b6e1b0d
Apply suggestions from code review
david-waltermire Aug 24, 2022
7aea152
improved consistency of how URI concepts are discussed.
david-waltermire Aug 24, 2022
6c4d21b
Apply suggestions from code review
david-waltermire Aug 24, 2022
e50897c
added note about party locations
david-waltermire Aug 24, 2022
0df675d
Updated Metaschema instances of `uri` and `uri-reference` data types …
david-waltermire Aug 25, 2022
0c957aa
Add identifier props to control layer metaschemas (#55)
Rene2mt Aug 31, 2022
7894fef
Responding to #1066: metaschema edits; CSS enhancement (#56)
wendellpiez Sep 9, 2022
16f2bcd
Apply suggestions from code review
david-waltermire Sep 9, 2022
172dc90
Update docs/content/concepts/uri-use.md
david-waltermire Sep 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/concepts/identifier-use/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ By design, OSCAL supports [*machine-oriented*](#machine-oriented) and [*human-or

[*Machine-oriented*](#machine-oriented) identifiers provide a persistent identity for an entity within the OSCAL models, which can be used in other locations within related OSCAL models to reference the associated entity.

These identifiers are intended to be auto-generated by tools when the entity is initially created. In OSCAL, a machine-oriented identifier is implemented using a Universally Unique Identifier (UUID) as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). A UUID is represented in OSCAL using the [UUID datatype](/reference/datatypes/#uuid).
These identifiers are intended to be auto-generated by tools when the entity is initially created. In OSCAL, a machine-oriented identifier is implemented using a Universally Unique Identifier (UUID) as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). A UUID is represented in OSCAL using the [`uuid`](/reference/datatypes/#uuid) data type.
UUIDs were chosen because:
- Programming interfaces exist in most programming environments to generate a UUID
- UUIDs can be issued without a central authority
Expand All @@ -32,7 +32,7 @@ The [OSCAL XML Reference Index](/reference/latest/complete/xml-index/#/@uuid) an

#### Human-Oriented

A [*human-oriented*](#human-oriented) identifier incorporates semantic that support readability and processing by humans. OSCAL implements [*human-oriented*](#human-oriented) identifiers as [token](/reference/datatypes/#token) data types, which are non-colonized names. For example, control identifiers in a catalog may use a nomenclature that is familiar to the intended audience, allowing them to quickly determine what security control is being referred to, simply by its identifier value.
A [*human-oriented*](#human-oriented) identifier supports readability and use by human consumers. OSCAL implements [*human-oriented*](#human-oriented) identifiers as [`token`](/reference/datatypes/#token) data types. For example, control identifiers in a catalog may use a nomenclature that is familiar to the intended audience, allowing them to quickly determine what security control is being referred to, simply by its identifier value.

The [OSCAL XML Reference Index](/reference/latest/complete/xml-index/#/@id) and [OSCAL JSON Reference Index](/reference/latest/complete/json-index/#/id) provide a comprehensive listing of the [*human-oriented*](#human-oriented) IDs in the core OSCAL models. References to these IDs are typically named according to the referenced object type (e.g., control) followed by “-id”, as seen here in the [XML Reference Index](/reference/latest/complete/xml-index/#/@control-id) (and likewise [JSON Reference Index](/reference/latest/complete/json-index/#/control-id) in the JSON reference index).

Expand Down
171 changes: 171 additions & 0 deletions docs/content/concepts/uri-use.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
---
title: URI Usage
description: Provides information on the use of URIs in OSCAL.
weight: 40
---

According to [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) a Uniform Resource Identifier (URI) "is a compact sequence of characters that identifies an abstract or physical resource." URIs are an important concept, which are used extensively in OSCAL.

## Uniform Resource Identifier Overview

According to RFC 3986, a URI has the following syntax, which is represented in [Augmented Backus-Naur Form (ABNF)](https://www.rfc-editor.org/rfc/rfc5234.html) below.

> ```
> URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
> hier-part = "//" authority path-abempty
> / path-absolute
> / path-rootless
> / path-empty
> ```
>
> The scheme and path components are required, though the path may be empty (no characters). When authority is present, the path must either be empty or begin with a slash ("/") character. When authority is not present, the path cannot begin with two slash characters ("//"). These restrictions result in five different ABNF rules for a path ([Section 3.3](https://www.rfc-editor.org/rfc/rfc3986#section-3.3)), only one of which will match any given URI reference.
>
> The following are two example URIs and their component parts:
>
> ```
> foo://example.com:8042/over/there?name=ferret#nose
> \_/ \______________/\_________/ \_________/ \__/
> | | | | |
> scheme authority path query fragment
> | _____________________|__
> / \ / \
> urn:example:animal:ferret:nose
> ```

According to RFC 3986, a URI can be used in a few different ways. Recognizing these URI forms is important in understanding how URIs are used in OSCAL.

### URI with a Required Scheme

As indicated above with the required scheme and path components.

### Relative Reference

A URI that is a relative reference, references a resource relative to another *[base URI](https://www.rfc-editor.org/rfc/rfc3986#section-5.1)*. Such a URI is resolved using [reference resolution](https://www.rfc-editor.org/rfc/rfc3986#section-5).

The [syntax of a relative reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2) is:

> ```
> relative-ref = relative-part [ "?" query ] [ "#" fragment ]
>
> relative-part = "//" authority path-abempty
> / path-absolute
> / path-noscheme
> / path-empty
> ```

### URI Reference

A typical use of a URI, allowing a [URI with a required scheme](#uri-with-a-required-scheme) or a [relative reference](#relative-reference) to be used.

The [syntax of a URI reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.1) is:

> URI-reference = URI / relative-ref

### Absolute URI

According to RFC 3986, the [syntax of an absolute URI](https://www.rfc-editor.org/rfc/rfc3986#section-4.3) is:

> ```
> absolute-URI = scheme ":" hier-part [ "?" query ]
> ```

## URI vs URL vs URN

According to RFC 3986 section [1.1.3](https://www.rfc-editor.org/rfc/rfc3986#section-1.1.3), "a URI can be further classified as a *locator*, a *name*, or *both*." A given URI scheme is not limited to being only a name or a locator; both characteristics can be associated.

- To be a *locator*, the resource pointed to by a URI needs to have persistence.

- To be a *name*, the URI needs to be used consistently to refer to the thing that is named. A URI used only as a name is not required to resolve to a location. URIs schemes requiring an [*authority*](https://www.rfc-editor.org/rfc/rfc3986#section-3.2) element provide a means to use a registered DNS name to assert organizational control over a naming value space or namespace.

A *Uniform Resource Locator (URL)* "refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network "location")."

A URL, when applied consistently, can be used as a *name*. Optionally in such cases, the resource it resolves to can provide information about how to use the URL as a name.

A *Uniform Resource Name (URN)* "has been used historically to refer to both URIs under the `urn` scheme [RFC2141](https://www.rfc-editor.org/rfc/rfc2141), which are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable, and to any other URI with the properties of a name.

A URN is often not a good fit for use as a *locator*, since it requires a secondary resolution process that maps the URN's *name* to a specific *location*.

Due to the specific characteristics of a URL or URN, the term URI is often used to refer more broadly to all types of resource identifiers.

## URIs in OSCAL

The following sections discuss how URIs are used in OSCAL.

### OSCAL URI Data Types

OSCAL uses two data types for representing URIs.

1. [`uri`](/reference/datatypes/#uri) - A URI which must provide the required scheme and path components. This means the URI will point directly to a resolvable resource.

The `uri` data type is used in cases where a [*URI with a required scheme*](#uri-with-a-required-scheme) or an *absolute URI* is required. As a result, a [*relative reference*](#relative-reference) or a [*URI reference*](#uri-reference) is not allowed for use with this data type.

2. [`uri-reference`](/reference/datatypes/#uri-reference) - A [*URI reference*](#uri-reference), which may be a [*URI with a required scheme*](#uri-with-a-required-scheme) or a [*relative reference*](#relative-reference). This allows all forms of URIs.

### Common OSCAL URI Use Cases

URIs are used in OSCAL to provide pointers to resources in the following ways.

#### Linking to a network resolvable resource

URIs are used to point directly to a network resolvable resource.

In such cases, the URI may be:

- A [*URI with a required scheme*](#uri-with-a-required-scheme), where the scheme will likely be `https` indicating the resource can be accessed using the [Hypertext Transfer Protocol](https://www.rfc-editor.org/rfc/rfc2616.html) (HTTP) using [Transport Layer Security](https://www.rfc-editor.org/rfc/rfc8446) (TLS). Data fields supporting only this use case will have the `uri` data type.

OSCAL examples include:

- `threat-id` - ([JSON/YAML](/reference/latest/complete/json-index/#/threat-id)) ([XML](/reference/latest/complete/xml-index/#/@threat-id))
- `url` - ([JSON/YAML](/reference/latest/complete/json-index/#/url)) ([XML](/reference/latest/complete/xml-index/#/urls))

- A [*relative reference*](#relative-reference), pointing to a resource that can resolved using the current document resource as the *base URI*. Data fields supporting this use case will have the `uri-reference` data type.

OSCAL examples include:

- `href` - ([JSON/YAML](/reference/latest/complete/json-index/#/href)) ([XML](/reference/latest/complete/xml-index/#/@href))
- `source` - ([JSON/YAML](/reference/latest/complete/json-index/#/source)) ([XML](/reference/latest/complete/xml-index/#/@source))
- `filename` - ([JSON/YAML](/reference/latest/complete/json-index/#/filename)) ([XML](/reference/latest/complete/xml-index/#/@filename))

URIs serving this purpose need to be used as a *locator*. URLs are typically used for this purpose since the URI must resolve to a specific location.

#### Linking to another OSCAL object

A pointer to an OSCAL object identified by the referenced identifier, may be a [human-oriented](/concepts/identifier-use/#human-oriented) [`token`](/reference/datatypes/#token) or a [machine-oriented](/concepts/identifier-use/#machine-oriented) [`uuid`](https://pages.nist.gov/OSCAL/reference/datatypes/#uuid).

This approach uses a [*relative reference*](#relative-reference) consisting of only a URI *fragment* containing the identifier or UUID of the referenced object within the current documents effective data model. The effective data model of a document includes all objects identified with the document and any directly or transitively imported documents. Identifiers with a *cross-instance* [scope](/concepts/identifier-use/#scope) are available to importing documents.

URIs serving this purpose need to be used as a *locator*.

Any data fields supporting this use case will have the `uri-reference` data type.

A typical use of OSCAL object identifier linking is referencing a `resource` in the document's `back-matter` or an imported document's `back-matter`. For example, the back-matter resource identified by the UUID `f5a2bdb3-55ad-431e-a7ea-c0fd28fc08a0` can be referenced as follows.

```
<link rel="related" href="#f5a2bdb3-55ad-431e-a7ea-c0fd28fc08a0"/>
```

More information about the use of links to reference back-matter resources can be found in the [*Referencing Back-Matter Resources*](/learn/tutorials/general/extension/#referencing-back-matter-resources) section of the [*Extending OSCAL Models with Props and Links*](/learn/tutorials/general/extension/) tutorial.

#### Use as a naming system identifier

An absolute URI that identifies the naming system. URIs serving this purpose are used as a *name*. Data fields supporting this use case will have the `uri` data type.

OSCAL supports a number of name/value and other controlled value collections. To allow independent organization to organize these value collections, namespaces are used to partition the value spaces on an organization-by-organization basis. An [*absolute URI*](#absolute-uri) is used as the namespace identifier for these situations.

When used in this way, the authority component of the URI must use a value that the organization has control over. Typically, a DNS domain name controlled by the organization is used for this purpose.

OSCAL examples include:

- `ns` - ([JSON/YAML](/reference/latest/complete/json-index/#/ns)) ([XML](/reference/latest/complete/xml-index/#/@ns))
- `system` - ([JSON/YAML](/reference/latest/complete/json-index/#/system)) ([XML](/reference/latest/complete/xml-index/#/@system))
- `scheme` - ([JSON/YAML](/reference/latest/complete/json-index/#/scheme)) ([XML](/reference/latest/complete/xml-index/#/@scheme))

A key example of this approach is how property names are partitioned using a `ns` data element.

For example, the namespace `http://example.com/ns/oscal` is used in an OSCAL property as follows.

```
<prop ns="http://example.com/ns/oscal" name="example-name" value="example-value"/>
```

To learn more about the use of namespaces in properties, refer to the [*Extending Existing Prop Values*](/learn/tutorials/general/extension/#extending-existing-prop-values) section of the [*Extending OSCAL Models with Props and Links*](/learn/tutorials/general/extension/) tutorial.
Loading