Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Common OSCAL information exchange API #324

Open
anweiss opened this issue Mar 5, 2019 · 14 comments
Open

Common OSCAL information exchange API #324

anweiss opened this issue Mar 5, 2019 · 14 comments
Labels
Aged A label for issues older than 2023-01-01 closable help wanted Research Scope: Tooling and APIs Issues targeted at development of tooling and APIs to support OSCAL content creation and use. User Story

Comments

@anweiss
Copy link
Contributor

anweiss commented Mar 5, 2019

User Story:

As an OSCAL producer and consumer, I can send/receive OSCAL formatted information over a standard API that can be implemented by systems, system components, and/or tools. This API would also allow for discoverability of OSCAL data.

Goals:

The lack of any sort of standardized API for communicating OSCAL information between systems and humans makes it difficult to aggregate and review security control information for a given system or systems. It also becomes difficult to properly assess the risk of a system if crucial information is available, but not easily discoverable.

Existing best practices and protocols should be leveraged. Any approaches built on REST principles should be taken into consideration. Anything based on pure REST API constructs, to something more domain-specific like ROLIE, would be acceptable.

Dependencies:

None.

Acceptance Criteria

A common API for discovering and exchanging OSCAL information is developed, including its routes and resources. The implementation of the API is not in scope of this issue and would be left up to system owners and tool vendors.

@redhatrises
Copy link
Contributor

@anweiss curious if you have further thoughts on this because the OSCAL format in JSON could be used for the API itself. For example:

GET /catalog
GET /catalog/title
GET /catalog/references
etc...

@anweiss
Copy link
Contributor Author

anweiss commented Mar 7, 2019

@redhatrises spot on! that's exactly what I've had in mind. The API could very much reuse the existing OSCAL components and elements as part of the construction of the API routes and resources themselves.

@anweiss
Copy link
Contributor Author

anweiss commented Mar 22, 2019

I've been prototyping this out using REST and OpenAPI v3. To @redhatrises's point, this is merely a natural path-based walk of the schema, and as such, one can easily automatically generate the OpenAPI definitions from the metaschemas without any data loss. In fact, the OpenAPI spec is just an extension, of sorts, to JSON schema.

On a similar note, while the original issue description mentions that we could potentially take a feed-based approach (e.g. Atom, ROLIE, etc), even on top of REST, IMO we should avoid it given that XML is the only formal representation of these feed-based standards. We ideally want flexibility in terms of the inputs/outputs provided by such an API (XML and JSON), something that which the OpenAPI spec and traditional APIs provide.

Obviously, would like to hear feedback from others.

@anweiss
Copy link
Contributor Author

anweiss commented Mar 25, 2019

@wendellpiez per ^, take a look at https://swagger.io/docs/specification/data-models/keywords/ ... note that we can re-use a lot of the existing JSON schema production from the metaschema if we define this common API using OpenAPI.

@anweiss
Copy link
Contributor Author

anweiss commented Mar 26, 2019

I've been prototyping this out with OpenAPI v3. Posted Gist at https://gist.github.com/anweiss/c9221445d4d519b63df9323f097fac28. While I've included the models from the existing JSON schema directly into the OpenAPI definitions for brevity, one could also simply include direct $refs to the OSCAL JSON schemas themselves.

Below is a screenshot of what the endpoints might look like for an API that exposes catalog data:

Screen Shot 2019-03-26 at 4 32 53 PM

Ideally, we should define a set of standardized routes that provide meaningful but not overpowering output to clients. For example, routes that return single values e.g. /catalog/title may not add much value vs /catalog/myCatalogId?condensed=true which would provide the option to return a condensed variant of the catalog that which includes title amongst other properties.

Something to note is that while the schemas support nested recursion, the API paths themselves should be limited to one or two path parameters since it's quite cumbersome and unwieldy to have an API that supports path recursion; and frankly not usable.

@anweiss
Copy link
Contributor Author

anweiss commented Mar 28, 2019

@bsilberberg would love your take on this as well

