diff --git a/src/metaschema/oscal_profile_metaschema.xml b/src/metaschema/oscal_profile_metaschema.xml index c1774c4838..430df8d6bf 100644 --- a/src/metaschema/oscal_profile_metaschema.xml +++ b/src/metaschema/oscal_profile_metaschema.xml @@ -92,6 +92,7 @@ + @@ -113,6 +114,10 @@ As is An As-is element indicates that the controls should be structured in resolution as they are structured in their source catalogs. It does not contain any elements or attributes. + + Flat + A Flat element indicates that the controls should be structured in a completely flat list. It does not contain any elements or attributes. + Combination method How clashing controls should be handled diff --git a/src/specifications/profile-resolution/profile-resolution-specml.xml b/src/specifications/profile-resolution/profile-resolution-specml.xml index e66f0f0fca..9931827f12 100644 --- a/src/specifications/profile-resolution/profile-resolution-specml.xml +++ b/src/specifications/profile-resolution/profile-resolution-specml.xml @@ -4,2006 +4,1579 @@ - Profile Resolution -

These specifications describe how to render an OSCAL profile document in - the form of an OSCAL catalog. We call this profile resolution.

-
- Reading these specifications + OSCAL Profile Resolution +
+ Abstract +

This specification provides the minimal requirements for processing an OSCAL Profile to create a new OSCAL Catalog Document. This process of applying a profile to a catalog to create a new catalog is called + Profile Resolution. Not all OSCAL Profiles will be resolved, nor are expected to be; however, the resolution requirements in this document are crucial to understanding the intended functionality of any given OSCAL Profile. + This specification is intended for software developers who intend to develop an OSCAL Profile Resolver, or for OSCAL Profile authors who want a more in-depth understanding of profile resolution. +

+
+
+ Introduction +
+ Purpose +

This document defines the normative requirements for an OSCAL Profile Resolver. Profile resolution is core to addressing a fundamental OSCAL requirement: + the representation of baselines separately from the control catalogs on which they depend). The requirements for resolution must therefore be well-defined and deterministic, + enabling tool developers and parties exchanging OSCAL Profiles can work from a common understanding.

+ +

No requirements are placed on implementation-level details, instead, requirements are laid out as what the output of resolution must look like given a certain input. + By adhering to these requirements OSCAL producers, OSCAL consumers, and any other members of the OSCAL ecosystem can create and resolve profiles deterministically, + with repeatable results, regardless of the tool used.

+
+
+
+ Reading This Document
+ Terminology -

These DRAFT specifications take the form of a tag set mapping between the OSCAL - profile and OSCAL catalog XML document models. The same mapping - (transformation from source to target) can be effected using other expressions of the OSCAL - model such as JSON or YAML object serializations. In these specifications, XML terminology - is used, with reference to XML constructs such as element and attribute, with - examples given using XML syntax: these however are for illustrative purposes only and - normative only with respect to the semantic mapping, not the syntax as such. The XML - orientation of the specification of this mapping is an expediency; in the longer term we - plan specifications that are format-agnostic. Let us know if you have an interest - in helping to recast the specs / metaschema terminology?

-

In these specifications there are references to source, target - and result. Source refers sometimes to profile documents as a type - (abstractly), and sometimes to instance profiles in operation, or elements within profiles - (particular kinds of sources). Target refers to the intended output of the - transformation, that is the catalog model generally (as a document type) or, for particular - source instances or elements, particular targets.

-

Elements in the source format are marked in these specifications to appear distinctively as - source-element (for an element named source-element).

-

Elements in the target format are marked in these specifications to appear distinctively as - target-element (for an element named target-element).

-

The term result refers to the actual results of transformation, as opposed to - the intended or expected results. Conformance to these specifications requires that a - processor's result corresponds to the target as described here, given a particular - source.

-

The term directive is used in these specifications to refer to an element or - combination of elements in source data, which is designed to affect a particular outcome in - the target catalog. For the most part, directives are in the source profile document – for - example, a set-parameter element in a profile is a directive to set a parameter - value in the target catalog.

-

In contrast to profiles, catalogs do not contain directives but instead, representations of - security controls and their parts, optionally gathered in groups, on which directives are - assumed to operate. There is one exception: the insert element in control - catalogs can be considered a directive that a parameter value (or other value, as - appropriate) be inserted into a particular location in running text (data content), when a - catalog is rendered. Since these semantics respect catalog rendering, however, not profile - resolution, they are out of scope for this document. For purposes of profile resolution, - catalogs may be considered to be passive resources from which contents are replicated - (copied): the operation of the profile, in contrast - its OSCAL semantics as opposed - to the domain-specific semantics of the information it handles – requires that it express - what is to be done and how.

-

Original order refers to the order of elements and objects as given in the - source. Canonical order refers to the correct order of elements or - objects as defined by an OSCAL format such as the catalog or profile models. That is, the - respective schemas of these models enforce order to the extent it is meaningful; where it is - not (for example, in the ordering of properties on objects in JSON), a metaschema can - nevertheless be referenced to provide an order.

-

So for example, on a JSON object, a links object and a parts object - may be given as properties on an OSCAL control object. Each of these collects a - sequence of one or more objects of the appropriate type (links or parts). As properties in - JSON, these collections are not ordered with respect to one another. However, for the sake - of a complete definition in another of OSCAL's operational contexts (namely XML), the OSCAL - catalog model stipulates that all links come before all parts. This has two consequences. - First, lossless conversion between formats is possible, even when one or both is defective - in some respect (as in this case, JSON's object model does not capture the order of object - properties): the metaschema can provide the difference, enabling a compliant OSCAL processor - to know how deterministically to emit valid XML (with respect to ordering) even from a - property set (intrinsically unordered) JSON source. Second, it ensures that the relative - ordering of links to parts will never be significant in the data: while the order of links - within links and the order of parts within parts may be significant - and can hence be preserved across representations, the order first links, then parts, - being defined by the model, becomes invariant across instances and thus insignificant.

-

Canonical order is important since there are occasions when, in order to produce valid - outputs in XML, a profile resolver must resequence items. This may happen any place where - the natural or intrinsic order resulting from splicing sequences in original order is not - correct.

-

Finally, this specification describes not only (source) profiles and (target or result) - catalogs, but control selections as well. The conceptual model of profile - resolution takes a profile through several steps, in which controls are collected from - source catalogs, combined, and potentially modified. As described by this specification, - control selections are produced during this process, as temporary collections of controls in - a transitional state. In the last phase of processing, the discrete selections are combined - into the single catalog, the target.

-

For illustrative purposes, these control selections are, like source and target formats, - also represented by tagging in examples given here, and described as intermediate targets, - even though no OSCAL processor is obliged to produce or recognize such XML at any point, as - long as it produces the same results (final outputs) from the same inputs.

-
-
- RFC 2119 Keywords -

When complete, this specification will conform to IETF RFC 2119 in its use of - keywords such as must - required and shall. At present (time of writing) an editorial pass to ensure - this consistency has not been conducted.

-
-
- Use of XPath -

Additionally, in these specifications XPath notation is used to identify elements and - attributes in the XML. A summary of some lightweight XPath syntax:

+

Many core OSCAL concepts are defined on the OSCAL Terminology Page. The most important are repeated in this document, but readers should verify their understanding of all core OSCAL terms before reading this document.

+

Additionally, many terms in the wider domain have overloaded definitions. Unless defined otherwise by OSCAL or explicitly in this document, terms are to be understood as defined in the NIST CSRC Glossary.

  • -

    element (unpunctuated) indicates an element named - element

    +

    + profile- an OSCAL Profile Document. Defines a set of inclusions, modifications, and transformations against a + catalog. See + OSCAL Profile Model. +

  • -

    @attribute (punctuated @) indicates an attribute named - attribute

    +

    + catalog- an OSCAL Catalog Document. Contains a well-defined set of + controls. See + OSCAL Catalog Model. +

  • -

    elem/@attr indicates an attribute named attr on an - element named elem

    +

    + control- an individual item in an OSCAL Catalog. See + NIST Special Publication 800-53r5for a more in-depth definition. +

  • -

    elmn[@att='val'] indicates an element elmn that has an - attribute @att with value val.

    +

    + profile resolution- The process of consuming one or more OSCAL Profiles and the OSCAL Catalogs that they reference to produce a new tailored + catalog. See + OSCAL Catalog Model. +

    +
  • +
  • +

    + source- refers to the profile document that is input into the profile resolution processor. This is the profile being resolved. In this document, when referring to objects from the + sourcedocument, the following style is used: + source-object. +

  • -
-
-
- XML examples -

Examples given to illustrate targets for particular source (example) inputs are given, like - the source, in XML notation. Sometimes, however, the expected outputs are not defined by the - inputs given and not literally present. In these cases, a description of the dynamic - (variable) contents in curly braces { }.

-

So for example where a property is added to target metadata, an example could - show

- <last-modified>{ timestamp }</last-modified> -

This indicates the last-modified element should be produced with contents - generated appropriately, namely with an actual time stamp in this case, and not the string - { timestamp }. In display, these values should also be shown with special - formatting as shown here.

-

Such highlighting is also used to indicate the beginning and end of nominal or implicit - structures described in these specifications (mainly selection), which are not - represented by tagging in the final results of resolution.

-

XML examples also indicate unspecified content using a simple (elision) - character, typically for more verbose chunks of target data whose production is specified - elsewhere in the document.

-

Finally, although examples are syntactically faithful to OSCAL, they are not necessarily - always formally valid in every respect. For example, OSCAL defines permissible, recognized - values for property names (prop/@name) and permissible values for properties with - certain names (controlled by OSCAL), and those rules may not be observed here. (OSCAL does - not permit a prop[@name='status'] to have a value of pending, for - example, as sometimes shown in this documentation). Examples are given for purposes of - illustrating profile resolution semantics only, and should not be taken as normative for any - actual use.

-
-
-
- Operational context -
- Processing context and scope -

A profile in OSCAL represents a selection and configuration of a set of - controls. In the normal case, the set of controls available to a profile is - provided by a catalog. For example, the three NIST SP 800-53 profiles representing the - impact baselines HIGH, MODERATE and LOW: each of these calls on a catalog representing the - families, controls and control enhancements described in SP 800-53/53A. In a data processing - system, this dependency can be modeled in the form of separate documents or data instances - - the (nominal) catalog and its profile, the latter being a selection, - adaptation and organization of controls, as distinct from the catalog from which those - controls are derived.

-

However, profiles may also select controls from profiles, thus deriving them from - underlying catalogs as modified by those profiles. This feature enables an organization that - wishes to promulgate guidelines or requirements to do so by publishing a set of - customizations to an existing catalog, rather than create a catalog from scratch. Profiles - can also arrange combinations of controls from more than one catalog or profile origin, - making it possible to use them to support the creation of hybrid catalogs.

-

In the general case OSCAL must support sourcing more than one catalog at once, in order to - aggregate and organize controls from disparate sources. For example, it should be routine - for a profile to acquire its controls from an authoritative standard catalog, plus a local - supplement. But multiple catalog inputs, especially when they are produced and sourced - independently of one another, may not combine without issues. In order to provide sensible - and transparent results even for incoherent inputs, this specification defines these - processes such that legible and testable results are produced even when they are formally - invalid to constraints governing the outputs. Such downstream processing errors including - validation errors are expected to be detectable and remediable. This especially applies to - situations where multiple catalogs are sourced, or where the same catalog is sourced more - than once, directly or indirectly.

-

In order to support these semantics – because whatever data set is sourced by a profile, it - must look like a catalog – the results of resolving a single profile must be in the - form of a single catalog. Two different OSCAL processors that promise profile resolution, - must deliver, for the same input, the same catalog with regard to its contents: which - controls are included; their ordering (insofar as the target format represents ordering); - and the structure (groups) in which they are embedded. This specification is designed to - make this possible, by defining outputs with sufficient rigor that the same is - meaningful and testable in this context.

-
-
- Why resolve a profile as a catalog -

A profile is a representation of a delta, a here to there. As such, a profile might - be conceived of as a recipe or instruction set – a sequence of steps or procedures – whereby - to create an OSCAL catalog (set of controls describing security requirements) from an OSCAL - catalog (set of controls describing security requirements). The primary use case for this is - when we need to make a new catalog to apply to a system or set of systems, starting from a - canonical, received, mandated or standard catalog with a more general scope.

-

This is because although catalogs - for example, the controls described in NIST SP 800-53 - - are published, available for use, and even standardized, they can never be used exactly in - the form in which they are acquired. They must be taken from the packaging and placed into - operational context before they mean anything. This typically requires that a few operations - over raw catalogs be supported by a profiling mechanism. We must be able to select - controls; we must be able to arrange them in order (or not); and we must be able to qualify - or condition them by setting parameters defined for them and making adjustments to them.

-

By representing the steps by which a base catalog can be sliced, sifted, amended and - edited, into a (nominally) finished or ready set of control requirements, a profile makes it - easier to codify and preserve even very incidental or temporary local revisions of a control - catalog. Once expressed as a profile in OSCAL format, a set of emendations to a catalog can - be managed entirely separately and independently from the catalog. Because a conformant - processor can always create the customized catalog by resolving the profile against its - sources (executing the transformation described in this document), the profile can also be - examined and used as a proxy for that catalog for other purposes. The customized catalog can - be made available wherever and for whatever purposes it is needed, while its revision and - maintenance can be focused on the profile.

-

This separation of concerns - between the originating catalog authors, who describe policy - in only general terms, and the authors of the user manual catalog, who must describe - policy in very particular and local terms - is a necessary factor in supporting sustainable - processes with the potential for automation and process improvement. An OSCAL profile - bridges the gap between a set of general guidelines, and actionable rules. Only by examining - the system in the context of the actual intentions appropriate to that system, can we - properly assess its security. Profiles make this possible.

-

In order for this to work however we need a process that can perform the necessary - operations, to apply the delta to an unmodified catalog, to produce the local view of the - catalog as modified. This is profile resolution.

-
-
- Formal validation of source and result -

In an XML context, document validation is available as a means of determining whether an - arbitrary XML document entity conforms to structural and naming constraints such as must be - assumed by processors respecting application semantics. These specifications assume that XML - inputs for profile resolution will be schema-valid with respect to the OSCAL - profile model, and hence will be tagged in the namespace - http://csrc.nist.gov/ns/oscal/1.0.

-

Similarly, the definition of the output format or results, is constrained by the OSCAL - catalog model as defined by its schema.

-
-
- Order of objects in serialization -

