-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from GSA-TTS/integrate-gsa-plugin
Integrate gsa plugin
- Loading branch information
Showing
9 changed files
with
195 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# switch back to a released version of compliance-trestle once the jinja tags work is merged and released | ||
compliance-trestle @ git+https://github.com/gsa-tts/compliance-trestle.git@77a6d5d0 | ||
compliance-trestle-gsa @ git+https://github.com/GSA-TTS/compliance-trestle-gsa.git@71a4a55 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#! /usr/bin/env bash | ||
|
||
usage=" | ||
$0: Add default values from gsa-defaults plugin into an OSCAL JSON SSP | ||
Usage: | ||
$0 -h | ||
$0 [-n SYSTEM_NAME] | ||
Options: | ||
-h: show help and exit | ||
-n: System Name. Defaults to 'system-name' value in trestle-config.yaml | ||
Notes: | ||
* Will load defaults from trestle-config.yaml file, if present | ||
" | ||
|
||
set -e | ||
|
||
source /app/bin/functions.sh | ||
system_name=$(yaml_parse_value 'trestle-config.yaml' 'system-name') | ||
|
||
while getopts "hn:" opt; do | ||
case "$opt" in | ||
n) | ||
system_name=${OPTARG} | ||
;; | ||
h) | ||
echo "$usage" | ||
exit 0 | ||
;; | ||
esac | ||
done | ||
|
||
if [ "$system_name" = "" ]; then | ||
echo "$usage" | ||
exit 1 | ||
fi | ||
|
||
if [ -d "system-security-plans/$system_name" ]; then | ||
merge-ssp -n "$system_name" | ||
else | ||
echo "No existing SSP found" | ||
exit 1 | ||
fi | ||
|
||
trestle gsa-defaults -f "system-security-plans/$system_name/system-security-plan.json" | ||
|
||
split-ssp -n $system_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,49 @@ | ||
#! /usr/bin/env bash | ||
|
||
usage=" | ||
$0: Merge SSP OSCAL into a single file | ||
Usage: | ||
$0 -h | ||
$0 [-n SYSTEM_NAME] | ||
Options: | ||
-h: show help and exit | ||
-n: System Name. Defaults to 'system-name' value in trestle-config.yaml | ||
Notes: | ||
* Will load defaults from trestle-config.yaml file, if present | ||
" | ||
|
||
set -e | ||
|
||
if [ ! -f "system-security-plan.json" ]; then | ||
echo "Usage: First, cd to the folder containing the base SSP json file. Then: $0" | ||
source /app/bin/functions.sh | ||
system_name=$(yaml_parse_value 'trestle-config.yaml' 'system-name') | ||
|
||
while getopts "hn:" opt; do | ||
case "$opt" in | ||
n) | ||
system_name=${OPTARG} | ||
;; | ||
h) | ||
echo "$usage" | ||
exit 0 | ||
;; | ||
esac | ||
done | ||
|
||
if [ "$system_name" = "" ]; then | ||
echo "$usage" | ||
exit 1 | ||
fi | ||
|
||
ssp_path="system-security-plans/$system_name" | ||
|
||
if [ ! -d "$ssp_path" ]; then | ||
echo "No existing SSP found." | ||
echo "$usage" | ||
exit 1 | ||
fi | ||
|
||
cd "$ssp_path" | ||
trestle merge -e "system-security-plan.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,41 @@ | ||
#! /usr/bin/env bash | ||
|
||
usage=" | ||
$0: Split SSP OSCAL into manageable files | ||
Usage: | ||
$0 -h | ||
$0 [-n SYSTEM_NAME] | ||
Options: | ||
-h: show help and exit | ||
-n: System Name. Defaults to 'system-name' value in trestle-config.yaml | ||
Notes: | ||
* Will load defaults from trestle-config.yaml file, if present | ||
" | ||
|
||
set -e | ||
|
||
if [ "$1" = "" ]; then | ||
echo "Usage: $0 SSP_FILE_NAME" | ||
source /app/bin/functions.sh | ||
system_name=$(yaml_parse_value 'trestle-config.yaml' 'system-name') | ||
|
||
while getopts "hn:" opt; do | ||
case "$opt" in | ||
n) | ||
system_name=${OPTARG} | ||
;; | ||
h) | ||
echo "$usage" | ||
exit 0 | ||
;; | ||
esac | ||
done | ||
|
||
if [ "$system_name" = "" ]; then | ||
echo "$usage" | ||
exit 1 | ||
fi | ||
|
||
trestle split -f "$1" -e "system-security-plan.metadata,system-security-plan.system-characteristics,system-security-plan.system-implementation" | ||
ssp_file="system-security-plans/$system_name/system-security-plan.json" | ||
trestle split -f "$ssp_file" -e "system-security-plan.metadata,system-security-plan.system-characteristics,system-security-plan.system-implementation" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#! /usr/bin/env bash | ||
|
||
usage=" | ||
$0: Validate OSCAL JSON SSP | ||
Usage: | ||
$0 -h | ||
$0 [-n SYSTEM_NAME] | ||
Options: | ||
-h: show help and exit | ||
-n: System Name. Defaults to 'system-name' value in trestle-config.yaml | ||
Notes: | ||
* Will load defaults from trestle-config.yaml file, if present | ||
" | ||
|
||
set -e | ||
|
||
source /app/bin/functions.sh | ||
system_name=$(yaml_parse_value 'trestle-config.yaml' 'system-name') | ||
|
||
while getopts "hn:" opt; do | ||
case "$opt" in | ||
n) | ||
system_name=${OPTARG} | ||
;; | ||
h) | ||
echo "$usage" | ||
exit 0 | ||
;; | ||
esac | ||
done | ||
|
||
if [ "$system_name" = "" ]; then | ||
echo "$usage" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "system-security-plans/$system_name" ]; then | ||
echo "No existing SSP found, skipping validation" | ||
exit 0 | ||
fi | ||
|
||
|
||
ssp_path="system-security-plans/$system_name/system-security-plan.json" | ||
set +e | ||
trestle gsa-validate -f $ssp_path | ||
status=$? | ||
if [ $status -ne 0 ]; then | ||
echo "Try running 'add-gsa-defaults -n $system_name' to add default values to your SSP" | ||
fi | ||
|
||
exit $status |