@david-waltermire david-waltermire added User Story help wanted Scope: Tooling and APIs Issues targeted at development of tooling and APIs to support OSCAL content creation and use. labels May 8, 2019
@anweiss
Copy link
Contributor Author

anweiss commented Sep 18, 2019

Another interesting project that recently hit 1.0 and that could be explored for this issue is https://ballerina.io. New language designed to make the development of distributed services much easier. Per https://blog.ballerina.io/posts/annoucing-1.0.0/, it looks like the lead designer of the language is James Clark, one of the original folks behind XML, XPath, XSLT and RelaxNG. So naturally, Ballerina has strong support for XML and XSLT in its standard lib.

@iMichaela
Copy link
Contributor

Do we need only an API (an interface to a logical repository of OSCAL objects) or would the community benefit more from an application protocol for exchanging OSCAL-formated information over HTTPS, especially in support of contiuous monitoring and information aggregtion and automation of assessment results?

@trevor-vaughan
Copy link

trevor-vaughan commented Sep 24, 2019

My 'microservices' thought is an API but my 'big enterprise' thought is to target an agnostic data transport (HTTPS doesn't always work well over WANs).

Given the scope, and size, of the data sets, I would probably opt for an API that can be transport agnostic to support large environments with high latency and limited bandwidth. Particularly being able to chunk and validate data would be important.

I guess, put another way: solve the edge problem and the cloud problem is easy. Solve the cloud problem and you've left a lot of your systems out in the cold.

@anweiss
Copy link
Contributor Author

anweiss commented Oct 7, 2019

@trevor-vaughan @iMichaela great points. I'm also in the "transport-agnostic" camp, due to reasons outlined by @trevor-vaughan. With a common API, it really doesn't matter what transport is used. For constrained network scenarios, any number of binary serialization mechanisms could be used. As an aside, support for CDDL via https://github.com/usnistgov/OSCAL/issues/460 would open the door to validating CBOR-encoded OSCAL for these edge scenarios; especially since CBOR is merely a superset of JSON, a format we already support.

@anweiss
Copy link
Contributor Author

anweiss commented Nov 21, 2019

Coming from the container/cloud-native world, here's another possible approach -> https://www.opencontainers.org/blog/2019/09/10/new-oci-artifacts-project. The new OCI Artifacts project is designed to allow one to exchange/store deployment artifacts (e.g. Kubernetes manifests, Helm Charts, etc) alongside your container images via the OCI distribution specification. Could be interesting to extend it to support OSCAL.

@david-waltermire david-waltermire added this to the Tools and Utilities milestone Mar 27, 2020
@guyzyl
Copy link
Contributor

guyzyl commented Jan 2, 2022

@anweiss if we're discussing the cloud-native approach, how about something similar to CloudEvents.
I personally don't think there's a need to standardize the API itself, only the schema of how the data is transferred over API.
Since OSCAL already defines the content itself, all that is needed is to add the "API metadata" layer that will go along with it.

@aj-stein-nist
Copy link
Contributor

Need to review this in a backlog refinement meeting as there is a community effort and implementation, so it seems advisable to either:

  1. Close this and point to the community effort
  2. Keep it with the team and set state to needs refinement as this is a significant amount of work and defined well enough for the NIST OSCAL Team to delineate which work we should engage in here
  3. Related to 2 and more specific, if NIST has work to do in this regard separate of the community effort and approach 1, perhaps we do not refine it but consider it a DEFINE research topic theme and organize the work after deep research

@Arminta-Jenkins-NIST Arminta-Jenkins-NIST added the Aged A label for issues older than 2023-01-01 label Nov 2, 2023
@Arminta-Jenkins-NIST
Copy link
Contributor

At the 11/16 Triage Meeting: NIST team agrees this issue is out of scope and cannot be handled internally at the present time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aged A label for issues older than 2023-01-01 closable help wanted Research Scope: Tooling and APIs Issues targeted at development of tooling and APIs to support OSCAL content creation and use. User Story
Projects
Status: Needs Triage
Development

No branches or pull requests

8 participants