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

Bulk update a component's statements across all systems #1797

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gregelin
Copy link
Contributor

@gregelin gregelin commented Feb 5, 2023

Stories

As an administrative user, I want to be able to update an existing component's description and implementation statements via the API so that I can maintain a component definition outside of GovReady-Q and automatically update component definition in GovReady-Q.

As an administrative user, I want to be able to propagate a change in a component's implementation statements to all all systems using that component, so that if I update a component definition I can have all systems consuming that component have their statements updated, too.

Update various Python and NPM libraries.

Discussion

Three changes were made to support updating components:

  1. Added an update boolean parameter to the elements/createOSCAL API v2 endpoint to indicate an existing component should be updated;
  2. Added an Element.synch_consuming_systems_implementation_statements method to force synchronize implementation statements of consuming systems; and
  3. Added an elements/synchConsumingSystemsImplementationStatements API v2 endpoint to trigger component to system synchronization via the API.

Updating a component via the v2 API involves a two step process.

First, call the element/createOSCAL endpoint with the new OSCAL component definition and the update parameter set to true. This will make the API update an existing component that matches by title (e.g., name) of the component if one exists. Setting update to true will update the component that matches by name instead of creating a new component. Updating the component means that the component in the library will have its statements updated, new statements added, and removed statements deleted. The elements/createOSCAL endpoint only effects the component library, and not any of the control implementation statements associated with the component on individual systems. The updated OSCAL adds, removes, and updates statements.

Second, call the elements/synchConsumingSystemsImplementationStatements endpoint using the component's ID in the database to synchronize the statements in the consuming systems. This API endpoint can be used at anytime to force synchronize The Element.synch_consuming_systems_implementation_statements method is called by the API. This enables the synchronization to be done.

The released implementation force updates the component definition of all consuming systems.

Note that the update and synchronization method are compatible with maintaining a change history of each statement. However, a deleted statement and its history will simply disappear. There history of a statement being deleted.

Using

Use the Swagger API to test:

/api/v2/docs/swagger/ > elements/createOSCAL

/api/v2/docs/swagger/ > elements/synchConsumingSystemsImplementationStatements

Future improvements

  • Check if user has permission to update an existing component
  • Enable a flag on individual systems to not accept updates from component
  • Match on component UUID or component title and not just component database ID
  • Update status (e.g., implemented, not implemented, etc.) of each statement
  • Update pid of control implementation statement
  • Check if multiple statements associated with same system and same control id are correctly handled
  • Provide more granular report of changes (e.g., statements changed, statements added, statements removed, etc.)
  • Update statement changelog with each change
  • Create a UI to trigger Element.synch_consuming_systems_implementation_statements

Extend controls.models.Element.synch_consuming_systems_implementation_statements
to add new statements to each consuming system and to find and remove
and consuming system's orphaned statements caused by deleted statement
in Element.
Base automatically changed from develop to main March 15, 2023 02:33
wbnod pushed a commit to wbnod/govready-q that referenced this pull request Jun 19, 2023
gregelin added a commit that referenced this pull request Jun 25, 2023
* 0.11.1 okta

* Update siteapp/authentication/OIDCAuthentication.py

* Dynamically set Internet schme (http or https) for swagger interface

* Bulk update a component's statements across all systems
#1797

* Added support for multiple overlays and compliance catalogs
Load default SSP AppSource and Webhooks

* Add SAST and secrets detection to linting

* Sync requirements.in with latest version

* 1-Add CMMCv2 catalog/baselines

* 1-Update python libraries for urllib3

* 2-Add --extra-index-url to requirements.txt

* 3-Change python index to pypi.org/simple

* 4-Bump pyopenssl==23.2.0

* 5-downgrade to Django 18

* 6-Controls/models.py auto_prefetch.Model.Meta

* 7-Bump Django version to 3.2.19

* 8-Point index-url to pypi

* 1-Add CMMCv2 catalog/baselines

* 2-Updated python libraries

* 3-GovReady updae python requirements

* Delete q-files/vendors/laurasia directory

---------

Co-authored-by: Schaad, Mark A <[email protected]>
Co-authored-by: Muhlenkamp, Brian F <[email protected]>
Co-authored-by: Drake, Xavier <[email protected]>
Co-authored-by: Greg Elin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant