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

Feature/0.9.10 #1689

Merged
merged 393 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
393 commits
Select commit Hold shift + click to select a range
f96e615
fixed control and sectioning for components in system
davidpofo May 20, 2021
7a1f6e4
check for security impact level statement when updating. Readding ret…
davidpofo May 20, 2021
b43271e
adding component_state and component_type to system component and com…
davidpofo May 20, 2021
e074200
pulling in some of the information from statement about system. Rest …
davidpofo May 20, 2021
7871065
a todo for fisma impact level renaming
davidpofo May 20, 2021
0dbab76
added project_security_objs_edit to edit security objectives separate…
davidpofo May 20, 2021
f6e7b75
update changelog and some wording in the modal
davidpofo May 20, 2021
10bda73
Merge pull request #1598 from GovReady/ge/cmd-cmpts-export
davidpofo May 20, 2021
16483d7
Move action-button styles from inline to style section
May 20, 2021
013f185
Sync with branch develop
May 20, 2021
5642ae5
two views/urls for editing component state and type
davidpofo May 20, 2021
2f53abb
Merge pull request #1574 from GovReady/ge/action-btn-text-left-align
davidpofo May 20, 2021
5bc94fa
Merge branch 'develop' of github.com:mguelfi/govready-q into develop
May 21, 2021
818ff41
adding component type and state to ElementForm
davidpofo May 21, 2021
b84f6d9
adding just the display of the state and type to component library co…
davidpofo May 21, 2021
640e144
changelog
davidpofo May 21, 2021
6fb52e8
FISMA IMPACT LEVEL is now SECURITY SENSITIVITY LEVEL
davidpofo May 21, 2021
a16d6bc
Merge branch 'develop' into da/oscal_hardcoded
davidpofo May 21, 2021
2175521
Merge pull request #1597 from GovReady/da/oscal_hardcoded
davidpofo May 21, 2021
a80b555
Merge branch 'develop' into fisma_sensitivity
davidpofo May 21, 2021
b94b052
Work inprogress
alexanderward May 21, 2021
5d6ef37
Work inprogress
alexanderward May 21, 2021
11b2ee2
Merge branch 'GovReady:develop' into develop
mguelfi May 25, 2021
1dde019
Da/quick insert (#1601)
davidpofo May 26, 2021
226bc17
Fix system ctl detail page err; Improve creating smt from prototypes …
gregelin May 26, 2021
1957599
Automatically clear, refresh output document content downloading docs
govreadydeploy May 27, 2021
5f63cad
remove comments. changelog
davidpofo May 27, 2021
47598a0
Merge pull request #1579 from GovReady/ge/appinput-type
davidpofo May 27, 2021
595c8c6
Merge pull request #1603 from GovReady/ge/remove-doc-refresh-btn
davidpofo May 27, 2021
8350627
Fixed an issue where statement didn't exist while exporting to oscal …
gregelin May 28, 2021
2efd44a
Align Delete section on project settings (#1604)
gregelin May 28, 2021
9ca5d38
Update CHANGELOG
govreadydeploy May 29, 2021
8ac6b0d
Merge branch 'develop' of github.com:GovReady/govready-q into develop
govreadydeploy May 29, 2021
0105581
Ge/file upload extensions (#1607)
gregelin May 29, 2021
f97763b
Merge branch 'main' patches into 'develop'
govreadydeploy May 29, 2021
f613b38
Batch update cntl impl smts when component_statement changes
govreadydeploy May 30, 2021
19fe119
Merge pull request #1608 from GovReady/ge/cmpt-ctl-info
alexanderward May 30, 2021
7215001
More okta changes
alexanderward Jun 1, 2021
b63c13c
export a projects ssp control implementations with export form (#1611)
davidpofo Jun 3, 2021
b1c6bdd
Add 'Create a template' button to template library (#1610)
gregelin Jun 3, 2021
2fa3598
Content-Security-Policy header permit images (*), videos youtube, vimeo
Jun 3, 2021
26438f1
Merge pull request #1613 from GovReady/ge/permit-video-embed
davidpofo Jun 3, 2021
89ece2d
quick fix for auth
alexanderward Jun 7, 2021
36f337a
quick fix for auth
alexanderward Jun 7, 2021
ac2f4fe
quick fix for auth
alexanderward Jun 7, 2021
50da174
quick fix for auth
alexanderward Jun 7, 2021
ae74bff
quick fix for auth
alexanderward Jun 7, 2021
dd4e44f
Force controls csv to download to browser
Jun 7, 2021
d537f8c
Merge pull request #1616 from GovReady/ge/fix-csv-export
davidpofo Jun 7, 2021
a5f444d
quick fix for auth
alexanderward Jun 7, 2021
48e1133
quick fix for auth
alexanderward Jun 7, 2021
39ed3f4
test
alexanderward Jun 8, 2021
dabf575
test
alexanderward Jun 8, 2021
cc24245
test
alexanderward Jun 8, 2021
716b514
test
alexanderward Jun 8, 2021
3e5deec
test
alexanderward Jun 8, 2021
31c676d
last fix and vuln update for django
alexanderward Jun 8, 2021
9bf8be7
last fix and vuln update for django
alexanderward Jun 8, 2021
0458a41
'Back' link to question to take user to previous question (#1612)
gregelin Jun 9, 2021
2a65a01
WIP: Side-by-side comparison of components (#1620)
davidpofo Jun 10, 2021
f9205c1
Update CHANGELOG.md
gregelin Jun 10, 2021
73d8eae
merged
alexanderward Jun 10, 2021
42e832b
Sync with origin 'develop'
Jun 11, 2021
2ffe8ec
Rename 'compare' column to 'select' in component library (#1626)
gregelin Jun 11, 2021
32dfa4f
Remove portfolio selection modal from Start a Project process
govreadydeploy Jun 13, 2021
237d746
Update tests for default portfolio
govreadydeploy Jun 13, 2021
8819196
Bump VERSION, CHANGELOG
govreadydeploy Jun 13, 2021
6554d21
Update CHANGELOG VERSION
govreadydeploy Jun 13, 2021
d8e1035
Merge branch 'develop' into ge/default-portfolio
gregelin Jun 13, 2021
22bbf13
Merge branch 'develop' of github.com:GovReady/govready-q into develop
Jun 14, 2021
ca7ddec
Add button, form to add AppSource via upload of zip file
Jun 14, 2021
1c737c2
Merge pull request #1625 from GovReady/okta
davidpofo Jun 14, 2021
40752ac
Merge branch 'develop' of github.com:GovReady/govready-q into develop
Jun 16, 2021
87ff32f
Link to library version of component from a system's selected control…
Jun 16, 2021
6951348
Merge pull request #1629 from GovReady/ge/component-link
davidpofo Jun 16, 2021
4d196f0
Merge branch 'develop' into ge/easier-add-appsource
davidpofo Jun 16, 2021
d52dd05
Merge pull request #1628 from GovReady/ge/easier-add-appsource
davidpofo Jun 16, 2021
321ef4a
Display systems using a component (#1618)
gregelin Jun 16, 2021
e4e9d61
Ge/fulltext search (#1631)
gregelin Jun 16, 2021
0e46a22
check if we are in a portfolio when starting a project. If so then us…
davidpofo Jun 17, 2021
30db6f0
Merge pull request #1627 from GovReady/ge/default-portfolio
davidpofo Jun 17, 2021
9115014
fixed a bug where Elements of type system were shown in the selected …
davidpofo Jun 17, 2021
dbe84e6
Addressing github issue 1630 in group id matching. fixed a bug where …
davidpofo Jun 17, 2021
65c2d67
Merge pull request #1632 from GovReady/da/bug_fix_controls
davidpofo Jun 17, 2021
c063dcb
Add YAML intermediary file for CMMC
govreadydeploy Jun 18, 2021
608fba2
try/except to still do the component search for non-Postgres users. (…
davidpofo Jun 18, 2021
d14df6e
Add a 'blank' project with no questions useful for batch project crea…
gregelin Jun 19, 2021
e7e8b9c
td not th
davidpofo Jun 19, 2021
45084ca
Polish security objective ui
Jun 19, 2021
bdb0ca1
Avoid errors when project has no root_task set
govreadydeploy Jun 20, 2021
b339957
Better project name when no root task set
govreadydeploy Jun 20, 2021
ff7adec
Align project name when listing project with no root task
govreadydeploy Jun 20, 2021
e384c74
Support CMMC ver 1 OSCAL catalog
govreadydeploy Jun 21, 2021
de8e8d8
Fix typo
govreadydeploy Jun 21, 2021
10bca50
Add 'blank' compliance app to first_run
govreadydeploy Jun 22, 2021
967d7cc
Append '-dev' to version number
Jun 22, 2021
592561f
Merge pull request #1638 from GovReady/ge/load-blank-first-run
davidpofo Jun 22, 2021
ab2db5c
Legacy Statements added as statements for import
alexanderward Jun 22, 2021
2181e21
Updating regex
Jun 23, 2021
330d9a4
Sync develop to most recent main
govreadydeploy Jun 23, 2021
eb423d6
Del size limit on speedyssp img upload
Jun 23, 2021
3afc086
Sync with 0.9.5-dev
Jun 23, 2021
8c4b2bc
updated column for imp statements
alexanderward Jun 23, 2021
92306d6
Fix test shipped catalogs count
Jun 24, 2021
b93032d
Merge branch 'develop' into parser
govreadydeploy Jun 26, 2021
4fe11c0
td not th
davidpofo Jun 19, 2021
5a9f3b9
Revert "td not th"
davidpofo Jun 28, 2021
09ab1c9
Merge branch 'develop' into da/comp_comparison_v2
davidpofo Jun 28, 2021
360a035
these values are safe
davidpofo Jun 28, 2021
892f18b
removing extra differences obj.
davidpofo Jun 28, 2021
e4e38a1
safe and efficiency
davidpofo Jun 29, 2021
f3849f3
adding select/deselect all. checkbox container wrap.
davidpofo Jun 29, 2021
538a5de
control structure for compare button toggle
davidpofo Jun 29, 2021
c839077
Maintain sort order of compare_list otherwise Django will order ascen…
davidpofo Jun 29, 2021
0438239
adding change component button to change what the prime component of …
davidpofo Jun 29, 2021
c98f4a1
changed to allow user passed in for parsing
alexanderward Jun 29, 2021
cbfbac8
remove commented out code from template
davidpofo Jun 30, 2021
57688c2
Add UI for legacy statement display. Also fix StatementTypeEnum. (#1644)
gregelin Jun 30, 2021
11dc9bb
Update CHANGELOG
govreadydeploy Jun 30, 2021
db86b7c
fixing styling of portfolio table
davidpofo Jun 30, 2021
ab6bb5e
using django guardian ObjectPermissionChecker to prefetch permissions…
davidpofo Jun 30, 2021
e1b6e19
hide_registration revert
davidpofo Jun 30, 2021
790613b
formatting for sid
alexanderward Jun 30, 2021
63f20ae
Use StatementEnum.*.name value
govreadydeploy Jun 30, 2021
b4fbac2
removing change component comparison button for now.
davidpofo Jun 30, 2021
64855a9
implemented persistent storage of checks by changing value in hidden …
davidpofo Jun 30, 2021
a409e55
Use one import record for entire file
govreadydeploy Jun 30, 2021
4c1c585
More OSCALize id fixes. Proper Create/Update/Del of smts
govreadydeploy Jul 1, 2021
f8ec296
Display other_statement count on confirm import delete
govreadydeploy Jul 1, 2021
e1091fa
test test_portfolio_projects
davidpofo Jul 1, 2021
e427818
Add project, system.root_element to import_record
govreadydeploy Jul 1, 2021
781bf70
name not value for statement enums
davidpofo Jul 1, 2021
935d937
Merge pull request #1635 from GovReady/ge/no-root-task
davidpofo Jul 1, 2021
6cf17f7
Sometimes there are not parameters and that is okay it is caught by t…
davidpofo Jul 1, 2021
b02d688
Merge pull request #1645 from GovReady/parser
davidpofo Jul 1, 2021
da32218
Merge pull request #1636 from GovReady/ge/cmmc-catalog
davidpofo Jul 1, 2021
eac52ef
Captialize mission for test
davidpofo Jul 2, 2021
a05e13b
name not value for enums
davidpofo Jul 2, 2021
5de8edb
Merge branch 'develop' into fisma_sensitivity
davidpofo Jul 2, 2021
62e3ff0
captial impact... Impact
davidpofo Jul 2, 2021
a540abe
Merge pull request #1637 from GovReady/ge/polish-security-objectives-ui
davidpofo Jul 2, 2021
b83bcff
testing parse for version
davidpofo Jul 2, 2021
b7ae55f
missed one get
davidpofo Jul 2, 2021
093b195
is_prerelease not dev release
davidpofo Jul 2, 2021
c24b385
using is_prerelease works for checking dev
davidpofo Jul 2, 2021
30d3cc0
Merge branch 'develop' into ge/version-dev-test
davidpofo Jul 2, 2021
7ae7ab2
Merge pull request #1642 from GovReady/ge/speedyssp-imagesize-update
davidpofo Jul 2, 2021
d8ea20f
Merge branch 'develop' into da/comp_comparison_v2
davidpofo Jul 2, 2021
d05a433
Merge branch 'develop' into ge/version-dev-test
davidpofo Jul 2, 2021
a03ec87
Merge pull request #1639 from GovReady/ge/version-dev-test
davidpofo Jul 2, 2021
68a4885
need to force login as authenticated user and then reset login
davidpofo Jul 2, 2021
0783a29
url
davidpofo Jul 2, 2021
bfc196b
snyk update to avoid SQL injection vuln found in Django 3.2.4
davidpofo Jul 2, 2021
3b5dcff
check if previously checked and if so then don't hide compare button.
davidpofo Jul 2, 2021
88159fc
Merge branch 'develop' into fisma_sensitivity
davidpofo Jul 2, 2021
a0fe66d
Merge branch 'develop' of https://github.com/govready/govready-q into…
davidpofo Jul 2, 2021
c0dce9b
Merge branch 'develop' into fisma_sensitivity
davidpofo Jul 2, 2021
41550d2
fix conflicting migrations detected
davidpofo Jul 2, 2021
5d6d0b7
systems-security-sensitivity-level
davidpofo Jul 2, 2021
aa354be
Merge branch 'da/comp_comparison_v2' into fisma_sensitivity
davidpofo Jul 2, 2021
48b17dd
Merge pull request #1599 from GovReady/fisma_sensitivity
davidpofo Jul 2, 2021
41601f5
Fix controls/0052 StatementTypeEnum migration (#1648)
gregelin Jul 2, 2021
37aafbe
Update CHANGELOG.md (#1647)
davidpofo Jul 3, 2021
4fc895e
Configure users on install
govreadydeploy Jul 6, 2021
399628b
Add Wazuh collection form to Assessments page (#1651)
gregelin Jul 9, 2021
eb77cd2
checking for dev user creation pw. Create reg users not admin.
davidpofo Jul 12, 2021
af0bc27
Add CMMC baselines, assign baselines (#1649)
gregelin Jul 12, 2021
1f45c5d
first_run finishing touch
davidpofo Jul 12, 2021
ac2b814
Merge pull request #1650 from GovReady/ge/create-users
davidpofo Jul 12, 2021
586f28d
Fix assessment summary link to wazuh (#1653)
gregelin Jul 13, 2021
f8aa034
Da/dropnfill (#1654)
davidpofo Jul 14, 2021
264a964
Remove baseline controls based on control's catalog_key. Fixes failur…
gregelin Jul 14, 2021
c361542
Update SpeedSSP ssp template for multiple catalogs (#1656)
gregelin Jul 15, 2021
73e2eef
Update admin.py
davidpofo Jul 15, 2021
cdb7589
Merge pull request #1591 from mguelfi/develop
davidpofo Jul 15, 2021
0a44bc2
new line fix
Jul 16, 2021
b6f9958
Merge branch 'main' of github.com:GovReady/govready-q into main
Jul 16, 2021
9cdaeb5
fixed bug where id doesn't exist yet in db
alexanderward Jul 22, 2021
4f08189
Merge pull request #1661 from GovReady/import-csam-hotfix
davidpofo Jul 22, 2021
57ce244
Merge branch 'develop' into newline-fix
davidpofo Jul 22, 2021
fc3285c
Merge pull request #1658 from GovReady/newline-fix
davidpofo Jul 22, 2021
db8805e
pinning jinja and installing compliance-trestle with unpinning of mar…
davidpofo Jul 26, 2021
a95d38c
revert some changes to ssp-def for now and added source to statement …
davidpofo Jul 26, 2021
5d29919
ensure source and uuid are added correctly to import/export of compon…
davidpofo Jul 26, 2021
908c2f7
adding oscal-version to element model. clean up output title
davidpofo Jul 26, 2021
5918574
replaced component-defintion for test data with official oscal 1.0.0 …
davidpofo Jul 27, 2021
67f0276
lowering the amount of output for circleci
davidpofo Jul 27, 2021
cc0fd79
fixing exceptions
davidpofo Jul 27, 2021
0610fbf
update example link
davidpofo Jul 27, 2021
8793ac1
WIP on updating system-security-plan definition.
davidpofo Jul 27, 2021
b102a21
missing uuid and 2 removed
davidpofo Jul 27, 2021
8ff380f
SSP export now includes the uuid and version from the root_element ob…
davidpofo Jul 28, 2021
a717407
fixing up some module logic to include real uuid and oscal version
davidpofo Jul 28, 2021
4711d4d
uuid not id
davidpofo Jul 28, 2021
9ed6d37
Import component control statement even if catalog not found
govreadydeploy Jul 29, 2021
8291e6c
Display component, smts even if catalog missing
govreadydeploy Jul 29, 2021
77382e4
Ge/data grid question (#1667)
gregelin Jul 30, 2021
ff5a08d
Adjust test to new rule of importing controls with bad catalog
govreadydeploy Jul 31, 2021
cea47da
natsorting implementation statements before grouping by sid. Providin…
davidpofo Aug 1, 2021
b3b80fe
If no statements are created then delete empty component
davidpofo Aug 1, 2021
87c6df3
OSCAL SSP almost implemented just need to finish implemented reqs.
davidpofo Aug 2, 2021
dcaf699
OSCALSystemSecurityPlanSerializer is getting there still have some fi…
davidpofo Aug 2, 2021
cd81d23
added new function OSCAL_ssp_export in order to export a system's sec…
davidpofo Aug 2, 2021
4b775ff
Merge branch 'develop' into da/oscal_update
davidpofo Aug 2, 2021
1844cca
Coverage 6.0b1 starts to use a modern hash algorithm (sha256) when fi…
davidpofo Aug 2, 2021
a95d69c
added a proxy for parties and responsible parties for component oscal…
davidpofo Aug 2, 2021
3395f35
a couple tweaks for comp
davidpofo Aug 2, 2021
5570674
todo for ssp validation with trestle
davidpofo Aug 2, 2021
2e075a8
read validate ssp with trestle
davidpofo Aug 2, 2021
d091c3f
revert discussion test change.
davidpofo Aug 2, 2021
982e316
extra file
davidpofo Aug 2, 2021
90a5a71
test_path?
davidpofo Aug 2, 2021
bb651a0
delete invalid test files
davidpofo Aug 2, 2021
7a7b151
fixing up implementation and testing of validation of extension.
davidpofo Aug 2, 2021
0bb3bf4
remove extra addition for .doc
davidpofo Aug 2, 2021
5a9f2ab
var sleep?
davidpofo Aug 2, 2021
c899ce1
bad test case
davidpofo Aug 2, 2021
07c1882
Merge pull request #1666 from GovReady/ge/improve-cmpt-import
davidpofo Aug 2, 2021
42c6c45
adding some comments. Better logging/messaging for schema. Fixed spli…
davidpofo Aug 3, 2021
4a22790
Added test of OSCAL ssp export.
davidpofo Aug 3, 2021
78dcaf4
Merge branch 'develop' into da/oscal_update
davidpofo Aug 3, 2021
18b8a5a
explicitly login as user
davidpofo Aug 3, 2021
ac60745
test baseline json file should be test_baselines.json not baseline
davidpofo Aug 3, 2021
2f2a57c
create system
davidpofo Aug 3, 2021
e3649e8
check part correctly. test fix
davidpofo Aug 3, 2021
233519b
get system from self
davidpofo Aug 3, 2021
0bc4653
try/except
davidpofo Aug 3, 2021
6561cc4
last try
davidpofo Aug 3, 2021
88858db
done
davidpofo Aug 3, 2021
3b6f237
Merge pull request #1662 from GovReady/da/oscal_update
davidpofo Aug 3, 2021
74da39e
Remove duplicate loads of select2 in base.html
govreadydeploy Aug 4, 2021
7ffbca1
Da/cleanup export sspcsv (#1674)
davidpofo Aug 5, 2021
4476d03
Da/discussion updates (#1675)
davidpofo Aug 5, 2021
f81a824
addressing shell script issues for dockerfile_exec_gunicorn.sh from G…
davidpofo Aug 5, 2021
4f0a658
Merge pull request #1671 from GovReady/ge/small-select2-fix
davidpofo Aug 6, 2021
ea5d179
Some controls have characters that we currently don't expect. However…
davidpofo Aug 6, 2021
878e328
Sync with updated Main 0.9.7
govreadydeploy Aug 6, 2021
72a8846
Auto-start a particular project (#1640)
gregelin Aug 8, 2021
5a5513a
Move Catalog data into database, faster control select autocomplete (…
gregelin Aug 8, 2021
efb20ea
Ge/mvp july 2021 (#1679)
gregelin Aug 9, 2021
9be8eb4
Sync with 0.9.8 and set to 0.9.9-dev
govreadydeploy Aug 9, 2021
0ece874
Improve search of control selection auto complete (#1681)
gregelin Aug 11, 2021
c6f67a9
Include 'Add component statement' btn when component has no smts (#1682)
gregelin Aug 11, 2021
5c79f2a
Fix first_run and add friendlier component import by refactoring sour…
gregelin Aug 12, 2021
7558fd6
Fix adding catalog_key during new smt creation (#1686)
gregelin Aug 16, 2021
5742ec9
Add migration to load default catalogs to DB (#1687)
gregelin Aug 16, 2021
2d1b327
Ge/migrate add catalog data 2 (#1688)
gregelin Aug 16, 2021
350a3d4
Manage component tags in OSCAL components (#1685)
gregelin Aug 16, 2021
84b9ca8
Bump version
govreadydeploy Aug 16, 2021
abfb417
Merge branch 'main' into feature/0.9.10
gregelin Aug 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
GovReady-Q Release Notes
========================

v0.9.10 (August 16, 2021)
-------------------------

**Developer changes**

* Component tags now correctly included on OSCAL component export and included on OSCAL component import.
* Component tags now correctly included on OSCAL SSP generation.

**Bug fix**

* Add the catalog_key to statement's `sid_class` and `source` fields when adding new statement to a component in library.

**Data fix**

* Add migration in controls to load default control catalogs into CatalogData in database. Remove loading of catalogs via first_run command.


v0.9.9 (August 12, 2021)
------------------------

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.9.9
v0.9.10
51 changes: 51 additions & 0 deletions controls/migrations/0060_auto_20210816_1634.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Generated by Django 3.2.5 on 2021-08-16 16:34

from django.db import migrations
import os.path
import json

from controls.models import Element
from controls.oscal import CatalogData


def load_catalog_data(apps, schema_editor):
"""Load control catalog data into database"""

# Load the default control catalogs and baselines
CATALOG_PATH = os.path.join(os.path.dirname(__file__),'..','data','catalogs')
BASELINE_PATH = os.path.join(os.path.dirname(__file__),'..','data','baselines')

# TODO: Check directory exists
catalog_files = [file for file in os.listdir(CATALOG_PATH) if file.endswith('.json')]
# Load catalog and baseline data into database records from source files if data records do not exist in database
for cf in catalog_files:
catalog_key = cf.replace("_catalog.json", "")
with open(os.path.join(CATALOG_PATH,cf), 'r') as json_file:
catalog_json = json.load(json_file)
baseline_filename = cf.replace("_catalog.json", "_baselines.json")
if os.path.isfile(os.path.join(BASELINE_PATH, baseline_filename)):
with open(os.path.join(BASELINE_PATH, baseline_filename), 'r') as json_file:
baselines_json = json.load(json_file)
else:
baselines_json = {}

catalog, created = CatalogData.objects.get_or_create(
catalog_key=catalog_key,
catalog_json=catalog_json,
baselines_json=baselines_json
)
if created:
print(f"{catalog_key} record created into database")
else:
print(f"{catalog_key} record found in database")


class Migration(migrations.Migration):

dependencies = [
('controls', '0059_auto_20210811_0001'),
]

operations = [
migrations.RunPython(load_catalog_data)
]
61 changes: 40 additions & 21 deletions controls/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from django.views.generic import ListView
from simple_history.utils import update_change_reason

from siteapp.models import Project, Organization
from siteapp.models import Project, Organization, Tag
from siteapp.settings import GOVREADY_URL
from system_settings.models import SystemSettings
from .forms import ElementEditForm
Expand Down Expand Up @@ -651,12 +651,21 @@ def as_json(self):

of["system-security-plan"]["metadata"]['roles'] = [{"id": auths.get('role', "member").split(';')[0], "title": auths.get('role', "member").split(';')[0].capitalize() } for user, auths in users]
of["system-security-plan"]["system-implementation"]['users'] = [{"uuid":user_party_uuid, "title":user.username, "role-ids": [auths.get('role', "member").split(';')[0]]} for user, auths in users]
of["system-security-plan"]["system-implementation"]['components'] = [{"uuid":str(comp_ele.uuid), "title":comp_ele.name, "description":comp_ele.description, "status": {"state": comp_ele.component_state}, "type":comp_ele.component_type, "responsible-roles": [{
"role-id": "asset-owner",
"party-uuids": [
user_party_uuid
]
}]} for comp_ele in components]# TODO: responsible-roles
of["system-security-plan"]["system-implementation"]['components'] = [{"uuid":str(comp_ele.uuid),
"title":comp_ele.name,
"description":comp_ele.description,
"status": {"state": comp_ele.component_state},
"type":comp_ele.component_type,
"responsible-roles": [{
"role-id": "asset-owner",
"party-uuids": [user_party_uuid]
}],
"props": [{"name": "tag",
"ns": "https://govready.com/ns/oscal",
"value": tag.label} for tag in
comp_ele.tags.all()]
} for comp_ele in components]# TODO: responsible-roles

# System characteristics
# TODO: status remarks, authorization-boundary
security_body = project.system.get_security_impact_level
Expand Down Expand Up @@ -768,8 +777,7 @@ def as_json(self):
"last-modified": self.element.updated.replace(microsecond=0).isoformat(),
"version": self.element.updated.replace(microsecond=0).isoformat(),
"oscal-version": self.element.oscal_version,
"parties": parties,
"props": props
"parties": parties
},
"components": [
{
Expand All @@ -778,6 +786,7 @@ def as_json(self):
"title": self.element.full_name or self.element.name,
"description": self.element.description,
"responsible-roles": responsible_roles, # TODO: gathering party-uuids, just filling for now
"props": props,
"control-implementations": control_implementations
}
]
Expand Down Expand Up @@ -966,8 +975,17 @@ def create_component(self, component_json):
)

logger.info(f"Component {new_component.name} created with UUID {new_component.uuid}.")

component_props = component_json.get('props', None)
if component_props is not None:
desired_tags = set([prop['value'] for prop in component_props if prop['name'] == 'tag' and 'ns' in prop and prop['ns'] == "https://govready.com/ns/oscal"])
existing_tags = Tag.objects.filter(label__in=desired_tags).values('id', 'label')
tags_to_create = desired_tags.difference(set([tag['label'] for tag in existing_tags]))
new_tags = Tag.objects.bulk_create([Tag(label=tag) for tag in tags_to_create])
all_tag_ids = [tag.id for tag in new_tags] + [tag['id'] for tag in existing_tags]
new_component.add_tags(all_tag_ids)
new_component.save()
control_implementation_statements = component_json.get('control-implementations', None)
# catalog = "missing"
# If there data exists the OSCAL component's control-implementations key
if control_implementation_statements:
for control_element in control_implementation_statements:
Expand Down Expand Up @@ -1250,6 +1268,7 @@ def component_library_component(request, element_id):
"impl_smts": impl_smts,
"is_admin": request.user.is_superuser,
"enable_experimental_opencontrol": SystemSettings.enable_experimental_opencontrol,
"form_source": "component_library"
}
return render(request, "components/element_detail_tabs.html", context)

Expand Down Expand Up @@ -1298,6 +1317,7 @@ def component_library_component(request, element_id):
"enable_experimental_opencontrol": SystemSettings.enable_experimental_opencontrol,
"enable_experimental_oscal": SystemSettings.enable_experimental_oscal,
"opencontrol": opencontrol_string,
"form_source": "component_library"
}
return render(request, "components/element_detail_tabs.html", context)

Expand All @@ -1312,6 +1332,8 @@ def api_controls_select(request):
cxs = []
for catalog in catalogs_containing_cl_id:
catalog_key_display = catalog.catalog_key.replace("_", " ")
# TODO: get control title effectively from CatalogData
# title = "catalog.ctl_title"
cxs.append({"id": oscal_ctl_id, 'catalog_key_display': catalog_key_display, 'display_text': f"{oscal_ctl_id} - {catalog_key_display} - {cl_id}"})
status = "success"
message = "Sending list."
Expand Down Expand Up @@ -1998,20 +2020,18 @@ def save_smt(request):
else:
new_statement_type_enum = StatementTypeEnum[form_values['statement_type'].upper()]
# Create new Statement object
new_sid_class = form_values['sid_class'].replace(" ","_") # convert displayed catalog name to catalog_key
statement = Statement(
sid=oscalize_control_id(form_values['sid']),
sid_class=form_values['sid_class'],
sid_class=new_sid_class,
source=new_sid_class,
body=form_values['body'],
pid=form_values['pid'],
statement_type=new_statement_type_enum.name,
status=form_values['status'],
remarks=form_values['remarks'],
)
new_statement = True
# Convert the human readable catalog name to proper catalog key, if needed
# from human readable `NIST SP-800-53 rev4` to `NIST_SP-800-53_rev4`
statement.sid_class = statement.sid_class.replace(" ","_")


# Updating or saving a new producer_element?
try:
Expand Down Expand Up @@ -2048,8 +2068,7 @@ def save_smt(request):
except Exception as e:
statement_status = "error"
statement_msg = "Statement save failed while saving statement prototype. Error reported {}".format(e)
return JsonResponse({"status": "error", "message": statement_msg})

return JsonResponse({"status": statement_status, "message": statement_msg})
# Retain only prototype statement if statement is created in the component library
# A statement of type `control_implementation` should only exists if associated a consumer_element.
# When the statement is created in the component library, no consuming_element will exist.
Expand All @@ -2058,13 +2077,13 @@ def save_smt(request):
# - Skip the associating the statement with the system's root_element because we do not have a system identified
statement_del_msg = ""
if "form_source" in form_values and form_values['form_source'] == 'component_library':
# Form source is part of form
# Form received from component library
from django.core import serializers
serialized_obj = serializers.serialize('json', [statement, ])
# Delete statement
Statement.objects.filter(pk=statement.id).delete()
statement.delete()
statement_del_msg = "Statement unassociated with System/Consumer Element deleted."
statement_del_msg = "Orphaned Control_Implementation Statement deleted."
else:
# Associate Statement and System's root_element
system_id = form_values['system_id']
Expand All @@ -2087,13 +2106,13 @@ def save_smt(request):

# Save Statement object
try:
statement.save()
if not new_statement:
statement.save()
statement_msg = "Statement saved."
messages.add_message(request, messages.INFO, f"Statement {smt_id} Saved")
except Exception as e:
statement_status = "error"
statement_msg = "Statement save failed. Error reported {}".format(e)

return JsonResponse({"status": statement_status, "message": statement_msg})
# Return successful save result to web page's Ajax request
return JsonResponse(
Expand Down
12 changes: 12 additions & 0 deletions q-files/vendors/govready/components/OSCAL/cybrary.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
"type": "software",
"title": "Cybrary",
"description": "Training course",
"props": [
{
"name": "tag",
"ns": "https://govready.com/ns/oscal",
"value": "sample"
},
{
"name": "tag",
"ns": "https://govready.com/ns/oscal",
"value": "training"
}
],
"responsible-roles": [
{
"role-id": "supplier",
Expand Down
7 changes: 7 additions & 0 deletions q-files/vendors/govready/components/OSCAL/ilias.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"type": "software",
"title": "ILIAS",
"description": "ILIAS Training course",
"props": [
{
"name": "tag",
"ns": "https://govready.com/ns/oscal",
"value": "sample"
}
],
"responsible-roles": [
{
"role-id": "supplier",
Expand Down
5 changes: 3 additions & 2 deletions siteapp/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ class SupportAdmin(admin.ModelAdmin):
fields = ('text', 'email', 'phone', 'url')

class TagAdmin(admin.ModelAdmin):
list_display = ('label', 'system_created')
fields = ('label', 'system_created')
list_display = ('id', 'label', 'system_created')
fields = ('id', 'label', 'system_created')
readonly_fields = ('id',)

class ProjectAssetAdmin(admin.ModelAdmin):
list_display = ('uuid', 'asset_type', 'description', 'project', 'default', 'title', 'filename', 'created', 'updated')
Expand Down
28 changes: 0 additions & 28 deletions siteapp/management/commands/first_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,34 +123,6 @@ def handle(self, *args, **options):
# One or more superusers already exists
print("\n[INFO] Superuser(s) already exists, not creating default admin superuser. Did you specify 'govready_admins' in 'local/environment.json'? Did you specify an admin or are you connecting to a persistent database?\n")

# Load the default control catalogs and baselines
CATALOG_PATH = os.path.join(os.path.dirname(__file__),'..','..','..','controls','data','catalogs')
BASELINE_PATH = os.path.join(os.path.dirname(__file__),'..','..','..','controls','data','baselines')

# TODO: Check directory exists
catalog_files = [file for file in os.listdir(CATALOG_PATH) if file.endswith('.json')]
# Load catalog and baseline data into database records from source files if data records do not exist in database
for cf in catalog_files:
catalog_key = cf.replace("_catalog.json", "")
with open(os.path.join(CATALOG_PATH,cf), 'r') as json_file:
catalog_json = json.load(json_file)
baseline_filename = cf.replace("_catalog.json", "_baselines.json")
if os.path.isfile(os.path.join(BASELINE_PATH, baseline_filename)):
with open(os.path.join(BASELINE_PATH, baseline_filename), 'r') as json_file:
baselines_json = json.load(json_file)
else:
baselines_json = {}

catalog, created = CatalogData.objects.get_or_create(
catalog_key=catalog_key,
catalog_json=catalog_json,
baselines_json=baselines_json
)
if created:
print(f"{catalog_key} record created into database")
else:
print(f"{catalog_key} record found in database")

# Install default AppSources and compliance apps if no AppSources installed
if not AppSource.objects.filter(slug="govready-q-files-startpack").exists():
# Create AppSources that we want.
Expand Down
7 changes: 6 additions & 1 deletion siteapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,14 @@ def make_secret_key():
'ENGINE': 'django.db.backends.sqlite3',
'NAME': local('db.sqlite3'),
'CONN_MAX_AGE': 60*5, # 5 min
'timeout': 30,
'OPTIONS': {
'timeout': 30, # in seconds
# see also
# https://docs.python.org/3.7/library/sqlite3.html#sqlite3.connect
}
}
}

if not environment.get('db'):
# Ensure the 'local' directory exists for the default Sqlite
# database and then try touching the path to check for write
Expand Down
3 changes: 3 additions & 0 deletions siteapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def setUp(self):
}
}
)
var_sleep(1)
load_modules().handle() # load system modules

AppSource.objects.get_or_create(
Expand All @@ -340,6 +341,8 @@ def setUp(self):
# tests. The Selenium tests require a separate log in via the
# headless browser.

var_sleep(2)

# self.user = User.objects.create_superuser(
self.user = wait_for_sleep_after(lambda: User.objects.get_or_create(
username="me",
Expand Down
11 changes: 4 additions & 7 deletions templates/components/element_detail_tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,16 +388,13 @@ <h3>Systems</h3>
}

function set_catalog_key(display_text, element) {
// Determine the catalog from the selected display_text
// Set the sid_class field to the catalogkey based on splitting the selected display_text
// Split text
displaytext = display_text.split(' - ');
var first = displaytext.shift(); //or arr[arr.length-1];
var last = displaytext.pop(); //or arr[0];
dtv = [first, displaytext.join(" - "), last]; // [control_id, title, catalog_key]

ck = dtv[2]

$(element).val(ck)
var catalog = displaytext.shift(); //or arr[0];
dtv = [first, displaytext.join(" - "), catalog]; // [control_id, catalog_key - match string]
$(element).val(dtv[2])
}

function save_smt(smt_panel_num) {
Expand Down
2 changes: 1 addition & 1 deletion templates/controls/add_smt_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<option value='' disabled selected>Enter control ID (e.g., ac-2, CM-3(1), 3.1.3)</option>
</select>
<input type="hidden" id="sid_class_panel_num" name="sid_class" prompt="Enter catalog_key" value="{{ catalog_key }}">
<input type="hidden" id="form_source_panel_num" name="form_source" prompt="Form source" value="component_library">
<input type="hidden" id="form_source_panel_num" name="form_source" prompt="Form source" value="{{ form_source }}">
</div>
<div class="form-group">
<input type="hidden" id="smt_id" name="smt_id" value="">
Expand Down