As described above, original order refers to the order of elements and objects - as given in the source, whereas canonical order refers to the correct - order of elements or objects as defined by an OSCAL format such as the catalog or profile - models. That is, the respective schemas of these models enforce order to the extent it is - meaningful; where it is not (for example, in the ordering of properties on objects in JSON), - a metaschema can nevertheless be referenced to restore an order.

-

So for example, on a JSON object, a links object and a parts object - may be given as properties on a control object. As properties, they are not - ordered with respect to one another. However, for the sake of a complete definition in - another of OSCAL's operational contexts (namely XML), the catalog model stipulates that all - links come before all parts: in an XML representation, link elements come before - part elements. This restriction ensures that the relative ordering of links to - parts will never be significant in the data: while the order of links within - links and the order of parts within parts may be significant and can - hence be preserved across representations, the order first links, then parts is - defined by the model, with the consequence that it can be represented as such even when an - underlying representation (such as a compiled JSON object) does not encode that relationship - natively.

-

There are occasions especially when control contents are altered or amended, when a - straightforward representation of elements in their original order, or in two sequences - spliced together (say, the parts of a control, followed by new properties for the same - control, added by the profile), would be invalid, which is to say not conformant with - canonical order. In general the rule in these cases is, in resolution, to reorder the - elements. Example

-

For any given element (defined as an assembly in the metaschema), the canonical order is - given by its model. So for example the canonical order for contents of a catalog is - metadata, param, control, group, - back-matter. Within this sequence, members may be missing, as for example not - all catalogs will have parameters or groups. Any members that are present, however, must be - given in this order.

-
-
- ID uniqueness constraint -

In addition to those described and enforced by the respective schemas, there are additional - constraints over the data that this process relies on. The most important of these is - ID-distinctiveness. Every id flag (in XML, represented by @id - attributes) on an element in the model, whether it be attached to a control, group or an - element within a control, must be distinct and unique, within the defined processing scope, - inasmuch as this value will be used in processing as a proxy for element - identity and especially (in the case of controls) for control - identity. That is, it is on the basis of their IDs that controls are selected and - referenced, and clashes are detected and recognized between competing representations of - controls.

-

In this context, defined processing scope includes a profile along with all profiles - and all catalogs it imports, directly and indirectly. Many arrangements are possible in - which a single catalog provides controls to more than a single branch on the import tree. In - profiles where this occurs, distinct imports must identify discrete, non-intersecting, sets - of controls, or clashes occur. Additionally, clashes may naturally occur through implicit - copying of parameters from multiple imports.

-

OSCAL profiles provide three different modes for handling clashing controls or replicas in - general, where replica refers to any element represented more than once. Each - of these modes is indicated by different directives given on merge/@combine, - namely keep (also the default), use-first and merge.

-

Because ID distinctiveness within the scope of processing, is critical, OSCAL - users should take care that different catalogs have distinct sets of IDs. This applies to - all structures within the catalogs, not only controls but also groups, parameters, - citations and resources.

-
-
- Defining control identity -

A central problem in profile resolution is determining when two controls are both - representations of the same control, even when those representations have dissimilar - contents or come to a profile through different import pathways.

-

For purposes of profile resolution, control identity (or parameter, group identity etc.) - can be determined by any of several ways, depending on the identity designation - mode:

-
  • -

    strict - control ID only - ordinary mode for well-controlled inputs

    +

    + target- the intended output of the transformation, a catalog document. In this document, when referring to objects of a + targetdocument, the following style is used: + target-object. +

  • -

    diagnostic - control ID + provenance identifier

    +

    + directive- refers to an object or combination of objects in source documents, which is designed to affect a particular outcome in the target catalog. For the most part, directives are in the source profile document – for example, a + set-parameterobject in a source profile is a directive to set a parameter value in the target catalog. +

  • -

    maintenance - control ID + provenance + class (version etc)

    +

    + original order- the order of objects as presented in the + sourcedocument(s). See XYZ. +

  • -

    none - no identification (each input control is distinct) - for tracing

    +

    + canonical order- the order of objects as required in the appropriate OSCAL Model (Profile, Catalog, etc.). This can differ from the above order when converting between "ordered" formats (ex. XML), and "non-ordered" formats (ex. JSON). +

-

Dev team member suggests we provide a resolution/disambiguation/debugging mode that - produces valid OSCAL by producing new IDs for everything, thereby disambiguating by brute - force. This is not a bad idea. This proposal offers that feature as 'no identity - designation', i.e. nothing is found to be identical with anything.

-
-
- Detecting issues in profiles -

It is frequently possible by static analysis to detect many conditions even in schema-valid - profile documents, that will result in problematic catalogs in resolution. The most common - issue will be clashing controls, that is more than one control in underlying catalogs with a - given identifier (ID), making references to such controls ambiguous. The identity - designation mode is intended to give profile developers some control over this - handling, for purposes of development or diagnosis; but the quality of the results can only - be guaranteed determinatively by the quality of the inputs, and full analysis in support of - profile development and diagnostics – to produce correct inputs that accurately reflect the - intent – is outside the scope of these specifications.

-
-
- Comments in result documents -

In an XML-based profile resolution, XML comments are one straightforward way for a - processor to record events or conditions without affecting the output's nominal semantics. - To support this, while two processors are obliged to return the same catalog XML for the - same profile XML inputs, they are not required to match one another's comments, whitespace - usage, attribute order, or processing instructions, only each other's elements, attributes - and data content.

-

One consequence of this is that processes intended to compare two profile resolutions may - have to accommodate differences in comments, considering them as insignificant along with - other differences in serialization.

-
-
-
- Target catalog structure -

Inasmuch as the target of profile resolution is a catalog, the resulting document is expected - to be a catalog document as specified by OSCAL, conforming to the applicable schema, XSD in - the case of OSCAL XML or JSON Schema for OSCAL object serialization formats.

-

These two approaches to validation do not constrain their respective data models – although - OSCAL-equivalent – in exactly the same way. In particular, element structures in the XML may - be represented in JSON by either objects, or arrays of objects, depending on the respective object's - OSCAL definition; and where objects appear outside arrays, ordering semantics cannot be respected (whereas in XML, order among nodes is - always an intrinsic property of the graph).

-

Consequently, where these specifications dictate that targets appear in order, it must be - understood that what is described is both (a) the order in XML, and (b) the - canonical order in OSCAL, which while it is not exposed in a JSON object - serialization, will always available to an OSCAL processor by reference to the appropriate - metaschema (in this case, the Metaschema instance that defines the catalog model).

-
- Form and organization of resolution target -

The output of a profile resolution should take the form of a catalog. Catalog results (the - output of a conformant profile resolution) will be valid to the OSCAL catalog schema.

-

At its base, an OSCAL profile source produces a catalog:

- - <profile id="profile-identifier">...</profile> - <catalog id="{ new-catalog-identifier }"> - <metadata>[Required metadata, as described below]</metadata> - { controls or control groups, as described below } - <back-matter>{ back matter as described below }</back-matter> -</catalog> - -

A valid catalog must have metadata in addition to controls and control groups. - Additionally it may have back-matter. How to produce and populate the - metadata and back-matter is described below - link me, as is the construction - of the catalog/@id in the target.

-
-
- Validation of resolution result -

Although the target of profile resolution takes the form of a catalog, it may not be valid - to all constraints that define the OSCAL catalog format, whether enforced by its schema or - by other means such as Schematron. Specifically, while a correctly implemented profile - resolution may produce a result catalog that is structurally valid, there is a mode of - operation, namely the keep-all combination rule, which can permit replication of - controls or control contents, when the control imports are redundant or contain redundant - include-controls directives. Such replication can result in violations of ID - uniqueness constraints, in particular.

-

If the merge behavior is set to combine[@method='keep'], or not given (as this - setting is the default), a profile with multiple calls on controls will result in multiple - copies of controls with clashing IDs. These should raise validation errors in the results, - since IDs must be unique on elements in document scope. Accordingly, this is an appropriate - combination rule to use in development when any potential collisions should be detected and - removed; it is also an appropriate rule to apply when a profile has been tested and found to - be free of any such collisions. Other combination rules (method='use-first' or - method='merge') are provided for special exigencies or to permit certain kinds - of optimization.

-
- top-level @id -

Because document IDs are sometimes used to distinguish data points in processing context, a - resolved profile may not present the same ID as any of the catalogs it is importing, or the - same ID as its source profile.

-

It is permitted to produce the profile’s ID in resolution via a static mapping from the ID - of the source. For example, the resolution of profile with ID profile-X might - have ID profile-X-RESOLVED.

-

BR feels this is underspecified and I agree. He also thinks that resolutions - should always have a (generated) unique IDs, since upstream catalogs can change between - resolutions.

+
+ Requirement Keywords +

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in + BCP 14 + [RFC2119] + [RFC8174]when, and only when, they appear in all capitals, as shown here. +

-
- Instance metadata -

Metadata in the target is derived directly from the source metadata, with modifications. - With the exceptions given, elements inside metadata in the source profile are - copied in their original order into the catalog. Additionally, new elements are introduced - as described here.

-

Because of options in producing metadata and especially the requirement for a timestamp, - developers and users should note that two different resolutions of the same profile will - not, ordinarily, be identical inside metadata.

-

Reworked in context of Issue #580

-
- Metadata resolution timestamp - -

The catalog document resulting from profile resolution may have a new timestamp, - reflecting its time of resolution (when the process was invoked, or executed, or when - its outputs were serialized). This is captured in the required element - metadata/last-modified.

-

Processors have the option of assigning this value sensibly in operational context. In - general, the earliest "actual" (i.e., not predated) time warranted by the facts, is to - be preferred. For example, a profile resolver that periodically refreshes a catalog of - baselines, may determine that a profile is unchanged (despite changes in underlying - catalogs), and does not require a new last-modified assignment – whereas, - even though its source profile had not changed, profile resolution results might - nonetheless change from one resolution to another, if underlying controls (in an - upstream source catalog) have changed: in this case, a new last-modified is - called for on the result catalog.

-

Optionally, a prop element with name - source-profile-last-modified may be added to the resolution target metadata with - a valid timestamp capturing the stated last-modified value from the source - document metadata. Conforming with canonical order of metadata in - the target, It must be placed into metadata structure after any title, - published, last-modified, version, - oscal-version, or document-id elements, and before any - prop, link, role, party, or - responsible-party elements. The target is schema valid, and the new - prop is given before copies of prop elements already - present.

- <metadata> - <title>Example Profile</title> - <last-modified>2019-06-30T10:54:16.372-05:00</last-modified> - <prop name="status" value="NEW"/> -</metadata> - <metadata> - <title>Example Profile</title> - <last-modified>{ timestamp of profile resolution runtime }</last-modified> - <prop name="status" value="NEW"/> -</metadata> -

The presence of this property with a valid timestamp may be taken as an indicator that - an OSCAL catalog has been produced by resolution of a profile.

-
-

Any provision for systems that cannot provide a valid timestamp?

-
- +
+ Use of YAML +

OSCAL supports a variety of serialization formats, each of which having it's own benefits and drawbacks. In this document, YAML (YAML Ain't Markup Language) is used to represent the various objects of the + sourceand + target. All examples and in-line references will be represented using + YAML 1.2. +

+

YAML maps cleanly to JSON, thus allowing easy use of existing JSON/XML transformers where needed. With that in mind, the + OSCAL Complete JSON Referenceis a valuable resource for understanding the YAML-based information structures used in this document. All JSON properties and objects defined in the reference equate to a YAML mapping, list, or dictionary. +

-
- Body of the target -

The construction of the body of the target catalog is described in the next section.

-

The body of the target catalog, after its metadata, is structured - as follows, depending on its merge directive. (Details on merging are given below .)

+
+ Reading YAML Examples +

YAML is a particularly human-readable format. For those unfamiliar with the format, the basics:

  • -

    If no merge was given, or if merge is given without - custom or as-is, controls are flat (unstructured) in the target - catalog. This mode of processing is referred to as no merge. Note that the same - merge element in the source is also the location for the combination - directive, expressed as merge/combine/@method. The combination method and the - merge rule are two distinct concepts in profile resolution; and any merge rule (no - merge, as is or custom) can work with any combination method - (keep, use-first or merge).

    -

    Conforming with canonical order, the target catalog has a content model as follows - (DTD/RNC notatation): (metadata, param*, control*, - back-matter?)

    -

    BR: note we have Issue #523 about permitting param to appear at the - top.

    +

    Each line is a key-value pair, presented as + key:value, or as + key:with any number of list items on the following lines. +

  • -

    If merge/as-is is used, the structure of the target will reflect the - structure(s) of the source catalog(s).

    -

    Conforming with canonical order, the target catalog has the content model - (metadata, param*, control*, group*, back-matter?) where - group has the model (title?, prop*, part*, param*, control*, - group*).

    +

    Indentation, spacing, and white space matters. Items below a key and indented one level in are members (or children) of that key.

  • -

    If merge/custom is used, see above. The content model of the target catalog - is the same as that for merge/as-is.

    +

    List items are represented with a preceding dash + - listitemkey:value. +

-

Unless it be for special purposes in a debugging or tracing mode, profile results may not - show any groups or structures in the form of elements not described here. Depending on the - merge directive, all groups will be given either by the catalog source(s) - (merge/as-is) or the profile (merge/custom), or there will be no - groups at all (no merge directive).

+

The YAML specification is freely available here: + YAML 1.2. +

+

Additionally, in order to unambiguously express information, this specification uses additional conventions, as described below.

+

There are some objects whose values must be determined dynamically at processing time. The most common example of this is timestamping output as it is processed. In this case, and any other dynamic-value cases, the expression + ${{ }}is used. +

+

For example:

+ last-modified: ${{ timestamp }} +

Indicates the + last-modifiedobject should be produced with contents generated appropriately, in this case, the timestamp at the time of processing. +

+

Some examples may elide content to enhance readability or save space. In these cases, a YAML comment (any line that starts with + #) will be used to explain the elision. +

+

Finally, although examples are syntactically faithful to OSCAL, they are not necessarily always formally valid in every respect. For example, OSCAL defines allowed property names ( + props) and values, and those rules may not be observed here. Examples are given for purposes of illustrating profile resolution semantics only, and should not be taken as normative for any actual use. +

-
- Back matter -

The back matter in target catalogs is assembled from the back matter of their source - profiles in combination with the back matter of source catalogs. In both catalogs and - profiles, back-matter is comprised of (multiple uses of either) - citation or resource. Either of these elements may be - cross-referenced from any location in their source documents by means of a URI fragment - identifier on an href flag, for example <resource id="document-X> - may be referenced from inside its containing document by <link - href="#document-X"> appearing elsewhere. Whether an element inside back matter must - be included in the target, depends on whether such a cross-reference has also been included - in the same target.

-

Specifically, any citation or resource inside back-matter - either in the profile, or in any imported catalog, is considered eligible for propagation - into the target if either of two conditions obtains:

+
+ Document Layout +

The specification is broken into the following major sections:

  • -

    The element (citation or resource) is referenced by any element - inside the profile metadata.

    +

    + Phases of Profile Resolution- Lays out the necessary steps and phases of profile resolution. As each phase executes, the processor is understood to be creating and editing an intermediate representation of the output. There is one section for each of the three main phases. +

  • -

    The element is referenced from a link or anchor (link or a - element) inside controls, parameters, or any contents (for example, paragraphs inside - group/part) included in the resolved profile. The link takes the form of a - URI fragment identifier #id, where id is the value of the - @id attribute of the citation or resource.

    +

    + Target Catalog Structure- Provides the requirements for structuring the final output from the intermediate representation generated throughout the previous section. +

-

The assembly of the target back-matter occurs by including copies of all - eligible citation elements followed by all eligible resource elements, - in the same order as given in their sources.

-

Additionally, combination rules (see next section) will affect whether and how duplicate or - competing citation or resource elements are handled, to remove or - combine multiple occurrences of the same referenced object.

+

+ Please note: As referenced in the Purpose section + , this specification makes no hard requirements on the specifics of implementation. It is feasible for an implementation to use no intermediate representation, and to directly and iteratively build the output. As long as all processing and output requirements are satisfied, any approach is allowed. With that said, the specification has been laid out to aid in implementation by providing a clear organization as a sequence of distinct operations. +

+
+
+ The Intermediate and Implementation Guidance +

The overall intent of this document, in addition to defining strict requirements, is to provide rough guidelines on implementing an OSCAL Profile Resolution Tool. To this end, each phase of resolution will be framed as a series of transformations applied to an internal data structure that is persistent throughout the process. We call this "the intermediate".

+

Any examples that are labelled as "Intermediate" are pseudo-code, designed to represent how this data structure might look as we apply different operations to it. The example intermediates are often not valid OSCAL, and are not to be taken as guidance, but rather a useful visualization tool for implementers.

+

The authors believe that applying the steps of resolution in order against this intermediate representation is the simplest way to achieve full compliance with the specification. However, there is no requirement to implement profile resolution in this way. Requirements are given as rules on the output of resolution, and as such, tools can operate any way they would like internally.

-
- Phases of profile resolution -

Considered as a document or integrated data set (object), a profile has three - sections, each of which corresponds to a conceptual step in resolution. To resolve a catalog - fully is to perform all these steps.

-

While the steps are described in this specification as occurring in sequence, a profile - processor is not obliged to perform them in the order described. Conformance to these - specifications is determined by whether the results of processing (resolution) - appear as described, not on whether the means to produce those results work in exactly the - manner described here.

-

The three steps are import (control selection); merge; and - modify. In brief:

+
+ Phases of Profile Processing +

An OSCAL Profile has three major sections, each which correspond to a phase of profile resolution. In order to complete the profile resolution process, each section must be fully parsed and a catalog output created.

+

It is strongly RECOMMENDED that implementations execute the following steps in the order that they are provided here. While it is possible to achieve compliance with a non-standard approach, the iterative nature of profile resolution lends itself to linear processing.

+

The three steps are + import; + merge; and + modify. In brief: +

  • -

    import identifies one or more control sources (catalogs or profiles) and the - controls within them to be included in this (resolved) profile;

    +

    + import- identifies one or more control sources (catalogs or profiles) and defines the controls within them to be included in the result catalog. If nothing is imported, no resulting catalog is produced. Invoked by + importdirectives in source profiles; +

  • -

    merge designates the rules for how controls will be organized and merged (or - not) in the result catalog;

    +

    + merge- designates the rules for how controls will be organized (ordered and/or grouped) and merged (addressing conflicts or ambiguities) in the result catalog. Controlled by the + mergedirective in source profiles; if none are included, default merge rules are used; +

  • -

    modify indicates how parameters in the underlying catalog may be modified or - set, and how control contents may be amended or modified.

    +

    + modify- indicates how controls and their parameters in the underlying catalog are to be altered, edited, amended or added in the final result catalog. Logical evaluation and parameter constraints provide advanced processing. Controlled by the + modifydirective in source profiles. If a + modifydirective is not provided, no changes will be made to the controls that have been imported/merged. +

-

The selection phase provides the basis for a customized catalog by designating - controls to be included in it; a profile that designates no controls, produces no catalog. The - selection phase is controlled by profile/import directives in the source - profile.

-

The merge phase addresses two questions: what a processor should produce in - cases of (accidental or intentional) ambiguities in control identification in the selection - phase; and how to structure the outputs, whether in a hierarchy (copied or created) or flat - (without grouping). These two aspects of resolution are addressed by the combination - rule (or combination method) and the merge rule (which - includes a no merge option). In source data (a valid profile document), a - profile/merge directive is optional; when it or its child directives are absent, - default combination and merge rules apply.

-

The modification phase is an opportunity for a profile to amend, alter or edit - controls, and to set parameter values or constrain or qualify parameters as represented in the - target. A profile can be valid and useful without making any modifications, only selections, - so the profile/modify element (node) is optional in the profile model.

-

As described in the previous section, when resolved, an OSCAL profile takes the form of an - OSCAL catalog. The merge semantics described below will produce outputs conforming to this - organization.

-
- Selection phase -

A profile begins by importing catalogs, all of whose controls are made available. The - catalogs it references may be available as static resources, or they may be produced - dynamically on request; accordingly a profile may also import profiles, to be resolved as - catalogs, instead of or in addition to catalogs as such. Imports are given in sequence after - the metadata:

- <profile> - <metadata>{ Profile metadata }</metadata> - <import href="#catalog">{ … selection of controls … }</import> - <import href="#catalog-supplemental">{ … selection of controls … }</import> -</profile> - - <profile> - <metadata>{ Profile metadata }</metadata> - <selection href="#catalog" catalog-id="{ catalog-identifier }">{ … selection of controls … }{{ end selection }} - <selection href="#catalog-supplemental" catalog-id="{ catalog-identifier }">{ … selection of controls … }{{ end selection }} -</profile> - -

The resource indicated can be either an OSCAL catalog or an OSCAL profile. A catalog - provides controls in their native form. An imported profile is resolved on import, using the - same rules for profile resolution, so a catalog is presented to the importing profile.

-

(The result of importing other endpoints or resources besides valid OSCAL catalogs and - profiles is not defined by this specification.)

-

No profile may import itself either directly or indirectly. An import directive that - indicates either the profile itself, or a profile into which it is being (currently) - imported, must be ignored. Optionally, a processor may issue a warning.

-

In an import directive, the reference to the resource to be imported appears on an - @href flag. It takes either of two forms, external or internal:

-
- External - import via URI -

An external reference appears as an absolute or relative URL

-

Indicating a file available via [prototol?]

- <import href="../../nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_catalog.xml"> - <include-controls> - <with-id>ac-1</with-id> - </include-controls> -</import> - -
-
- Internal - import via resource -

A catalog or profile to be imported can also be indicated using an internal link via a - URI fragment identifier (starting with #). If an import href resolves to a - resource elsewhere in the profile (typically in back matter), that resource - can be retrieved to provide the source catalog.

- <import href="#nist-sp800-53_catalog"> - <include-controls> - <with-id>ac-1</with-id> - </include-controls> -</import> - - ... - -<back-matter> - <resource id="nist-sp800-53_catalog"> - <desc>SP 800-53 catalog (OSCAL format) on Github</desc> - <rlink href="https://github.com/usnistgov/oscal-content/tree/master/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_catalog.xml"/> - </resource> -</back-matter> - -

A reference from an import to a resource that does not reference a catalog or profile, or - a cross-reference to something other than a resource, is inoperative for purposes of - importing. It may be signaled as an error [or warning] by a processor. Allow - processors to import other stuff as they like?

- +

As described in the previous section, when resolved, an OSCAL Profile takes the form of an OSCAL Catalog. The phases described below will produce outputs conforming to the catalog model.

+
+
+ Import Phase +

A profile begins by listing a set of catalogs and/or profiles to be imported. Each is represented by a resolvable resource URI and a directive specifying which controls to import from that resource. These resources may be available as static resources, or they may be produced dynamically on request; such as is the case when a profile is imported. Imports are given in sequence after the metadata:

+ + + +

In an import directive, the reference to the resource to be imported appears on an + hrefchild object. It takes either of two forms, external or internal: +

+

An external reference appears as an absolute or relative URL:

+ + - + https://github.com/usnistgov/oscal-content/tree + /master/nist.gov/SP800-53/rev4/yaml/NIST_SP-800-53_rev4_catalog.yaml + include-controls: ${{ list of selected controls }} + - href: "../../NIST_SP-800-53_rev5_catalog.yaml" + include-controls: ${{ list of selected controls }} ]]> + +

While an internal reference appears as below (see + ): +

+ + + +

All import directives will contain either + include-all: ~or + include-controls. These directives indicate which controls from the imported document are explicitly selected + . +

+

The following section contains requirements for processing the + importchild of a source + profile +

+
+ Import href Requirements +
+ Import URI Resolution +

Tools MUST resolve URIs by following + Section 5 of RFC3986, with the exception of URI Fragments (URIs that start with "#"). URI Fragments MUST instead be resolved as defined in + . +

-
- Availability of documents returned by given URIs -

The rules of XSLT document() apply to the traversal of any URI: that is, it - is assumed that all calls to a given (resolved) URI reference, will return the same - result.

-

If documents called for import are determined to be unavailable, the processor may drop - them along with a warning, both or either out of band (e.g. through STDERR) - or in the catalog results.

-

URIs are used as a widely supported, global address with broad utility. A processor is - not obliged, when requested for a resource, to use the given URI in an http request to - produce it. Processors may offer fallback behaviors for URI requests that fail; conversely - a processor may be able to avoid a URI request in favor of a better way to provide - resources identified by URI.

+
+ Import Resource Acquisition +

Tools MUST acquire resources at the resolved URI by following + Section 5 of RFC3986, with the exception of URI Fragments (URIs that start with "#"). URI Fragments MUST instead be acquired as defined in + . +

+

For the purposes of resolving URIs using the above specification, the Base URI MUST be considered to be the absolute URI of the containing profile.

+

In the case that acquiring a resource fails, the tool MUST cease processing and provide an error. In order to ensure profile resolution results in the same catalog regardless of which tool resolves it, all imports must successfully resolve. While this may cause inconvenience if resources are frequently not available, it ensures interoperability.

+

Note that receiving a cached version of an import, or resolving an import that is otherwise unavailable through some other (but automatic) means still satisfies the above requirement. This specification does not put requirements on the precise function of the import, as long as the correct document is retrieved.

-
- Missing imports -

An import that does not reference either an OSCAL catalog, or an OSCAL profile that can - be resolved as a catalog, is dropped.

- - <profile id="broken_profile"> - <metadata> … </metadata> - <import href="missing_profile.xml"> - <include-controls> - <with-id>ac-1</with-id> - </include-controls> - </import> -</profile> - - <profile id="home_profile_RESOLVED"> - <metadata> … </metadata> -</profile> - -

Optionally, a processor may produce a comment indicating the lapse:

- <profile id="home_profile_RESOLVED"> - <metadata> … </metadata> - <!-- referenced resource 'missing_profile.xml' cannot be resolved --> -</profile> - -
-

In this context, an OSCAL profile that makes direct or indirect reference (via its own - imports) to the importing catalog, is also dropped as unavailable. See below under - Circular Imports.

+
+ Internal References +

URI Fragments in OSCAL represent internal references to other OSCAL objects in the same document. These references follow the pattern of "#{{objectID}}". For example, the URI Fragment "#param1" is referencing the Parameter with unique ID "param1".

+

In the context of the Import Phase, internal references will only appear as a reference to a profile or catalog that is in the resources section of the source. When tools encounter such a reference, they MUST locate the object in resources with the matching ID value, and resolve the import using the + rlinkURI and the above resolution requirements. +

+

If the object fetched cannot be found or is not a valid OSCAL object, the tool MUST cease processing and provide an error.

+ + - + https://github.com/usnistgov/oscal-content/tree + /master/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev5_catalog.xml ]]> +
-
- Circular imports -

When a profile imports a profile, the subordinate profile is resolved into a catalog - using the same rules. This presents a possibility of circular imports, when a profile is - directed to import itself either directly or indirectly.

-

A circular import is defined as a directive to import a resource, which has - already been called higher in the import hierarchy. For example, if Profile A imports - Profile B, and Profile B imports Profile A, the second import is circular. (An import at - the top can only be circular if a profile tries to import itself.) If A imports B, B - imports C and C imports A, C’s import is circular.

-

Note that an import can only be circular within the context of processing a particular - profile. In the last example, C’s import would not be circular if invoked in the context - of resolving B by itself (without being imported by A), or of resolving some other profile - that did not import A. (D importing B importing C importing A would not be a problem.)

-

Circular imports are inoperative, and may be reported as an error or - warning.BR wants this to be more draconian but I am not sure every - situation warrants it. It seems like the same sort of thing as a missing import to me, - except it's missing by definition.

-

An import that is not circular (refers to a document not already imported) results in a - control selection, subject to merging with other control selections in the merge - phase.

- -

A profile identified as home_profile.xml imports another one identified as - circular_profile.xml:

- <profile id="home_profile"> - <metadata>...</metadata> - <import href="circular_profile.xml"> - <include-controls> - <with-id>ac-1</with-id> - </include-controls> - </import> -</profile> - -

In turn this file invokes home_profile.xml:

- <profile id="circular_profile"> - <metadata>...</metadata> - <import href="home_profile.xml"> - <include-controls> - <with-id>ac-1</with-id> - </include-controls> - </import> -</profile> - -

No control selection is produced for the circular import:

- <profile id="home_profile_RESOLVED"> - <metadata>...</metadata> -</profile> - -

Optionally, a processor may produce a comment indicating the lapse:

- <profile id="home_profile_RESOLVED"> - <metadata>...</metadata> - <!-- referenced resource 'home_profile.xml' cannot be resolved from resource 'circular_profile': circular dependency --> -</profile> - +
+ Resolving Imports of Profiles +

If the resource acquired is an OSCAL Profile, the tool MUST apply this specification to resolve it, then continue processing having imported the resulting catalog.

+

When a profile imports a profile, the subordinate profile SHOULD be resolved first into a catalog using this specification, before it is imported. This presents the possibility of circular imports, when a profile is directed to import itself either directly or indirectly.

+

A + circular importoccurs when a profile imports an already imported profile, which was called at an earlier place in the import hierarchy. For example, if profile A imports profile B, and profile B imports profile A, the second import is circular. (An import at the top can only be circular if a profile tries to import itself.) If A imports B, B imports C and C imports A, C’s import is circular. +

+

Note that an import can only be circular within the context of processing a particular profile. In the last example, C’s import would not be circular if invoked in the context of resolving B by itself.

+

If a processor encounters a + circular importas described above (self-imports are inherently circular), the processor MUST cease processing and generate an error. +

+ +

A profile identified as + home_profile.yamlimports another one identified as + circular_profile.yaml: +

+ + + +

In turn this file invokes + home_profile.xml: +

+ + + +

Once detected, this circular import will result in an error and no further processing will take place.

+ + +
-
+
Multiple imports -

In the selection phase, each import directive is processed to produce a set of controls - and (when they are referenced) parameters. These controls and parameters are represented - in the form of a control selection. Note that this occurs in the selection phase even if - the same catalog (resource) is imported multiple times: each distinct import collects - controls into a selection:

- - <profile id="import-twice_profile"> - <metadata> … </metadata> - <import href="#catalog"> - <include-controls> … select controls … </include-controls> - </import> - <import href="#catalog"> - <include-controls> … select controls … </include-controls> - </import> - <back-matter> … </back-matter> -</profile> - <profile id="import-twice_profile_RESOLVED"> - <metadata> … </metadata> - {{ selection id="catalog-id" }} … selected controls … {{ end selection }} - {{ selection id="catalog-id" }} … selected controls … {{ end selection }} - <back-matter> … </back-matter> -</profile> - - -

The control selections are combined and collapsed in the next phase of processing, - merge (see below) .

-

Multiple imports may result in outputs with clashing controls (see below). Typically this - will be because a control has been selected twice (in selection or in the selections of - underlying profiles), and no merge behavior has been indicated to resolve the clash.

-

Typical cases of multiple imports of the same (underlying) resource will be when a - profile A imports another profile B, which calls catalog Z, and then profile A calls - catalog Z again to acquire other controls not included in profile B, or in an original - form unmodified by profile B.

+

Each import directive is processed to produce a set of controls. Note that this occurs even if the same catalog is imported multiple times: each distinct import collects controls into a separate + selection: +

+ + + + + + +

The control inclusions are combined and collapsed in the next phase of processing, + merge(see ) . +

+

Multiple imports against the same resource are allowed, and would most commonly occur when the profile author is using to create very specific output. + Multiple imports may result in outputs with clashing control IDs if mapping or the merge directive is not set correctly.

-
- Selecting controls -

Imports can specify controls by inclusion and exclusion, either or both in - combination.

-
- Including controls -

Using inclusion, all or some controls may be selected from a catalog.

-
- Selecting by ID -

Select individual controls or controls by groups using with-id selectors - inside include-controls, corresponding to their IDs.

- - <include-controls> - <with-id>ac-1</with-id> -</include-controls> - -
-
- Matching IDs to select groups of related controls -

Controls may also be selected using match patterns against their IDs. This is useful - because related controls (either in a hierarchy, or together in a group) frequently - have related IDs as well.

- - <include-controls> - <matching pattern="ac*"/><!-- matches any control whose ID matches glob expression 'ac*' --> -</include-controls> - -

The match pattern is evaluated as a regular expression using XPath regular - expression syntax. [XXXX]

-
-
- Selecting all controls -

Select all controls from a catalog by using an include-all directive:

- - <include-all/> - -
-
- Including child and descendantcontrols -

In OSCAL, controls may contain controls. For example, in SP 800-53 many controls are - supplemented with control enhancements; in OSCAL these are represented as child - controls within parent controls. So parent AC-2 (in a given catalog) has children - AC-2(1) through AC-2(13), for example.

-

Child controls can be included by the same mechanism as controls, i.e. by means of an - ID call. Alternatively a match can frequently be applied (at least given most ID - assignment schemes) to match controls and child controls together.

-

Additionally, a @with-child-controls directive on an - include-controls indicate that all descendant controls should be - included with the applicable call(s) or match(es). Its operation is recursive in this - respect: @with-child-controls='no' applies not only to controls included - specifically, but also to those selected by means of the flag applying to their parent - (containing) controls.

-

Furthermore, include-all[@with-child-controls='no'] may select all - controls placed directly within a group, excluding all controls appearing inside other - controls.

- -
-
- Redundant calls -

Calls and matches may be combined in a single import. Their effect is cumulative; any - control that is selected by both calling and matching from a given - include-controls directive, or by matching more than one pattern, is - included once (unless it is also marked for exclusion, see ).

-
-
-
- Excluding controls -

Exclusions work the same way as inclusions, except with the opposite effect - the - indicated control(s) do not appear in the target catalog.

-

Additionally, there is no such thing as exclude-all, which is invalid and - should be considered inoperable.

-

Any control designated to be both included and excluded, is excluded. This holds - irrespective of the specificity of the selection for inclusion or exclusion. For - example, if AC-1 is included by id ac-1 and excluded by matching - ac.*, it is excluded. Selection for exclusion prevails.

-

One possible exception: what about when a control is excluded, but it has - descendant controls that are included? Under include-all, the descendants - maybe would be excluded. If the subcontrol is included by include-controls - perhaps the 'shells' of its ancestors should be included despite their nominal - exclusion. See section on "implicit inclusions under as-is", below.

-
-
- Order of controls returned in selection -

Because controls may be organized in the subsequence merge phase, order of controls - returned in the selection step is unimportant in most circumstances. If no merge - directive is applied, however, or the no merge combination rule is used (see - below), controls are returned for an import in the order of their appearance in their - catalog of origin.

-

BR suggests we revisit as an alternative would be to sort in call order. I - think the given proposal is simpler given cases of match and "all".

-
+
+ Mapping Controls +

The optional + mappingchild of a given + importprovides a simple ID remapping for objects included from that specific import. This provides the means for profile authors to proactively avoid clashing IDs of controls and other objects. +

+

The Mapping section consists of 5 optional subsections, each covering a particular type of object. Each subsection is a list of ID mappings to be applied for objects that are the parent object type.

+

When encountering a given mapping instruction, processors:

+
    +
  • +

    MUST change the distinctive ID of that object to be equal to the value of the + toobject. +

    +
  • +
  • +

    MUST update all known references to the old ID in other included content, allowing the new ID to be used in subsequent profile sections.

    +
  • +
+

Since mapping is a self contained process inside each import, the rest of this specification will continue to reference IDs with the assumption that mapping has already been applied if it was present. Since mapping is most commonly used to avoid clashing IDs, processors should take care to not handle duplicate IDs until after mapping is complete.

+

Below is a simple example of mapping. The second + importis included controls from a different catalog whose ID values happen to collide. Knowing this, the profile author has remapped those IDs to new values. +

+ + + +

Using the intermediate approach, an internal data structure resembling the following would result from the above profile:

+ + +
-
- Copying parameters -

Unlike controls, parameters are copied implicitly. Whether a parameter in the source - catalog is copied into the target depends on two factors: its location, and whether it is - referenced by an insert directive in the target catalog.

-

insert directives may occur anywhere in a catalog's data content including not - only in controls, but in other parameters. Thus a parameter may have to be included by - virtue of an insert directive, making reference to it, that occurs in another - parameter, included by virtue of a different insert directive found in an - included control.

-
- Parameters given in controls -

Any parameter (param element) that appears in a control being selected, - appears in the target, unless the parameter element was indicated by a remove directive - (see below ).

-

BR thinks such nonsense should be prevented somehow perhaps warnings or - errors. My feeling is, that's what validation is all about.

- - <control id="a1"> - <title>Control A1</title> - <param id="param-a1.a"> - <label>a1.a parameter</label> - <value>a1.a value</value> - </param> - <prop name="status" value="alive"/> - <part name="statement" id="a1-stmt"> - <p>A1 aaaaa aaaaaaaaaa</p> - </part> -</control> - - +
+
+ Including Controls +

Each import contains directives on which controls from the imported catalog are to be fetched and used for further processing. Throughout the rest of the document we will refer to this as "inclusion". + If a control is included, and the source profile makes no other changes to it, it will be present in the output. Exclusion directives in this section, as well as directives in the following two major sections (merge and modify), + may make changes to an included control or group that could cause it to appear differently, or not at all, in the output. Using the intermediate implementation approach, any control(s) that are included would be extracted from the referenced catalogs, any applicable mappings would be applied, then the controls(s) would be stored.

+
+ include-all +

When an import provides the + include-alldirective, ALL controls and groups in the referenced document (including nested controls) MUST be included: +

+ include-all: ~ +
+
+ include-controls plus with-id +

When an import provides the + include-controlsdirective, with a + with-idchild, all controls in the referenced document whose + idmatch one of the listed + idvalues MUST be included: +

+ + + +
+
+ include-controls plus matching +

Controls may also be included using match patterns against their IDs. This is useful because related controls (either in a hierarchy, or together in a group) frequently have related IDs as well.

+

When an import provides the + include-controlsdirective, with a + matchingchild, all controls in the referenced document whose + idmatches one of the listed + patternvalues (Glob matching) MUST be included: +

+

If a + matchingobject is provided with no + pattern, it MUST be treated as matching nothing. While not providing a pattern is technically valid, resolution tool implementers should be aware that it is generally undesirable, and warnings or notices to the user may be appropriate. +

+ + + +
+
+ Dealing with Nested Controls and Groups +

In OSCAL, controls may contain child controls. For instance, in SP 800-53 many controls are supplemented with control enhancements; in OSCAL these are represented as child controls within parent controls. So parent AC-2 (in a given catalog) has children AC-2(1) through AC-2(13), for example.

+

By default, inclusion of a control also causes any of that control's ancestors (or parents) to also be included. By default, inclusion of a control DOES NOT cause the inclusion of any descendants (or children) of that control to be included. This applies to both controls and groups.

+

This default behavior can be modified by the following two optional children of the + include-controlsobject. +

+
+ with-child-controls +

Child controls are, for the most part, treated the same as top level controls: they can be explicitly included using the selection directives above. As a shortcut to manually including all of the desired descendant controls of a given control, OSCAL provides the "with-child-controls" option. "with-child-controls" appears as a child object under a given inclusion directive, and defines additional behavior that is to be executed alongside the parent inclusion.

+

A + with-child-controls: yesdirective on an + include-controlsindicates that + all descendant controlsof the included control MUST also be included. +

+

A + with-child-controls: nodirective on an + include-controlsindicates that ONLY the matching control is included, any descendant children are not included. +

+

If no + with-child-controlsis provided, the processor MUST consider the directive as being equivalent to one having + with-child-controls:no. +

-
- Loose parameters -

There are two situations where parameters must be considered separately from controls, - in which case they are considered to be loose, appearing in the target directly - inside catalog or group. The first is when they have no control - parent in the source catalog (or rendered profile): they are inherently loose. - The second is when they become loose because the control in which they appear, is - not selected, but they are needed in the target, due to being referenced for insertion - elsewhere. (Examples)

-

The same parameter, however, cannot be both loose and anchored. If it is invoked from - inside its parent control, it is considered as anchored, even if it would also be called - (as loose) by virtue of insertions made outside the parent control, were the parent - control not included. That is, a param only appears loose in the resolution - target, if it is also loose in its source catalog, or if its parent control in the - source catalog is not included in the profile.

-

In general, loose parameters (parameter declarations, param) are permitted - to support flexibility for referencing, especially making multiple references to a - parameter. It may be convenient to represent a parameter that is referenced from inside - two different controls, outside both of them, or to group parameters separately from - controls for simpler management. (This does not occur in the SP800-53 - catalog.)

-

Loose parameters (that is, with catalog or group parents, not - controls) appear in the target if (only if) elsewhere in the target, some content is - also propagated, which after modification contains an insert directive - referencing this parameter. (The param/@id appears on an - insert/@param-id elsewhere in the target document.) In the target, the - param appears in the location corresponding to its location in the source, - albeit ungrouped if no merge/as-is is given, and sorted with respect to - control elements at the same level: all param elements first, - followed by all control elements, conforming to canonical order for the - catalog or group container. this is a case where the - XML and JSON requirements are different.

-

When a catalog is organized by a merge/custom directive, loose parameters - are copied into the resulting grouping structure directly preceding the first control - appearing that contains an insert directive referencing that parameter.

-

Parameters that are not referenced by an insert elsewhere in the target, do not appear - in the target. While it is not formally invalid to include unreferenced (unused) parameters, - profile resolution requires that none be included except as a special option.

+
+ with-parent-controls +

Although similar to the above + with-child-controls, the optional + with-parent-controlsapplies to parents of the included control, and has the opposite default behavior. In order to maintain the structure of the source catalog, profile resolution includes all parents of an included control by default. If a profile author wants to change this structure, they could use an exclude directive that lists all of the undesired parents. As a shortcut for this, + with-parent-controlsprovides the following functionality: +

+

A + with-parent-controls: yesdirective on an + include-controlsindicates that + all parent controlsof the included control MUST also be included. +

+

A + with-parent-controls: nodirective on an + include-controlsindicates that ONLY the matching control is included, any parents are not included. +

+

If no + with-parent-controlsis provided, the processor MUST consider the directive as being equivalent to one having + with-parent-controls:yes. +

+
+ exclude-controls +

Exclusions work the same way as inclusions, except with the opposite effect - the indicated control(s) do not appear in the target catalog.

+

Any control designated to be both included and excluded, MUST be excluded. This holds irrespective of the specificity of the selection for inclusion or exclusion. For example, if AC-1 is included by id + ac-1and excluded by matching + ac.*, it is excluded. +

+

When + exclude-controlshas at least one + with-idsor + matchingdirective, the processor MUST follow the same rules as defined in the relevant sections above for these directives, but exclude instead of include any controls. All optional features (with-child-controls, etc.) also apply to exclusion directives. +

+
+
+ Redundant Inclusions and Exclusions +

A given + importmay have any number of inclusion statements and any number of exclusion statements. Their effect is cumulative; any control that is included (or excluded) more than once MUST be considered to be included (or excluded) only once. In other words, a given control being included or excluded more than once has no effect. Exclusion still takes priority over inclusion (see above). +

+

Note that this requirement only applies to controls included within the context of a single import. Controls with duplicate IDs included under a different + importare not discarded. Also note that this redundancy pruning happens after any relevant mappings have been applied. +

+
+
+ Handling Params +

Any + paramthat is not directly under a control is referred to as a + looseparam. +

+

All loose params from both imported documents and the profile source MUST be included. These params will be kept in the final output if document contains any references to them, and discarded otherwise. See + . Since new references can be created during the + modifyphase, tools should be careful not to prune params without fully understanding the final state of the output document. +

+
+
+ Handling Groups +

Some source catalogs use + groupobjects to place controls into arbitrary groupings. Tools will need to be aware of these groups when executing the "merge" phase below, as they will duplicated into the output under the "as-is" mode and can be referenced in "custom" mode. The naïve intermediate approach would keep all groups until all other phases are complete, but implementations may find it more performant to look ahead and prune unused groups early. +

+
+
+ Avoiding Implementation Pitfalls +

In order to ensure that implementers have as much flexibility as possible, requirements in this section have purposefully been kept minimal. Below are some common issues for implementers to be aware of:

+
    +
  • The ordering and hierarchical organization of included controls as they were present in the original catalog may be used later in the resolution process. + Specifically, if the profile is using the "as-is" structuring directive, the ordering and organziation of the output should match the source catalog as closely as possible. + Implementations may want to track this information, or look ahead to see what structuring mode is being used. Note that "as-is" also requires implementations to replicate any use of the group element. +
  • +
+
-
- Merge phase -
- merge/combine - handling control collisions -

Colliding controls (or clashing) describes the condition that - occurs when multiple invocations of controls with the same ID are given, and so a profile - resolution will result in duplicative and/or contradictory information. Even given a rule - against multiple imports of the same resource, it may frequently occur that in profiles - (especially profiles under development), multiple copies – and with variations – may be - invoked from different sources. For example, if a profile tailors another profile which - includes a control with amendments, and then (the top-level profile) includes the same - control directly from its original catalog, a collision will occur between these two - variants.

-

Generally such a collision is readily detectable as long as IDs have not been modified; - in other words, constraints over uniqueness (within document scope) of IDs will be - violated in resolved instances where two (perhaps different) representations of the same - control appear. Careful profile authors will be able to detect and prevent these resulting - problems.

-

Apart from handling problems and exceptions, however, for different purposes different - profiles might wish to apply different rules. OSCAL offers three such rules: the - directives for each are given as a value on the @method attribute of a profile - merge/combine element.

-
- No merge/combine given -

If no merge directive is given in the profile, or if a merge is - given without a combine, control or parameter clashes are treated as if - merge/combine[@method='keep'] were given. A profile with no - merge directive:

- <profile> - <import href="#catalog1"/> - <import href="#catalog2"/> -</profile> -

is the same as

- <profile> - <import href="#catalog1"/> - <import href="#catalog2"/> - <merge> - <combine method="keep"/> - </merge> -</profile> - -
-
- No merge combination rule -

When a merge is indicated by merge/combine[@method='keep'], or not given, - the no merge combination rule is used. Clashing controls or parameters are not - merged. (They are kept.) Their groups are merged only if another merge - directive such as as-is is given. (The combination rules affect only the - handling of colliding controls, not their grouping in the target.)

- <merge> - <combine method="keep"/> -</merge> - -

Under this directive, colliding controls will result in invalid results, as they will - both appear in the results with the same ID. Accordingly, this setting may be useful in - ensuring integrity of references to controls as given in the profile: if any included - control is called only once, clashing controls will not be produced and validation will - succeed.

- - <profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/1.0 ../../../../xml/schema/oscal_profile_schema.xsd" - id="merge-keep_profile"> - <metadata> … </metadata> - <import href="abc-simple_catalog.xml"> - <include-controls> - <with-id>a1</with-id> - <with-id>b1</with-id> - </include-controls> - </import> - <import href="abc-simple_catalog.xml"> - <include-controls> - <with-id>a1</with-id> - <with-id>b1</with-id> - </include-controls> - </import> - <merge> - <combine method="keep"/> - </merge> -</profile> -

In the target (showing control selections):

- <profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="merge-keep_profile"> - <metadata> … </metadata> - {{ selection id="..." }} - <control id="a1"> … </control> - <control id="b1"> … </control> - {{ end selection }} - {{ selection id="..." }} - <control id="a1"> … </control> - <control id="b1"> … </control> - {{ end selection }} -</profile> -
-

In this case, downstream errors should be expected: the two a1 controls - clash with each other, as do the two b1 controls. To remove the duplicates, - either repair the source catalog to avoid the redundant invocations (usually a better - solution) or (when that is unavoidable) use a different merge combination rule.

-

Processors may optionally produce warnings when clashing controls are produced due to - redundant invocations.

-
-
- Use first merge combination rule - <merge> - <combine="use-first"/> -</merge> - -

When the use first combination rule is applied, the first reference to a given - control, with respect to the document order of the source data, prevails over later - references. First is determined in reference to a top-down, depth-first traversal - of the profile import hierarchy. So if a profile is imported before a catalog, and the - imported profile presents a representation of a control also given in the catalog - import, the profile’s representation (perhaps modified) is taken. However, if the import - directive targeting the catalog appears first, the catalog's (unmodified) representation - of the control is included.

-

The same logic applies to parameters in the source catalogs, as modified by - set-parameter directives.

- - <profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/1.0 ../../../../xml/schema/oscal_profile_schema.xsd" - id="merge-keep_profile"> - <metadata> … </metadata> - <import href="abc-simple_catalog.xml"> - <include-controls> - <with-id>a1</with-id> - <with-id>c1</with-id> - </include-controls> - </import> - <import href="abc-simple_catalog.xml"> - <include-controls> - <with-id>a1</with-id> - <with-id>b1</with-id> - </include-controls> - </import> - <merge> - <combine method="use-first"/> - </merge> -</profile> -

In the target (showing control selections):

- <profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="merge-keep_profile"> - <metadata> … </metadata> - {{ selection id="..." }} - <control id="a1"> … </control> - <control id="c1"> … </control> - {{ end selection }} - {{ selection id="..." }} - <control id="b1"> … </control> - {{ end selection }} -</profile> -
-

The use first combination rule also affects back matter, - q.v.

-
-
- Merge controls merge combination rule - <merge> - <combine="merge"/> -</merge> - -

When the merge controls merge combination rule is applied, the processor - will merge all representations of a given control, as distinguished by ID, into a single - unified representation.

-

The single unified representation is assembled by aggregating all the contents of all - the (clashing) control instances and discarding replicated branches, so that only a - single instance of each distinctive element appears in the result. The order of the - copied contents will be their original order within their controls, given in the - original order of the controls in their source catalog, then sorted into canonical order - for control contents.

-

Example:

- <control id="a1"> - <title>Control A1</title> - <prop name="label" value="A-1"/> - <prop name="status" value="pending"/> -</control> - -

merging with

- <control id="a1"> - <title>Control A1</title> - <prop name="label" value="A-1"/> - <prop name="status" value="ready"/> -</control> - -

produces

- <control id="a1"> - <title>Control A1</title> - <prop name="label" value="A-1"/> - <prop name="status" value="pending"/> - <prop name="status" value="ready"/> -</control> - -

Note that groups are not merged by this rule; for that purpose, merge/as-is - or merge/custom should be used (in addition to the combine directive).

-

Since the effect of this merge rule is to drop data silently (when it is considered to - be redundant or duplicative), it should only be used on well-understood, well-controlled - catalog and profile inputs, whose potential clashes or collisions are known in - advance.

-

BR wants SP800-53 examples and points out prop[@name='status'] is not in it. - But this is not a guide to SP800-53 it is a spec for any profile - resolution.

-
-
- Effects of combination rules on back matter -

When profiles import from more than one resource (catalog or profile), not only is - there a potential for clashing controls, but also citation and resource elements - appearing in the back matter may clash with other citations and resources, yielding - validation errors in the result when an ID appears more than once.

-

This situation is not remedied by the no merge combination rule. Under this - rule, any citation or resource that is referenced from an imported catalog or profile, - is included in the resolution target. This may result in replicated contents, where the - same element is given more than once in the target, producing violations of - ID-uniqueness constraints. For profiles that call controls from more than one import - pathway, the no merge combination may be most useful for debugging.

-

Under the use first rule (with merge/combine[@method='use-first']), - only the first citation with a given ID is kept from the set of citations - (gathered from all sources). Likewise only the first resource with a given ID - is kept from the set of resources. Note that uncontrolled identifiers may still clash – - for example, this will not prevent a citation and resource from - appearing in the result with the same ID (perhaps sourced from two different catalogs). - Maintenance and possibly revision of upstream data sets is necessary to prevent such - ambiguities.

-

Examples

-

How does the merge/combine[@method='merge'] (merge controls) - rule apply to back matter? Maybe the same as use-first. Or maybe use an approach - similar to controls.

-
+
+ Wrapping up the Import Phase +

At this point all requirements for content importing and control inclusion have been covered. If using the intermediate approach, the processor should have an intermediate that contains: a set of included controls and all of their child informational (non-control, non-group) objects, any relevant + groupobjects and their informational content, and a set of included "loose params" + (zero to many). The general structure of the intermediate would match that of the imported catalogs (i.e. Nested controls remain nested, grouped controls remain grouped). +

+
+
+
+ Merge Phase +

Profiles may contain a + mergesection, where directives are given to instruct the processor how to combine the set of included objects collected during the Import Phase. + mergehas two parts: a "combine" directive, and a "structuring" directive. +

+

It is RECOMMENDED that tools apply the "combine" directive to the intermediate generated by the Import phase first, then apply the "structuring" directive.

+

The following section contains requirements for processing the + mergechild of a source profile. +

+
+ The "combine" Directive +

+ combineis an optional child of + mergethat provides the rules for dealing with objects that have duplicate (or clashing) distinct IDs + . +

+

There are two valid combination methods provided by OSCAL, provided by the + methodchild of + combine: +

+
    +
  • +

    use-first: Use the first definition - the first control with a given ID is used; subsequent ones are discarded

    +
  • +
  • +

    keep: Keep - controls with the same ID are kept, retaining the clash

    +
  • +
+

Note that "merge: combine" is deprecated, and MUST be considered undefined behavior when encountered.

+

In order to apply the combination method, IDs of each control explicitly included are compared against one another. As IDs are unique across entire OSCAL documents, different imports or any groupings have no bearing on collision. Processing requirements for each method are described below.

+
+ No Combine Directive +

If no + mergedirective is given in the profile, or if a + mergeis given without a + combine, merge conflicts MUST be treated as if + method: keepwas given. For example, a profile with no + mergedirective: +

+ + + +

is the same as

+ + +
-
- Structuring the target -

The overall organization of the target document at the top level has been described . This section describes how a profile may dictate the body of - the target catalog, apart from its metadata or - back-matter.

-

The merge element, in addition to proposing a strategy by which to - disambiguate clashing controls, also includes directives that can be used to organize the - target catalog into a structure or hierarchy of groups. Two merge directives - are used to introduce structure into the target catalog, as-is and - custom. If neither is given, no structure is provided: parameters and - controls in the target appear in sequence, with no structure or grouping apart from what - is internal to the controls

-
- Unstructured catalog output -

Profiles that have neither of these directives are resolved as unstructured catalogs, - with no groupings of controls.

-

Unstructured catalog output is produced by emitting the contents of the sequence of - control selections produced in the selection phase, seeing to it that (for validity in - XML) they are sorted so that all loose param elements (that is, that do not - appear inside controls) appear before all control elements.

- - <profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="merge-keep_profile"> - <metadata> … </metadata> - {{ selection id="…" }} - <param id="p1"> … </param> - <control id="a1"> - <param id="p3"> … </param> - … </control> - <control id="c1"> … </control> - {{ end selection }} - {{ selection id="…" }} - <param id="p2"> … </param> - <control id="b1"> … </control> - {{ end selection }} -</profile> - <catalog xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="{ catalog-id }"> - <metadata> … </metadata> - <param id="p1"> … </param> - <param id="p2"> … </param> - <control id="a1"> - <param id="p3"> … </param> - … </control> - <control id="c1"> … </control> - <control id="b1"> … </control> -</profile> - -
-
- Merging as is -

An as-isdirective is used to reproduce the structure of a source catalog in - the target catalog. When more than one catalog is referenced by a profile, the - as-is directive produces a catalog that combines the grouping structures of - all the source catalogs.

-

(consider case of multiple imports of single resource – we need to track - catalog identity here)

-
- Implicit inclusions under as-is -

Under as is, a resolved profile’s structure is expected to replicate the - structure of source catalogs.

-

This is achieved by propagating, with all controls that are included, all groups that - they appear within, along with the groups’ IDs, titles and other contents, including - any parameters to be referenced in the target ( ) or - part element children; but not including any controls not included in one - or another control selection, directly or indirectly. Controls may be included into a - group indirectly when merging as is, by virtue of containing controls - that have been included

-

Groups that do not include controls that have been included (either directly or as - descendants of contained groups), are not propagated to the target.

-

This is slightly different from groups, which may in valid inputs have other contents - – besides titles, controls, or groups – that profile authors wish to see copied into - the customized catalog.

-

Example:

- <control id="xyz-1"> - <title>Basic Household</title> - <control id="xyz-1.1"><!-- bedtime routine -->...</control> - <control id="xyz-1.2"> - <title>Kitchen cleanup</title> - <control id="xyz-1.2.1"><!-- kitchen trashcan -->...</control> - </control> - <control id="xyz-1.3"><!-- newspaper delivery -->...</control> -</control> - - -

In this case the profile does not designate either control xyz-1 or - control xyz-1.2 for inclusion

- <import href="#XYZ-catalog"> - <include-controls> - <call control-id='xyz-1.1'/><!-- bedtime routine --> - <call control-id='xyz-1.2.1'/><!-- kitchen trashcan --> - </include-controls> -</import> - -

The unmentioned elements are included, however, with their titles, because controls - that they contain are included. But control xyz-1.3 does not appear in - the target.

- <control id="xyz-1"> - <title>Basic Hygiene</title> - <control id="xyz-1.1"><!-- bedtime routine -->...</control> - <control id="xyz-1.2"> - <title>Kitchen cleanup</title> - <control id="xyz-1.2.1"><!-- kitchen trashcan -->...</control> - </control> -</control> - - -

Note that this means there may be controls that are selected implicitly by - as-is merging, over and above controls actually designated in import - statements. Thus the control set, considered strictly, of the target of an - as-is process, will be different from the control set delivered by a - no merge process.

-

Processors may optionally provide services for detection of nesting and structural - issues related to the importing and merging of controls, including but not limited to - validation / detection utilities (for imports regarded as incorrect, incomplete or - otherwise subject to improvement); runtime warnings; or user interfaces.

-
-
- Group contents under merging as-is -

One title only. Other contents? Elements and controls are subject to the merge - combination rules. Other kinds of contents of groups …

-
-
-
- Merging into a new structure: custom -

The merge/custom directive provides a way to provide a target catalog with a - custom structure. It combines include-controls directives, which indicate - only the controls to be included, into groups, which provide the target with its - structure.

-

The controls to be included must be selected in the profile's import. A call or match - appearing inside custom, if it refers to controls not selected, is - inoperative.

-

The structures given inside the custom assembly indicate the structure of - the target catalog. They produce this structure by mapping one for one. Unlike - as-is merging, there is no implicit inclusion of controls by virtue of - including descendant controls. Instead, all controls are included in the target in the - locations indicated by the custom structure.

-
- Grouping controls inside a custom structure -

A group element given in a custom structure results in an analogous - group. Its attributes (flags) are copied to the target catalog to appear - on the group in the target. All element contents inside the group, - including title, param, prop and part - elements are likewise copied into the target, appearing in the same order as in the - source.

-

Within custom, include-controls reference controls in much the - same way as they do when given in import - a control is identified by - @id using with-id or by glob match on - matching/@pattern).

-

A with-id results in including, at that point inside the new grouping, - all controls with the @id given by the with-id. They - should be given in the same order as they appear in the control selection(s). Note - that merge combination rules apply, so depending on settings, conflicts - between controls with the same @id may be resolved.

-

A matching directive results in including, at that point inside the new - grouping, all controls whose @id matching, as an XPath regular expression, - the pattern given in the matching/@pattern. This may result in several or - many controls; again they are given in the same order as they have in the control - selection(s). Again, among clashing controls (that have the same ID), merge - combination rules apply.

-

Within merge, controls to be placed include-controls can also - indicate the order that the selected controls are to be emitted in the result catalog - using an @order attribute. Three values must be supported:

-
    -
  • -

    ascending will sort all included controls, whether selected by - with-id (literal ID) or matching (matching ID to glob - expression), into ascending alphanumeric order. collation - guidance?

    -
  • -
  • -

    descending will sort all included controls, whether selected by - with-id (literal ID) or matching (matching ID to glob - expression), into descending alphanumeric order.

    -
  • -
  • -

    keep indicates that controls should be inserted in the order of - their appearance, first among import selections, then in the order they appear in - their (imported) catalog source.

    -
  • -
- - <profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="merge-custom_profile"> - <metadata> … </metadata> - <import href="abc-simple_catalog.xml"> - <include-controls> - <with-id>a1</with-id> - <with-id>a2</with-id> - <with-id>b1</with-id> - <with-id>b2</with-id> - <with-id>c1</with-id> - <with-id>c2</with-id> - </include-controls> - </import> - <merge> - <custom> - <group> - <title>New Group I</title> - <insert-controls order="ascending"> - <include-controls> - <with-id>c1</with-id> - <with-id>a1</with-id> - <with-id>b1</with-id> - </include-controls> - </insert-controls> - </group> - <group> - <title>New Group II</title> - <insert-controls order="ascending"> - <include-controls> - <with-id>b2</with-id> - <with-id>c2</with-id> - </include-controls> - </insert-controls> - </group> - </merge> -</profile> - <catalog xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="{ new-catalog-identifier }"> - <metadata> … </metadata> - <group> - <title>New Group I</title> - <control id="a1"> … </control> - <control id="b1"> … </control> - <control id="c1"> … </control> - </group> - <group> - <title>New Group II</title> - <control id="b2"> … </control> - <control id="c2"> … </control> - </group> -</profile> -

In this example, control a2 does not appear in the target - catalog, as a custom structure was indicated (by the presence of the source profile - merge/custom), but the control never referenced from inside an - insert-controls directive in the custom structure.

-

When a custom structure references a control that is not included in any control - selection (in the import phase), the reference is inoperative. A processor may - signal a warning in this case.

-

Similarly, no error occurs if a control is selected (appears in a control selection - or even more than one), but it is never referenced from the custom - structure given. The control does not appear in the target catalog. Again, a - processor may optionally signal a warning if this occurs.

-
- - <profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="merge-custom_profile"> - <metadata> … </metadata> - <import href="abc-simple_catalog.xml"> - <include-controls> - <with-id>a1</with-id> - <with-id>a2</with-id> - <with-id>b1</with-id> - <with-id>b2</with-id> - <with-id>c1</with-id> - <with-id>c2</with-id> - </include-controls> - </import> - <merge> - <custom> - <include-controls> - <with-id>b2</with-id> - <with-id>c2</with-id> - </include-controls> - <group id="group1"> - <title>New Grouping</title> - <with-id>a1</with-id> - <with-id>b1</with-id> - <group id="group2"> - <with-id>c1</with-id> - </group> - </group> - </merge> -</profile> - <catalog xmlns="http://csrc.nist.gov/ns/oscal/1.0" - id="{ new-catalog-identifier }"> - <metadata> … </metadata> - <control id="b2"> … </control> - <control id="c2"> … </control> - <group id="group1"> - <title>New Grouping</title> - <control id="a1"> … </control> - <control id="b1"> … </control> - <group id="group2"> - <control id="c1"> … </control> - </group> - </group> -</profile> -

In this case, no group container appears in the target for the controls - b2 and c2; because they appear unwrapped before the - group in the profile source, they appear the same way in the target - catalog. Control c2, however, appears in a subgroup group2 - inside the group with ID group1 , again reflecting the source - organization. Note also that @id flags are copied.

-

Again, no provision is made to prevent duplicate or colliding controls from - appearing. Optionally, a processor may signal warnings when it determines that - controls from selections are designated to appear in the results more than once, due - to multiple colliding occurrences of include-controls/with-id and - include-controls/matching inside custom.

-
-
-
- with-child-controls inside a custom catalog structure -

Effect of setting to 'yes' or 'no' in this context?

-
-
+
+ + method:keep + +

When a merge is indicated by + method:keep, or not given, the + keepcombination rule is used. Any controls with the same distinctive ID + MUST NOT not merged. (They are kept.) +

+ + + +

Under this directive, colliding controls will result in invalid results, as they will both appear in the results with the same ID. Accordingly, this setting may be useful in ensuring integrity of references to controls as given in the profile: if any included control is called only once, clashing controls will not be produced and validation will succeed.

+ + + +

In the intermediate (showing control inclusions):

+ + + +

In this case, downstream errors should be expected: the two + ac-1controls clash with each other, as do the two + ac-2controls. +

+

Processors SHOULD provide a warning under this directive when duplicate controls are detected. The processor MAY throw an error and cease processing (short-circuiting a certain future error).

+
+
+ + method:use-first + + + + +

When the + use-firstcombination rule is applied, and controls that share a distinctive ID are found, the first control encountered MUST be kept, the rest MUST be discarded. + FirstMUST be determined by a top-down, depth-first traversal of the source profile's import hierarchy. +

+ + + + +

In the intermediate(showing control inclusions):

+ + + +
+
+
+ + method:merge + +

Deprecated, unspecified behavior.

-
- Modification phase -

(Aka patching) Explicit modification of control content

-

There are two ways a control may need to be modified. Commonly, controls might be amended – - new material might be added. (For example, the priority marker properties P1-P3 in the - SP800-53 LOW MODERATE and HIGH baselines.) Less commonly, materials might be removed or - edited.

-

OSCAL does not provide for changing a control, but editing can be achieved by - removing contents and adding (edited) contents back. This can be achieved at the control - level, or, when constituent elements inside a control have distinct IDs, at more granular - levels as well. Features make it easy both to trim (filter) and to supplement catalogs.

-

In addition to any modification or adjustment to controls, this section of a profile is - used to set parameter values or other properties of parameters declared in catalogs and - referenced from their text. Parameters are propagated with the profile's setting into the - target catalog for its use.

-
- Setting Parameters -

Modification of parameter settings is indicated using set-parameter.

-

Parameters are not always given within controls. A profile resolution target must include - copies (with or without modifications or settings) of all parameters defined within the - source catalog, which are referenced from insert directives anywhere inside - included controls.

-

Accordingly, any parameter referenced by an insert in any source catalog is - copied from catalog source to target parameter propagation rules for merge/as-is, - merge/custom without any configuration required in the profile.

-

However, a profile should not reproduce parameters from source catalogs, which are not - referenced from insert directives.

-

When parameters are propagated, they may be modified by set-parameter - directives given in the profile.

-

If more than one set-parameter directive is given for the same parameter, all - are applied, in the sequence given in the profile. [XXX even when - merge/combine/@method='use-first'?]

+
+ The "structuring" Directive +

This section describes how a profile may dictate the structure of the target + catalog, apart from its + metadataor + back-matter. Optionally, one of three "structuring" directives can be included as a child of + merge: + flat, + as-isand + custom. When one of these appears, it is the selected structuring directive. If more than one appears, processors MUST generate an error and cease processing. Processing requirements for each are given below: +

+
+ No Structuring Directive +

If no + mergedirective is given in the profile, or if a + mergeis given without a structuring directive, structuring the output MUST be treated as if the structuring directive + flatwas given. For example, a profile with no + mergedirective: +

+ + + +

is the same as

+ + + +
+
+ "flat" +

Profiles with the "flat" merge directive are resolved as unstructured catalogs, with no groupings of controls.

+

Unstructured catalog output MUST be produced by adhering to the following requirements:

  • -

    A set-parameter/label replaces the param/label on the affected - parameter

    +

    All included controls are output to the target as a flat list directly under "catalog".

  • -

    A set-parameter/value - or a set-parameter/select replaces any - param/value or param/select on the affected parameter

    +

    Any included "loose params" are output to the target as a flat list directly under "catalog".

  • +
  • Any groups are discarded.
  • +
+

An example of flat structuring is provided below

+ + + + + + + + + +
+
+ + as-is + +

An + as-isdirective is used to reproduce the structure of the source documents in the target catalog. +

+

Processors MUST handle the + as-isdirective by adhering to the following requirements: +

+
  • -

    Other elements given in a set-parameter are added to the affected - parameter, after elements of the same name

    +

    All included controls are output to the target, keeping the structure of the groups and nested controls. Any group that holds an included control MUST appear in the output with all of its non-control children intact. + If an included control has a parent control that was not included, that control's output location is "up-leveled", or made equal to the non-included parent. This applies recursively until the control is directly under either "catalog" or another included control.

  • -

    The prescribed order of elements in the affected parameter is retained: - label; usage; constraint; guideline; - value or select (a choice); and link.

    +

    Any included "loose params" are output to the target as a flat list directly under "catalog".

-

[example]

- <param id="p1"> - <title>Password length</title> - <value>10</value> -</param> - - <set-param param-id="p1"> - <select> - <choice>10</choice> - <choice>11</choice> - </select> -</set-param> - -

Note that select replaces value:

- <param id="p1"> - <title>Password length</title> - <select> - <choice>10</choice> - <choice>11</choice> - </select> -</param> - -
- Setting a missing parameter -

A set-parameter directive whose @param-id does not correspond to - any parameter in the resolved catalog, is inoperative.

-

Optionally, a processor may issue a warning where such directives are found.

-
+

Example:

+ + + + + + + + +
-
- Altering controls -

A control can be altered by an alter directive on a control. The - @control-id flag on the alter indicates the control to which the - alteration is applied.

-
- Adding contents to controls -

Contents may be added to controls using an add directive inside an alter directive. - There are two forms of alteration: with implicit and explicit bindings.

-
- Implicit binding -

An add directive with no id-ref flag is taken to apply to the - control as a whole. Its position flag may be either of two values: - starting and ending.

-

The contents of the add directive are then added to the control contents in the - target, either after its title when position is - starting, or at the end if its position is ending, or not - given.

-

However, control contents in catalogs must appear in the order title, param, - prop, link, part, control. Subsequent to adding new elements, the control - contents are sorted to appear in the required order. As a consequence, a new - prop appears after any prop already in the control, when - position is ending, or not given,, or before any - prop in the control when position is - starting.

-

When add has no @ref-id (has an implicit binding), the position - values before and after are treated like - starting and ending, respectively. The schema - permits these values.

- -

An addition operating on a control with implicit binding and position - starting

- <control id="a1"> - <title>Basic precautions</title> - <prop name="status" value="ready"/> -</control> - <alter control-id="a1"> - <add position="starting"> - <prop name="basis" value="enumerated"/> - <part name="caution"><p>Pending scheduled testing.</p></part> - </add> -</alter> - <control id="a1"> - <title>Basic precautions</title> - <prop name="basis" value="enumerated"/> - <prop name="status" value="ready"/> - <part name="caution"><p>Pending scheduled testing.</p></part> -</control> -

Position is starting but the new part is added after the - existing prop, because prop elements must always occur - first.

-
- -

An addition operating on a control with implicit binding and position - ending

- <control id="a1"> - <title>Basic precautions</title> - <prop name="status" value="ready"/> -</control> - <alter control-id="a1"> - <add position="ending"> - <prop name="basis" value="enumerated"/> - <part name="caution"><p>Pending scheduled testing.</p></part> - </add> -</alter> - <control id="a1"> - <title>Basic precautions</title> - <prop name="status" value="ready"/> - <prop name="basis" value="enumerated"/> - <part name="caution"><p>Pending scheduled testing.</p></part> -</control> -

The add/@position is ending so the new prop - appears after the existing prop.

-
-
-
- Explicit binding -

An explicit binding on an addition permits inserting new contents anywhere in a - control, not only at the top level. It is given by a @ref-id flag on the - add directive. The value of the @ref-id must correspond to the - value of an @id flag on an element inside the control, and not the control - itself. If ref-id does not correspond to such a value, the add - directive is inoperative. Optionally, a warning may be issued in such a case.

-

The element with @id equal to the @ref-id is considered the - target of the addition.

-

Additionally, with an explicit binding given by a @ref-id, - @position may have any of the values starting, - ending, before and after.

-

When position is starting or ending, the new - contents are added at the beginning or ending of the target element, inside that - element, as are additions into controls (using implicit bindings).

-

Additionally, a position given as before indicates the - addition should be made directly before the target element, while after - indicates the addition should appear directly after the target element.

-

Unlike additions with implicit bindings, an explicit binding does not - provide for sorting of newly added elements to ensure correct ordering. - Consequently, profile authors must take care that additions they make into control - contents using explicit bindings will produce results valid to the catalog - schema.

- -

An addition operating on a control with explicit binding and position - after

- <control id="a1"> - <title>Basic precautions</title> - <prop name="status" value="ready"/> - <part id="a1.b" name="recommendations"> - <part id="a1.b1"><p>Collect recycling for pickup.</p></part> - <part id="a1.b2"><p>Sweep surfaces free of dust.</p></part> - </part> -</control> -

Note that the add directive identifies the element with @id - a1.b1 as its target.

- <alter control-id="a1"> - <add position="after" ref-id="a1.b1"> - <prop name="basis" value="allocated"/> - <part name="caution"><p>Unavailable on weekends.</p></part> - </add> -</alter> - <control id="a1"> - <title>Basic precautions</title> - <prop name="status" value="ready"/> - <part id="a1.b" name="recommendations"> - <part id="a1.b1"><p>Collect recycling for pickup.</p></part> - <prop name="basis" value="allocated"/> - <part name="caution"><p>Unavailable on weekends.</p></part> - <part id="a1.b2"><p>Sweep surfaces free of dust.</p></part> - </part> -</control> -

The position is after so both elements inside - add are added after (not inside) the target element. Since the target - element is inside another part in the control, the new additions appear - there as well.

-

Note that the result in this case will be schema-invalid since a prop - may not occur directly following a part. A better result can be obtained - (a better target may be defined) by using two add directives, to insert - the new prop separately - before any part elements in the target.

-
-
-
- Usage of add directives modifying controls inside controls -

OSCAL supports control extensions inside controls in the form of control - elements inside control elements. Because the semantics of the - add directive target any (element) contents of controls, they can be used - to target these control extensions for modification as well as other contents.

-

Because such a control can already be modified using implicit bindings, it is - recommended that they not be targeted with explicit bindings. Using an implicit - binding supports more robust alteration since contents in the target can be ordered - properly by the resolution processor. XXX can we guarantee valid results here - and do we have to specify a sort/order? However, it is not an error to - target control elements in this way, manipulating them in the same way as other - targets may be manipulated.

-
+
+ + custom + +

The + customdirective provides the target catalog with a custom structure. A one-to-one mapping of the desired structure of the target catalog is defined alongside control matching instructions, resulting in a strictly controlled output catalog. +

+
+ Creating Custom Groups +

A + groupobject given under + customMUST result in a + groupwith the exact same content (excluding + insert-controls) in the target catalog. +

+

If the ID of the group matches the ID of a group that has been included during the import phase, all contents inside the group, including + title, + param, + propand + partobjects MUST be copied into the target, appearing in the same order as in the source. +

+

Note that groups defined in + custommay vary from fully featured to minimally instantiated. This includes arbitrary nesting of such groups inside of one another. No groups other than those explicitly declared should appear in the output catalog. +

-
- Removing contents from controls -

Contents inside controls can be removed from them in catalog targets. In combination - with adding new contents, this feature can be used to edit controls as well as amend - them.

-

A remove directive inside an alter directive identifies an - element or set of elements inside a control to be removed. It does this using any of - five flags. Flag are additive; that is, if more than flag is given, all must - match.:

+
+ Inserting Controls +

The + insert-controlsdirective may appear anywhere under + custom, whether as a direct child or inside any of the defined groups. Inside insert-controls, + include-controlsand + include-allfrom the Import Phase + are used with the same basic behavior to configure which controls are selected and inserted at the current location. +

+

In order to provide clarity, controls that match the various conditions of these inclusion directives inside the + customobject will be referred to as "selected" instead of "included". Only directly selected controls will appear in the target catalog. +

+

A + insert-controlswith an + include-controlschild results in the following behavior: +

  • -

    @id-ref, like add/@id-ref, matches an element by its - @id value.

    -

    Because @id values are unique, the remove directive will remove only a - single element. Ordinarily this would not combined with other identifiers for - removal.

    +

    + with-idresults in selecting and inserting, at that point inside the new grouping, the included controls with the + idgiven by + with-id. They should be given in the same order as they appear in the control selection(s). +

  • -

    @name-ref keys to the @name attribute on any element inside - the control.

    -

    Any element inside the control with the assigned name, is removed - (typically providing there is also a match on @ns).

    +

    A + matchingdirective results in selecting and inserting, at that point inside the new grouping, all included controls whose + idmatch, as a Glob expression, the pattern given in the + pattern. They are given in the same order as they appear in the input control selection(s). +

  • +
+

An + insert-controlswith an + include-allchild results in all included controls being selected and inserted. They are given in the same order as they appear in the input control selection(s). +

+

+ insert-controlscan also indicate the order that the selected controls are to be emitted in the result catalog using an + orderchild. Three values MUST be supported and handled as specified below: +

+
  • -

    @ns-ref keys to the @ns attribute on any element inside the - control.

    -

    Any element inside the control with the assigned name, is removed - (typically providing there is also a match on @name).

    +

    + ascendingwill sort all selected controls into ascending alphanumeric order by their ID. +

  • -

    @class-ref keys to the @class attribute on any element inside - the control. All elements with matching class are removed.

    +

    + descendingwill sort all selected controls into descending alphanumeric order by their ID. +

  • -

    @item-name keys to the element or property name; for example, - <remove item-name='prop'/> has the effect of removing all - prop elements from inside the control. (NB: explain how this - maps into JSON when items are grouped)

    +

    + keepindicates that controls should be inserted in the order of their appearance, using a depth-first traversal of the source profile's imports. +

-

Unlike an add directive, a remove may not be bound implicitly to - the control; its binding, to contents inside the control, must be explicit.

-

To remove an control, simply avoid selecting it into the profile, or exclude it - specifically using import/exclude-controls.

-

As with add, a remove that targets any element outside the control, is - inoperative. Similarly, a remove directive that indicates that all prop - elements should be removed from the target catalog, applies only to prop

-
-
- Implicit alterations -

Finally some alterations are made automatically.

-

For example, link elements in source data representing cross-references in a - catalog, may no longer be effective in catalogs produced from profiles, which have not - included the elements (controls or other) to which the links refer.

-

Either: expand the links to refer back to the source catalogs; or remove the - links.

-

Note: we could also expand links to point back to the (resolved) source, - particularly if it is described in back-matter as a resource...

+

In the case that a control selection matches none of the included controls, it MUST be ignored; a warning SHOULD be provided. If a control that was included by the Import Phase is never selected, no error occurs, that control simply does not appear in the output catalog.

-
- Operations irrespective of phase -

In addition to selecting, merging and modifying, certainl operations - are conducted in profile resolution that occur irrespective of phases, - that is in any profile resolution. These include rewriting the profile - metadata into the resolved baseline (catalog), and filtering and - rewriting back matter.

-
- Metadata in the resolved (baseline) catalog +
+ Wrapping up the Merge Phase +

After the merge phase, the intermediate should now closely resemble the content and structure of the final output catalog. Controls and groups have been included, remapped, de-duplicated, then placed into their final location within the output's structure. Note: there is still an opportunity for included controls or groups to become referenced; and therefore, not eligible for pruning + in the next phase. +

+

Regardless of any merge directives, there also likely remains "loose params" that have been propagated forward; these too must be persisted.

+
+
+
+ Modify Phase +

There are two ways profiles may further modify the results of profile resolution: setting parameters, and altering controls. These activities are defined as two child objects inside the third step of profile resolution, the Modify Phase.

+

The following section contains requirements for processing the + modifychild of a source profile. +

+
+ Setting Parameters +

Modification of parameter settings is indicated using the + set-parameterobject under + modify. For this section, a given + set-parameterobject will be referred to as the + source. +

+

Profile Resolution Tools MUST adhere to the following requirements for processing "set-parameter":

+
    +
  • +

    First, the list of included params (among "loose params" and remaining included controls and groups) is searched for a param who has a "id" equal to this object's "param-id". This is the "target". If no such parameter is found, a warning SHOULD be issued, but processing MUST continue.

    +
  • +
  • +

    When encountering the following objects in the source: class, depends-on, label, usage, values, select; overwrites the object of the same name in the target. If no such object exists in the target, it is created.

    +
  • +
  • +

    When encountering the following objects in the source: props, links, constraints, guidelines; adds the contents of the source object to the contents of the target object of the same name. If no such object exists in the target, it is created. For each individual child object of "props" and "links" in the source, if an individual child inside the target object has the same distinctive ID, it is instead overwritten by the source object + +

    +
  • +
  • +

    If more than one + set-parameterdirective is given for the same parameter, all are applied, in the sequence given in the profile. +

    +
  • +
+
+
+ Altering controls +

A control can be altered by an + alterobject inside "modify". The + control-idchild object under the + alterindicates the control to which the alteration is applied. +

+
+ Adding contents to controls +

Contents may be added to controls using an add directive inside an alter directive. There are two forms of alteration: with implicit and explicit bindings.

+
+ Implicit binding +

An + adddirective with no + by-idis taken to apply to the control as a whole. Its + positionmay be either of two values: + startingand + ending. +

+

The contents of the add directive are then added to the control contents in the target, either after its + titlewhen + positionis + starting, or at the end if its position is + ending, or not given. +

+

However, control contents in catalogs must appear in the order + title, param, prop, link, part, control. Subsequent to adding new objects, the control contents are sorted to appear in the required order. As a consequence, a new + propappears after any + propalready in the control, when + positionis + ending, or not given, or before any + propin the control when + positionis + starting. +

+

When add has no + ref-id(has an implicit binding), the + positionvalues + beforeand + afterare treated like + startingand + ending, respectively. + The schema permits these values. +

+ +

An addition operating on a control with implicit binding and position + starting +

+ + + + + + + + + +

Position is + startingbut the new + partis added after the existing + prop, because + propobjects must always occur first. +

+
+ +

An addition operating on a control with implicit binding and position + ending +

+ + + + + + + + + +

The + positionis + endingso the new + propappears after the existing + prop. +

+
+
+
+ Explicit binding +

An explicit binding on an addition permits inserting new contents anywhere in a control, not only at the top level. It is given by a + ref-idon the + adddirective. The value of the + ref-idmust correspond to the value of an + idon an object inside the control, and not the control itself. If + ref-iddoes not correspond to such a value, the + adddirective is inoperative. A warning MAY be issued in such a case. +

+

The object with + idequal to the + ref-idis considered the + targetof the addition. +

+

Additionally, with an explicit binding given by a + ref-id, + positionmay have any of the values + starting, + ending, + beforeand + after. +

+

When + positionis + startingor + ending, the new contents are added at the beginning or ending of the target object, inside that object, as are additions into controls (using implicit bindings). +

+

Additionally, a + positiongiven as + beforeindicates the addition should be made directly before the target object, while + afterindicates the addition should appear directly after the target object. +

+ +

An addition operating on a control with explicit binding and position + after +

+ + + +

Note that the + adddirective identifies the object with + id + a1.b1as its target. +

+ + + + + + +

The + positionis + afterso both objects inside + addare added after (not inside) the target object. Since the target object is inside another + partin the control, the new additions appear there as well. +

+

Note that the result in this case will be schema-invalid since a + propmay not occur directly following a + part. A better result can be obtained (a better target may be defined) by using two + adddirectives, to insert the new + propseparately before any + partobjects in the target. +

+
+
+
+ Usage of + adddirectives modifying controls inside controls + +

OSCAL supports control extensions inside controls in the form of + controlobjects inside + controlobjects. Because the semantics of the + adddirective target any (object) contents of controls, they can be used to target these control extensions for modification as well as other contents. +

+

Because such a control can already be modified using implicit bindings, it is recommended that they not be targeted with explicit bindings. Using an implicit binding supports more robust alteration since contents in the target can be ordered properly by the resolution processor. + XXX can we guarantee valid results here and do we have to specify a sort/order?However, it is not an error to target control objects in this way, manipulating them in the same way as other targets may be manipulated. +

+
-
- Back matter in the resolved (baseline) catalog -

back-matter in the result is produced by combining all - elements within back-matter in all source catalogs, with - the back-matter in the input profile. Since catalog - resolution is defined to operate recursively, when profiles import - profiles, the back matter to be merged is defined by the resolution of - the imported profile. These elements are combined in order and - filtered according to the following:

+
+ Removing contents from controls +

Contents inside controls can be removed from them in catalog targets. In combination with adding new contents, this feature can be used to edit controls as well as amend them.

+

A + removedirective inside an + alterdirective identifies an object or set of objects inside a control to be removed. It does this using any of five child objects. These are + additive; that is, if more than one is given, all must match: +

  • -

    resource elements copied from imported baseline into a - resolved catalog (result baseline) are preserved as is, with no - modification. New resources can be added in a profile by including - them in its back-matter, but resources cannot be - targeted for modification. Resources either propagated from source - catalogs, or included in the importing catalog, are treated the - same for these purposes.

    +

    + by-id, like + add:by-id, matches an object by its + idvalue. +

    +

    Because + idvalues are unique, the remove directive will remove only a single object. Ordinarily this would not combined with other identifiers for removal. +

  • -

    In the result catalog, resource data objects are given - in the order they occur in the imported baselines, with the - baselines given in imported order, and the importing profiles - .

    +

    + name-refkeys to the + namechild object on any object inside the control. +

    +

    Any object inside the control with the assigned + name, is removed (typically providing there is also a match on + ns). +

  • -

    Where node identity can be established between - resource elements, only the last of the - duplicate resources is included, within the given total order of - baselines and resources within those baselines, or if a - prop[@name='keep'] with value always - is given on any such resource, the last of these, as - noted below. That is, each imported catalog or baseline overrides - any imported before it, while a profile's own resources are - preferred (as coming last).

    +

    + ns-refkeys to the + nschild object on any object inside the control. +

    +

    Any object inside the control with the assigned + name, is removed (typically providing there is also a match on + name). +

  • -

    However, resources are discarded if they are not designated as - the target of any link (link or a - element) somewhere in the metadata or body of the resulting - resolved catalog, by means of an ID reference taking the form of - the reference's id value prepended with #, - with the following exception:

    -
      -
    • -

      Any resource given in either an imported catalog - (baseline), or in the back-matter of the source - profile, is kept (appears in the result) if it is marked in - source with a prop element whose @name - is given as keep and whose value is - always.

      -

      Within a group of resource objects considered to - be identical, this property (prop element) given on - any member has the effect of excluding from the group, any - that do not. In other words, only the resources marked as - always keep with that identity, are selected from, - and the last of these (only) is propagated.

      -
    • -
    +

    + class-refkeys to the + classchild object on any object inside the control. All objects with matching + classare removed. +

  • -

    Marking a resource with a prop with name='keep' and value - always thus has a couple of uses:

    -
      -
    • -

      Placing such a property on a resource in a catalog, has the - effect of ensuring it will always appear in the baseline - produced by any profile importing that catalog, even if - nothing links to the resource. This version of the resource - will also be the one copied, unless a later-imported catalog - or importing profile offers its own version marked to - always keep.

      -
    • -
    • -

      Placing such a property on a resource in a profile, ensures - both that the resource appears (even if not cross-referenced) - in the resulting baseline catalog, and that its version is - used, unless when imported into another profile, in which case - it may be overridden by another one (also marked as always - keep).

      -
    • -
    -

    Check to be sure 'keep' is permitted and reserved by the schema - here

    +

    + item-namekeys to the object or property name; for example, + remove: item-name: prophas the effect of removing all + propobjects from inside the control. +

- <resource id="fedramp-1"> - <title>FedRAMP Applicable Laws and Regulations</title> - <prop name="keep" value="always"/> - <prop name="conformity" ns="https://agency.gov/ns/oscal-extensions" value="agency.citations"/> - <rlink href="https://stable.agency.gov/uri"/> -/resource> +

Unlike an + adddirective, a + removemay not be bound implicitly to the control; its binding, to contents inside the control, must be explicit. +

+

To remove an control, simply avoid selecting it into the profile, or exclude it specifically using + import/exclude-controls. +

+

As with + add, a remove that targets any object outside the control, is inoperative. Similarly, a remove directive that indicates that all + propobjects should be removed from the target catalog, applies only to + prop +

-
- Null profile -

A null profile is a profile that imports a catalog and selects all its controls - without modification. A truly null profile – that is, with only an import and nothing - else – does not return its imported catalog unchanged. But the changes it makes can be useful. - This makes a null profile or its near-null variants, as described in this - section, potentially useful for catalog management, design and use, as described in this - section.

-
- Importing and nothing else - <profile> - <metadata>...</metadata> - <import href="catalog.xml"> - <include-all/> - </import> -</profile> -

In the target, the catalog group structure and all hierarchy is removed; its controls are - all returned in sequence. Any loose parameters in the catalog not referenced in a control, - are dropped.

+
+ Final Operations +
+ Backmatter Resolution +

+ back-matterin the result is produced by combining all objects within + back-matterin all source catalogs, with the + back-matterin the input profile. The merge method and merge structuring directives are ignored. The following requirements MUST be adhered to by the processor: +

+
    +
  • +

    Each import's backmatter is processed in order it was provided in the source profile, then the source profile's backmatter is processed.

    +
  • +
  • +

    Each + resourceis added to the target in the order given inside the import. +

    +
  • +
  • +

    If a + resourcehas the same + uuidas a resource that has already been added, the previous resource is removed, and the more recent one added. +

    +
  • +
  • +

    A resource with a child prop of name:keep and value:always can only be replaced following the above rule by a duplicate that also has the keep always prop.

    +
  • +
+

Tools MAY check for pruning conditions + as resources are added as long as the final result is the same as if the pruning had taken place at the end of all resource addition. +

+

Placing the keep always prop on a resource in a catalog has the effect of ensuring it will always appear in the output produced by any profile importing that catalog, even if nothing links to the resource. This version of the resource will also be the one copied, unless a later-imported catalog or importing profile offers its own version marked to keep always.

-
- include-all[@with-child-controls='no'] -

The same, except that only top-level controls are included, not descendants.

-

unit test this

+
+ Metadata Resolution +

The following requirements MUST be followed with regards to the Metadata section of the output catalog:

+
    +
  • +

    The output catalog MUST have a unique top-level UUID (metadata:uuid). This UUID may be generated as seen fit by the tool, as long as it is reasonable to assume it is globally unique. It is RECOMMENDED that tools use a combination of meaningful text and a uniquely generated value (Ex. + {{sourceprofilename}}-RESOLVED-{{GUIDv5}}). +

    +
  • +
  • +

    The value of metadata:version in the target MUST be set with a string that identifies the version of this document. This SHOULD be used to track updates to this specific output document.

    +
  • +
  • +

    The value of metadata:oscal-version in the target MUST be set with a string that identifies the version of OSCAL used by this tool to resolve the profile (ex. 1.0.0). This value MUST be determined by compiling the oscal-versions from each imported document and the source profile, and taking the most recent minor version. If this version is more recent than what the resolution tool is using, then the value of the output oscal-version MUST be the version that the tool used internally. If any of the above OSCAL versions (imported document versions, source profile version, tool version) are of a different major version (the first digit differs), the tool SHOULD provide an error and cease processing.

    +
  • +
  • +

    The value of metadata:last-modified in the target MUST be set with a valid timestamp representing the time the profile resolution completed.

    +
  • +
  • +

    The value of metadata:source-profile in the target SHOULD be set with a valid URI that points to the profile that resulted in this catalog. If there are privacy or security concerns, the value MAY be set to anything, in which case the simple existence of the source-profile property indicates that this is a resolved profile.

    +
  • +
  • +

    The value of metadata:resolution-tool in the target SHOULD be set with a string that represents the tool that was used to resolve this catalog.

    +
  • +
  • For any metadata:roles or metadata:parties that exist in the source catalogs, if they have a prop child with name:keep and value:always, they are to be copied as is into the output metadata.
  • +
+

Beyond these requirements, tools are free to use any and all of the objects inside metadata to provide additional information downstream.

+

Because of options in producing metadata and especially the requirement for a timestamp, developers and users should note that two different resolutions of the same profile will not, ordinarily, be identical inside + metadata. +

-
- including merge directives -

Using merge as-is='true', the grouping hierarchy of a source catalog can be - reflected in the target.

-

This enables a near-null profile to define a normalization or cleanup pass on a catalog, as - it will have the result of removing dangling references and orphan parameters, without - otherwise affecting controls.

-

unit test this too, especially with more than two levels of control hierarchy as - well as groups

-

unit test this

+
+ Pruning and Ordering +

The processor SHOULD prune the result catalog to remove unused values. A given object is considered unused if it meets ALL of the following criteria:

+
    +
  • +

    The object does not have a child prop with name:keep and value:always

    +
  • +
  • +

    The object is not explicitly included + . +

    +
  • +
  • +

    There are no references to the object anywhere in the final result catalog, except in other objects that also meet all other pruning criteria. A reference to a given object exists if "#{distinctiveID}" appears anywhere, where {distinctiveID} is the distinctive ID of the object + . +

    +
  • +
+

Implementers should note that pruning need not take place after all other steps. As long as all above criteria are respected, pruning can happen at any time, and doing so is a likely performance and memory overhead improvement.

+

Tools MUST reorder the output catalog into canonical order + , except where this specification provides different ordering requirements. +

-
- Options -

For conformance, an OSCAL processor must deliver results of profile processing, in a basic - configuration, exactly as described in these specifications with no elaboration.

-

Conformance does not preclude providing additional features, however, including elaborated - outputs, in an optional mode. Such features could include offering warning or process - exception handling (appropriate to workflow) not described here; outputs provided with - comments or extra structure to support tracing or analytics; or (alternative) gateway - and draconian modes that would provide user assistance or refuse to deliver results for - inputs considered erroneous in a workflow.

-
-
- Profile tools and utilities -
    -
  • -

    rendering - showing both unresolved (raw) and resolved profiles

    -
  • -
  • -

    editing / integrity checking

    -
  • -
  • -

    rewriting/normalization

    -
  • -
  • -

    diffing

    -
  • -
  • -

    deriving a profile as the delta of two catalogs (base and tailored)

    -
  • -
+
+ Items of Note +
+ Distinct ID of Objects +

Whenever this specification refers to + distinctiveness, it MUST be interpreted as is defined in this section with regards to the object in question. +

+

control,param,group - distinctiveness is defined by the value of the + idchild object. +

+

resource - distinctiveness is defined by the value of the + uuid + . +

+
+
+ Dealing with Multiple Formats +

Profile Resolution tools SHOULD be able to handle source profiles, imported catalogs, and imported profiles that are serialized in XML, JSON, or YAML. A different serialization format of any given input MUST NOT result in a differing output catalog.

+

In order to help bootstrap this format management, the following resources are provided for implementers:

+
    +
  • +

    . + +

    +
  • +
+

The following sections provide additional requirements and guidance for each format.

+
+ Requirements and Guidance for XML Output +

See + the complete XML referencefor model requirements. +

+
+
+ Requirements and Guidance for JSON Output +

See the + complete JSON referencefor model requirements. +

+

The JSON format, in general use, does not require the preservation of order of fields. As order matters in OSCAL, care should be taken to adhere to the canonical OSCAL order + when outputting a catalog in JSON. +

+
+
+ Requirements and Guidance for YAML Output +

YAML is considered a simple variation on the JSON format. Beyond cosmetic differences there are no differences in the information structure between these formats. Therefore, the + complete JSON referenceprovides model requirements. +

+

The YAML format, in general use, does not require the preservation of order of fields. As order matters in OSCAL, care should be taken to adhere to the canonical OSCAL order + when outputting a catalog in YAML. +

+
+
+ Order of objects in serialization +

In OSCAL, order of top level objects (those that are direct children of the root element) is considered important only when the XML format is used. To facilitate this, OSCAL provides the concept of + canonical order. This order is provided by the OSCAL Metaschema files for a given document type (see + an overview of Metaschema. +

+

When the output format is XML, tools MUST use the OSCAL canonical order as described above. When using the YAML or JSON formats, order conveys no meaning, and is not considered important.

+
+
+ Comments in result documents +

In an XML-based profile resolution, XML comments are one straightforward way for a processor to record events or conditions without affecting the output's nominal semantics. To support this, while two processors are obliged to return the same catalog XML for the same profile XML inputs, they are not required to match one another's comments, white space usage, attribute order, or processing instructions, only each other's objects, attributes and data content.

+

One consequence of this is that processes intended to compare two profile resolutions may have to accommodate differences in comments, considering them as insignificant along with other differences in serialization.

+
+
- + + \ No newline at end of file diff --git a/src/specifications/profile-resolution/specml-html-preview.xsl b/src/specifications/profile-resolution/specml-html-preview.xsl index c79191b6e3..c98065bec8 100644 --- a/src/specifications/profile-resolution/specml-html-preview.xsl +++ b/src/specifications/profile-resolution/specml-html-preview.xsl @@ -20,6 +20,7 @@ { child::head } Specification + @@ -59,6 +60,7 @@ h1, h2, h3, h4, h5, h6 {{ font-family: { $display-font } }} code.src {{ font-size:90%; font-weight:bold; background-color: lightsteelblue; padding: 0.2em }} code.tgt {{ font-size:90%; font-weight:bold; background-color: lemonchiffon; padding: 0.2em }} +code.int {{ font-size:90%; font-weight:bold; background-color: pink; padding: 0.2em }} b.term, b.xpath {{ font-family: { $display-font } }} .secnum {{ padding: 0.2em; color: midnightblue; font-weight: bold; font-size: 110% }} @@ -74,6 +76,7 @@ a.linked {{ color: inherit }} .example.source_profile-tagging {{ background-color: lightsteelblue }} .example.source_catalog-tagging {{ background-color: powderblue }} .example.target_catalog-tagging {{ background-color: lemonchiffon }} +.example.inter_catalog-tagging {{ background-color: lemonchiffon }} .revisit {{ font-style: italic; color: red; background-color: yellow }} @@ -147,6 +150,11 @@ a.linked {{ color: inherit }}

Source (profile):

+ + + +

Intermediate (catalog):

+
diff --git a/src/specifications/profile-resolution/specml.css b/src/specifications/profile-resolution/specml.css index 6b9b329828..f26d0b868d 100644 --- a/src/specifications/profile-resolution/specml.css +++ b/src/specifications/profile-resolution/specml.css @@ -56,18 +56,20 @@ tagging { font-family: monospace; white-space: pre-wrap; padding: 0.5em; margin: tagging[whose=source_catalog] { background-color: #FFF0F0 } tagging[whose=source_profile] { background-color: #F0FFF0 } tagging[whose=target_catalog] { background-color: #F0F0FF } +tagging[whose=inter_catalog] { background-color: #F0F0FF } hi { display: inline; font-style: italic; font-weight: bold; color: grey } tagging[whose=source_catalog] hi { background-color: #FFCCCC } tagging[whose=source_profile] hi { background-color: #CCFFCC } tagging[whose=target_catalog] hi { background-color: #CCCCFF } +tagging[whose=inter_catalog] { background-color: #CCCCFF } tagging:after { content: oxy_combobox( edit, "@whose", editable, false, - values, "source_catalog, source_profile, target_catalog"); + values, "source_catalog, source_profile, target_catalog, inter_catalog"); } mapping:before { @@ -100,6 +102,8 @@ xref:before { font-weight: bold; font-size: 80%; content: " [See section \201C" tgt { display: inline; color: midnightblue; font-weight: bold; font-size: 90%; font-family: sans-serif } +int { display: inline; color: pink; font-weight: bold; font-size: 90%; font-family: sans-serif } + src { display: inline; color: darkgreen; font-weight: bold; font-size: 90%; font-family: sans-serif } xpath { display: inline; font-family: sans-serif; font-size: 90%; font-weight: bold } diff --git a/src/specifications/profile-resolution/specml.rnc b/src/specifications/profile-resolution/specml.rnc index 5dde76c24d..a73eb60f5f 100644 --- a/src/specifications/profile-resolution/specml.rnc +++ b/src/specifications/profile-resolution/specml.rnc @@ -30,7 +30,7 @@ mapping.elem = element mapping { section.elem = element section { attribute id { xsd:ID }?, head.elem, misc, section.elem* } -inline-mixed = (text | a | code | term | revisit | propose | em | strong | q | src | tgt | xpath | xref )* +inline-mixed = (text | a | code | term | revisit | propose | em | strong | q | src | tgt | xpath | xref | int )* a = element a { attribute href { text }, text } code = element code { text } @@ -44,6 +44,6 @@ src = element src { text } tgt = element tgt { text } xpath = element xpath { text } xref = element xref { attribute rid { dtd:IDREF }, empty } - +int = element int { text } # hi combines em and strong inside tagging hi = element hi { text } diff --git a/src/utils/util/readme.md b/src/utils/util/readme.md index 7f24e3f061..bb741d6612 100644 --- a/src/utils/util/readme.md +++ b/src/utils/util/readme.md @@ -1,10 +1,10 @@ # OSCAL Utilities -Current best tooling for OSCAL can be found listed on our web site: +The OSCAL project maintains [a list of tools for OSCAL on our web site](https://pages.nist.gov/OSCAL/tools/ "OSCAL tools page"). -See in particular the repository at https://github.com/usnistgov/oscal-tools +Additionally, we maintain a repository of tools at https://github.com/usnistgov/oscal-tools; and members of the community offer OSCAL tools, frequently in open repositories free to use, which we do not maintain. -Functionality maintained here includes: +Functionality archived here includes: `resolver-pipeline` a demonstration implementation of OSCAL Profile resolution.