diff --git a/src/test/java/gov/nist/secauto/oscal/tools/cli/core/CLITest.java b/src/test/java/gov/nist/secauto/oscal/tools/cli/core/CLITest.java index bf70835..8890761 100644 --- a/src/test/java/gov/nist/secauto/oscal/tools/cli/core/CLITest.java +++ b/src/test/java/gov/nist/secauto/oscal/tools/cli/core/CLITest.java @@ -30,8 +30,16 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; + import gov.nist.secauto.metaschema.cli.processor.ExitCode; import gov.nist.secauto.metaschema.cli.processor.ExitStatus; +import gov.nist.secauto.oscal.lib.profile.resolver.ProfileResolutionException; import org.junit.jupiter.api.Test; @@ -79,4 +87,56 @@ void testConvertSubcommandsHelp() { evaluateResult(CLI.runCli(args), ExitCode.INVALID_COMMAND); } } + + @Test + void testValidateSubCommandInvalidFile() throws IOException, URISyntaxException { + for (String cmd : modelCommands) { + URL url = getClass().getResource("/cli/example_" + cmd + "_invalid.xml"); + String path = Path.of(url.toURI()).toString(); + String[] args = { cmd, "validate", path }; + ExitStatus result = CLI.runCli(args); + evaluateResult(result, ExitCode.FAIL); + } + } + + @Test + void testValidateSubCommandValidFile() throws IOException, URISyntaxException { + for (String cmd : modelCommands) { + URL url = getClass().getResource("/cli/example_" + cmd + "_valid.xml"); + String path = Path.of(url.toURI()).toString(); + String[] args = { cmd, "validate", path }; + ExitStatus result = CLI.runCli(args); + evaluateResult(result, ExitCode.OK); + } + } + + @Test + void testConvertSubCommandXmlJsonValidFile() throws IOException, URISyntaxException { + for (String cmd : modelCommands) { + URL url = getClass().getResource("/cli/example_" + cmd + "_invalid.xml"); + String path = Path.of(url.toURI()).toString(); + String outputPath = path.replace(".xml", ".json"); + String[] args = { cmd, "convert", "--to=json", path, outputPath, "--overwrite" }; + ExitStatus result = CLI.runCli(args); + evaluateResult(result, ExitCode.OK); + } + } + + @Test + void testResolveSubCommandValidFile() throws IOException, URISyntaxException { + URL url = getClass().getResource("/cli/example_profile_valid.xml"); + String path = Path.of(url.toURI()).toString(); + String[] args = { "profile", "resolve", "--to=xml", path }; + ExitStatus result = CLI.runCli(args); + evaluateResult(result, ExitCode.OK); + } + + @Test + void testResolveSubCommandInvalidFile() throws IOException, URISyntaxException { + URL url = getClass().getResource("/cli/example_profile_invalid.xml"); + String path = Path.of(url.toURI()).toString(); + String[] args = { "profile", "resolve", "--to=xml", path }; + ExitStatus result = CLI.runCli(args); + evaluateResult(result, ExitCode.PROCESSING_ERROR, ProfileResolutionException.class); + } } diff --git a/src/test/resources/cli/example_ap_invalid.json b/src/test/resources/cli/example_ap_invalid.json new file mode 100644 index 0000000..b8bd41b --- /dev/null +++ b/src/test/resources/cli/example_ap_invalid.json @@ -0,0 +1,39 @@ +{ + "assessment-plan" : { + "uuid" : "bd49e556-187a-458a-9000-0b557f553dae", + "metadata" : { + "title" : "Invalid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-ssp" : { + "href" : "#1db9626b-1ef9-47f9-944f-a71ce8494322" + }, + "back-matter" : { + "resources" : [ { + "uuid" : "1db9626b-1ef9-47f9-944f-a71ce8494322", + "rlinks" : [ { + "href" : "example_ssp_invalid.xml" + }, { + "href" : "example_ssp_invalid.json" + }, { + "href" : "example_ssp_invalid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_ap_invalid.xml b/src/test/resources/cli/example_ap_invalid.xml new file mode 100644 index 0000000..8dd03b3 --- /dev/null +++ b/src/test/resources/cli/example_ap_invalid.xml @@ -0,0 +1,27 @@ + + + + + Invalid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + + + + + + + diff --git a/src/test/resources/cli/example_ap_invalid.yml b/src/test/resources/cli/example_ap_invalid.yml new file mode 100644 index 0000000..237f005 --- /dev/null +++ b/src/test/resources/cli/example_ap_invalid.yml @@ -0,0 +1,28 @@ +--- +assessment-plan: + uuid: bd49e556-187a-458a-9000-0b557f553dae + metadata: + title: Invalid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-ssp: + href: '#1db9626b-1ef9-47f9-944f-a71ce8494322' + back-matter: + resources: + - uuid: 1db9626b-1ef9-47f9-944f-a71ce8494322 + rlinks: + - href: example_ssp_invalid.xml + - href: example_ssp_invalid.json + - href: example_ssp_invalid.yaml diff --git a/src/test/resources/cli/example_ap_valid.json b/src/test/resources/cli/example_ap_valid.json new file mode 100644 index 0000000..a21d6ae --- /dev/null +++ b/src/test/resources/cli/example_ap_valid.json @@ -0,0 +1,44 @@ +{ + "assessment-plan" : { + "uuid" : "948a30b0-a706-43b0-ac5a-4c64fda1c3d0", + "metadata" : { + "title" : "Valid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-ssp" : { + "href" : "#4a8f42e8-1357-4664-bd88-aac54cb9aeb8" + }, + "reviewed-controls" : { + "control-selections" : [ { + "include-all" : { } + } ] + }, + "back-matter" : { + "resources" : [ { + "uuid" : "4a8f42e8-1357-4664-bd88-aac54cb9aeb8", + "rlinks" : [ { + "href" : "example_ssp_valid.xml" + }, { + "href" : "example_ssp_valid.json" + }, { + "href" : "example_ssp_valid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_ap_valid.xml b/src/test/resources/cli/example_ap_valid.xml new file mode 100644 index 0000000..1fa0b3e --- /dev/null +++ b/src/test/resources/cli/example_ap_valid.xml @@ -0,0 +1,32 @@ + + + + + Valid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + + + + + + + + + + + + diff --git a/src/test/resources/cli/example_ap_valid.yml b/src/test/resources/cli/example_ap_valid.yml new file mode 100644 index 0000000..8a42719 --- /dev/null +++ b/src/test/resources/cli/example_ap_valid.yml @@ -0,0 +1,31 @@ +--- +assessment-plan: + uuid: 948a30b0-a706-43b0-ac5a-4c64fda1c3d0 + metadata: + title: Valid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-ssp: + href: '#4a8f42e8-1357-4664-bd88-aac54cb9aeb8' + reviewed-controls: + control-selections: + - include-all: {} + back-matter: + resources: + - uuid: 4a8f42e8-1357-4664-bd88-aac54cb9aeb8 + rlinks: + - href: example_ssp_valid.xml + - href: example_ssp_valid.json + - href: example_ssp_valid.yaml diff --git a/src/test/resources/cli/example_ar_invalid.json b/src/test/resources/cli/example_ar_invalid.json new file mode 100644 index 0000000..35163ec --- /dev/null +++ b/src/test/resources/cli/example_ar_invalid.json @@ -0,0 +1,39 @@ +{ + "assessment-results" : { + "uuid" : "33bef05b-dda4-4c4e-aaec-2721acaee3dc", + "metadata" : { + "title" : "Invalid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-ap" : { + "href" : "#f1a6f923-ca07-4d61-8415-40e873aef6ea" + }, + "back-matter" : { + "resources" : [ { + "uuid" : "f1a6f923-ca07-4d61-8415-40e873aef6ea", + "rlinks" : [ { + "href" : "example_ap_invalid.xml" + }, { + "href" : "example_ap_invalid.json" + }, { + "href" : "example_ap_invalid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_ar_invalid.xml b/src/test/resources/cli/example_ar_invalid.xml new file mode 100644 index 0000000..59e300a --- /dev/null +++ b/src/test/resources/cli/example_ar_invalid.xml @@ -0,0 +1,27 @@ + + + + + Invalid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + + + + + + + diff --git a/src/test/resources/cli/example_ar_invalid.yml b/src/test/resources/cli/example_ar_invalid.yml new file mode 100644 index 0000000..0b54a92 --- /dev/null +++ b/src/test/resources/cli/example_ar_invalid.yml @@ -0,0 +1,28 @@ +--- +assessment-results: + uuid: 33bef05b-dda4-4c4e-aaec-2721acaee3dc + metadata: + title: Invalid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-ap: + href: '#f1a6f923-ca07-4d61-8415-40e873aef6ea' + back-matter: + resources: + - uuid: f1a6f923-ca07-4d61-8415-40e873aef6ea + rlinks: + - href: example_ap_invalid.xml + - href: example_ap_invalid.json + - href: example_ap_invalid.yaml diff --git a/src/test/resources/cli/example_ar_valid.json b/src/test/resources/cli/example_ar_valid.json new file mode 100644 index 0000000..80daf9d --- /dev/null +++ b/src/test/resources/cli/example_ar_valid.json @@ -0,0 +1,51 @@ +{ + "assessment-results" : { + "uuid" : "11525219-b63c-4fae-a33b-569f5d7c6edb", + "metadata" : { + "title" : "Valid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-ap" : { + "href" : "#e5a5688d-24b2-4dd1-b3dd-ef35321eafed" + }, + "results" : [ { + "uuid" : "2c22eb69-7c4b-4a00-a1c0-5f88e8b70288", + "title" : "Example Result Entry 1 from Example Valid Assessment", + "description" : "This description is an explanation of the assessment plan's results.", + "start" : "2023-10-22T00:00:00Z", + "end" : "2023-10-22T00:00:00Z", + "reviewed-controls" : { + "control-selections" : [ { + "include-all" : { } + } ] + } + } ], + "back-matter" : { + "resources" : [ { + "uuid" : "e5a5688d-24b2-4dd1-b3dd-ef35321eafed", + "rlinks" : [ { + "href" : "example_ap_valid.xml" + }, { + "href" : "example_ap_valid.json" + }, { + "href" : "example_ap_valid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_ar_valid.xml b/src/test/resources/cli/example_ar_valid.xml new file mode 100644 index 0000000..26e790e --- /dev/null +++ b/src/test/resources/cli/example_ar_valid.xml @@ -0,0 +1,40 @@ + + + + + Valid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + Example Result Entry 1 from Example Valid Assessment + +

This description is an explanation of the assessment plan's results.

+
+ 2023-10-22T00:00:00.000000-00:00 + 2023-10-22T00:00:00.000000-00:00 + + + + + +
+ + + + + + + +
diff --git a/src/test/resources/cli/example_ar_valid.yml b/src/test/resources/cli/example_ar_valid.yml new file mode 100644 index 0000000..b291651 --- /dev/null +++ b/src/test/resources/cli/example_ar_valid.yml @@ -0,0 +1,37 @@ +--- +assessment-results: + uuid: 11525219-b63c-4fae-a33b-569f5d7c6edb + metadata: + title: Valid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-ap: + href: '#e5a5688d-24b2-4dd1-b3dd-ef35321eafed' + results: + - uuid: 2c22eb69-7c4b-4a00-a1c0-5f88e8b70288 + title: Example Result Entry 1 from Example Valid Assessment + description: This description is an explanation of the assessment plan's results. + start: 2023-10-22T00:00:00Z + end: 2023-10-22T00:00:00Z + reviewed-controls: + control-selections: + - include-all: {} + back-matter: + resources: + - uuid: e5a5688d-24b2-4dd1-b3dd-ef35321eafed + rlinks: + - href: example_ap_valid.xml + - href: example_ap_valid.json + - href: example_ap_valid.yaml diff --git a/src/test/resources/cli/example_catalog_invalid.json b/src/test/resources/cli/example_catalog_invalid.json new file mode 100644 index 0000000..ca5d2e5 --- /dev/null +++ b/src/test/resources/cli/example_catalog_invalid.json @@ -0,0 +1,27 @@ +{ + "catalog" : { + "uuid" : "813c856e-fe8c-4dbb-9e6f-e303ba32a559", + "metadata" : { + "title" : "Invalid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "groups" : [ { + "id" : "bg1" + } ] + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_catalog_invalid.xml b/src/test/resources/cli/example_catalog_invalid.xml new file mode 100644 index 0000000..2b0b5b8 --- /dev/null +++ b/src/test/resources/cli/example_catalog_invalid.xml @@ -0,0 +1,20 @@ + + + + + Invalid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + diff --git a/src/test/resources/cli/example_catalog_invalid.yml b/src/test/resources/cli/example_catalog_invalid.yml new file mode 100644 index 0000000..e304239 --- /dev/null +++ b/src/test/resources/cli/example_catalog_invalid.yml @@ -0,0 +1,21 @@ +--- +catalog: + uuid: 813c856e-fe8c-4dbb-9e6f-e303ba32a559 + metadata: + title: Invalid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + groups: + - id: bg1 diff --git a/src/test/resources/cli/example_catalog_valid.json b/src/test/resources/cli/example_catalog_valid.json new file mode 100644 index 0000000..fdc25d1 --- /dev/null +++ b/src/test/resources/cli/example_catalog_valid.json @@ -0,0 +1,43 @@ +{ + "catalog" : { + "uuid" : "cabcd8ed-bf29-4e63-b15c-7a559ffa2426", + "metadata" : { + "title" : "Valid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "groups" : [ { + "id" : "eg1", + "title" : "Example Group 1", + "controls" : [ { + "id" : "control-1", + "title" : "Control 1", + "parts" : [ { + "name" : "statement", + "prose" : "This statement is a requirement for Control 1." + } ] + }, { + "id" : "control-2", + "title" : "Control 2", + "parts" : [ { + "name" : "statement", + "prose" : "This statement is a requirement for Control 2." + } ] + } ] + } ] + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_catalog_valid.xml b/src/test/resources/cli/example_catalog_valid.xml new file mode 100644 index 0000000..9492d88 --- /dev/null +++ b/src/test/resources/cli/example_catalog_valid.xml @@ -0,0 +1,38 @@ + + + + + Valid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + Example Group 1 + + Control 1 + +

This statement is a requirement for Control 1.

+
+
+ + Control 2 + +

This statement is a requirement for Control 2.

+
+
+
+
diff --git a/src/test/resources/cli/example_catalog_valid.yml b/src/test/resources/cli/example_catalog_valid.yml new file mode 100644 index 0000000..f4f0a7f --- /dev/null +++ b/src/test/resources/cli/example_catalog_valid.yml @@ -0,0 +1,33 @@ +--- +catalog: + uuid: cabcd8ed-bf29-4e63-b15c-7a559ffa2426 + metadata: + title: Valid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + groups: + - id: eg1 + title: Example Group 1 + controls: + - id: control-1 + title: Control 1 + parts: + - name: statement + prose: This statement is a requirement for Control 1. + - id: control-2 + title: Control 2 + parts: + - name: statement + prose: This statement is a requirement for Control 2. diff --git a/src/test/resources/cli/example_component-definition_invalid.json b/src/test/resources/cli/example_component-definition_invalid.json new file mode 100644 index 0000000..ec58bf0 --- /dev/null +++ b/src/test/resources/cli/example_component-definition_invalid.json @@ -0,0 +1,37 @@ +{ + "component-definition" : { + "uuid" : "8f5341ba-9cca-488e-866f-99a502e5dc60", + "metadata" : { + "title" : "Invalid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "components" : [ { } ], + "back-matter" : { + "resources" : [ { + "uuid" : "8d99e4fb-02a8-4dc6-9beb-d15f74a423ba", + "rlinks" : [ { + "href" : "example_ap_invalid.xml" + }, { + "href" : "example_ap_invalid.json" + }, { + "href" : "example_ap_invalid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_component-definition_invalid.xml b/src/test/resources/cli/example_component-definition_invalid.xml new file mode 100644 index 0000000..5e17aeb --- /dev/null +++ b/src/test/resources/cli/example_component-definition_invalid.xml @@ -0,0 +1,27 @@ + + + + + Invalid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + + + + + + + diff --git a/src/test/resources/cli/example_component-definition_invalid.yml b/src/test/resources/cli/example_component-definition_invalid.yml new file mode 100644 index 0000000..b20707f --- /dev/null +++ b/src/test/resources/cli/example_component-definition_invalid.yml @@ -0,0 +1,28 @@ +--- +component-definition: + uuid: 8f5341ba-9cca-488e-866f-99a502e5dc60 + metadata: + title: Invalid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + components: + - {} + back-matter: + resources: + - uuid: 8d99e4fb-02a8-4dc6-9beb-d15f74a423ba + rlinks: + - href: example_ap_invalid.xml + - href: example_ap_invalid.json + - href: example_ap_invalid.yaml diff --git a/src/test/resources/cli/example_component-definition_valid.json b/src/test/resources/cli/example_component-definition_valid.json new file mode 100644 index 0000000..7f32d18 --- /dev/null +++ b/src/test/resources/cli/example_component-definition_valid.json @@ -0,0 +1,52 @@ +{ + "component-definition" : { + "uuid" : "798721e5-8e19-42f1-8155-4a4391f86043", + "metadata" : { + "title" : "Valid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "components" : [ { + "uuid" : "cc215481-bfb2-4537-b5b0-f46914656975", + "type" : "software", + "title" : "Example Component 1", + "description" : "This description is an explanation of the example component.", + "control-implementations" : [ { + "uuid" : "84964fa9-4e81-4193-8949-20257f5699e7", + "source" : "#dce50e70-62c6-423a-bee2-7dceafeadd0e", + "description" : "This description is an explanation of how the component generally supports control implementations for controls from a source catalog.", + "implemented-requirements" : [ { + "uuid" : "975b0e00-b5e2-482e-bff1-8f97e8027573", + "control-id" : "control-1", + "description" : "This description is an explanation of how this component supports the control implementation specifically for Example Catalog Control 1." + } ] + } ] + } ], + "back-matter" : { + "resources" : [ { + "uuid" : "dce50e70-62c6-423a-bee2-7dceafeadd0e", + "rlinks" : [ { + "href" : "example_ap_valid.xml" + }, { + "href" : "example_ap_valid.json" + }, { + "href" : "example_ap_valid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_component-definition_valid.xml b/src/test/resources/cli/example_component-definition_valid.xml new file mode 100644 index 0000000..1df9f5d --- /dev/null +++ b/src/test/resources/cli/example_component-definition_valid.xml @@ -0,0 +1,42 @@ + + + + + Valid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + Example Component 1 + +

This description is an explanation of the example component.

+
+ + +

This description is an explanation of how the component generally supports control implementations for controls from a source catalog.

+
+ + +

This description is an explanation of how this component supports the control implementation specifically for Example Catalog Control 1.

+
+
+
+
+ + + + + + + +
diff --git a/src/test/resources/cli/example_component-definition_valid.yml b/src/test/resources/cli/example_component-definition_valid.yml new file mode 100644 index 0000000..ee7d379 --- /dev/null +++ b/src/test/resources/cli/example_component-definition_valid.yml @@ -0,0 +1,39 @@ +--- +component-definition: + uuid: 798721e5-8e19-42f1-8155-4a4391f86043 + metadata: + title: Valid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + components: + - uuid: cc215481-bfb2-4537-b5b0-f46914656975 + type: software + title: Example Component 1 + description: This description is an explanation of the example component. + control-implementations: + - uuid: 84964fa9-4e81-4193-8949-20257f5699e7 + source: '#dce50e70-62c6-423a-bee2-7dceafeadd0e' + description: This description is an explanation of how the component generally supports control implementations for controls from a source catalog. + implemented-requirements: + - uuid: 975b0e00-b5e2-482e-bff1-8f97e8027573 + control-id: control-1 + description: This description is an explanation of how this component supports the control implementation specifically for Example Catalog Control 1. + back-matter: + resources: + - uuid: dce50e70-62c6-423a-bee2-7dceafeadd0e + rlinks: + - href: example_ap_valid.xml + - href: example_ap_valid.json + - href: example_ap_valid.yaml diff --git a/src/test/resources/cli/example_poam_invalid.json b/src/test/resources/cli/example_poam_invalid.json new file mode 100644 index 0000000..e96be8c --- /dev/null +++ b/src/test/resources/cli/example_poam_invalid.json @@ -0,0 +1,39 @@ +{ + "plan-of-action-and-milestones" : { + "uuid" : "5405cf0f-87a2-4bfb-a334-57a8d62bf945", + "metadata" : { + "title" : "Invalid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-ssp" : { + "href" : "#20b9606d-08bd-42d2-b684-3c8e57ab5c44" + }, + "back-matter" : { + "resources" : [ { + "uuid" : "20b9606d-08bd-42d2-b684-3c8e57ab5c44", + "rlinks" : [ { + "href" : "example_ssp_invalid.xml" + }, { + "href" : "example_ssp_invalid.json" + }, { + "href" : "example_ssp_invalid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_poam_invalid.xml b/src/test/resources/cli/example_poam_invalid.xml new file mode 100644 index 0000000..13e477d --- /dev/null +++ b/src/test/resources/cli/example_poam_invalid.xml @@ -0,0 +1,27 @@ + + + + + Invalid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + + + + + + + diff --git a/src/test/resources/cli/example_poam_invalid.yml b/src/test/resources/cli/example_poam_invalid.yml new file mode 100644 index 0000000..824a3b5 --- /dev/null +++ b/src/test/resources/cli/example_poam_invalid.yml @@ -0,0 +1,28 @@ +--- +plan-of-action-and-milestones: + uuid: 5405cf0f-87a2-4bfb-a334-57a8d62bf945 + metadata: + title: Invalid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-ssp: + href: '#20b9606d-08bd-42d2-b684-3c8e57ab5c44' + back-matter: + resources: + - uuid: 20b9606d-08bd-42d2-b684-3c8e57ab5c44 + rlinks: + - href: example_ssp_invalid.xml + - href: example_ssp_invalid.json + - href: example_ssp_invalid.yaml diff --git a/src/test/resources/cli/example_poam_valid.json b/src/test/resources/cli/example_poam_valid.json new file mode 100644 index 0000000..6fc4940 --- /dev/null +++ b/src/test/resources/cli/example_poam_valid.json @@ -0,0 +1,44 @@ +{ + "plan-of-action-and-milestones" : { + "uuid" : "51657392-cc1f-4e77-977c-91528f690be2", + "metadata" : { + "title" : "Valid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-ssp" : { + "href" : "#788cfb28-cca0-45dc-8f3e-65fe0345ea6a" + }, + "poam-items" : [ { + "uuid" : "c8d39ca5-7563-45d8-b90b-969f8c38bb48", + "title" : "Example PO\\&M Entry 1", + "description" : "This description is an explanation of the action or milestone planned to remediate an issue for the system documented in the example SSP." + } ], + "back-matter" : { + "resources" : [ { + "uuid" : "e3249cf0-1115-41db-8660-760b9cf89d9e", + "rlinks" : [ { + "href" : "example_ssp_valid.xml" + }, { + "href" : "example_ssp_valid.json" + }, { + "href" : "example_ssp_valid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_poam_valid.xml b/src/test/resources/cli/example_poam_valid.xml new file mode 100644 index 0000000..9421df1 --- /dev/null +++ b/src/test/resources/cli/example_poam_valid.xml @@ -0,0 +1,33 @@ + + + + + Valid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + Example PO&M Entry 1 + +

This description is an explanation of the action or milestone planned to remediate an issue for the system documented in the example SSP.

+
+
+ + + + + + + +
diff --git a/src/test/resources/cli/example_poam_valid.yml b/src/test/resources/cli/example_poam_valid.yml new file mode 100644 index 0000000..b66e7c7 --- /dev/null +++ b/src/test/resources/cli/example_poam_valid.yml @@ -0,0 +1,32 @@ +--- +plan-of-action-and-milestones: + uuid: 51657392-cc1f-4e77-977c-91528f690be2 + metadata: + title: Valid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-ssp: + href: '#788cfb28-cca0-45dc-8f3e-65fe0345ea6a' + poam-items: + - uuid: c8d39ca5-7563-45d8-b90b-969f8c38bb48 + title: Example PO\&M Entry 1 + description: This description is an explanation of the action or milestone planned to remediate an issue for the system documented in the example SSP. + back-matter: + resources: + - uuid: e3249cf0-1115-41db-8660-760b9cf89d9e + rlinks: + - href: example_ssp_valid.xml + - href: example_ssp_valid.json + - href: example_ssp_valid.yaml diff --git a/src/test/resources/cli/example_profile_invalid.json b/src/test/resources/cli/example_profile_invalid.json new file mode 100644 index 0000000..12fa370 --- /dev/null +++ b/src/test/resources/cli/example_profile_invalid.json @@ -0,0 +1,36 @@ +{ + "plan-of-action-and-milestones" : { + "uuid" : "9bf02239-f9e1-4608-b41b-af82e6b7ff1a", + "metadata" : { + "title" : "Invalid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "back-matter" : { + "resources" : [ { + "uuid" : "c8ab7360-331b-4624-8e69-ae638c01b071", + "rlinks" : [ { + "href" : "example_catalog_invalid.xml" + }, { + "href" : "example_catalog_invalid.json" + }, { + "href" : "example_catalog_invalid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_profile_invalid.xml b/src/test/resources/cli/example_profile_invalid.xml new file mode 100644 index 0000000..ce7509f --- /dev/null +++ b/src/test/resources/cli/example_profile_invalid.xml @@ -0,0 +1,26 @@ + + + + + Invalid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + + + + + + diff --git a/src/test/resources/cli/example_profile_invalid.yml b/src/test/resources/cli/example_profile_invalid.yml new file mode 100644 index 0000000..ffa5cd9 --- /dev/null +++ b/src/test/resources/cli/example_profile_invalid.yml @@ -0,0 +1,26 @@ +--- +plan-of-action-and-milestones: + uuid: 9bf02239-f9e1-4608-b41b-af82e6b7ff1a + metadata: + title: Invalid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + back-matter: + resources: + - uuid: c8ab7360-331b-4624-8e69-ae638c01b071 + rlinks: + - href: example_catalog_invalid.xml + - href: example_catalog_invalid.json + - href: example_catalog_invalid.yaml diff --git a/src/test/resources/cli/example_profile_valid.json b/src/test/resources/cli/example_profile_valid.json new file mode 100644 index 0000000..e35d279 --- /dev/null +++ b/src/test/resources/cli/example_profile_valid.json @@ -0,0 +1,42 @@ +{ + "profile" : { + "uuid" : "531e37ca-9ab8-435f-915d-e96c7f4361d2", + "metadata" : { + "title" : "Valid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "imports" : [ { + "href" : "#fa585705-f386-4e3d-98d9-69a39fb26a0b", + "include-controls" : [ { + "with-ids" : [ "control-1" ] + } ] + } ], + "back-matter" : { + "resources" : [ { + "uuid" : "fa585705-f386-4e3d-98d9-69a39fb26a0b", + "rlinks" : [ { + "href" : "example_catalog_valid.xml" + }, { + "href" : "example_catalog_valid.json" + }, { + "href" : "example_catalog_valid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_profile_valid.xml b/src/test/resources/cli/example_profile_valid.xml new file mode 100644 index 0000000..3cb30a6 --- /dev/null +++ b/src/test/resources/cli/example_profile_valid.xml @@ -0,0 +1,31 @@ + + + + + Valid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + control-1 + + + + + + + + + + diff --git a/src/test/resources/cli/example_profile_valid.yml b/src/test/resources/cli/example_profile_valid.yml new file mode 100644 index 0000000..c27e26a --- /dev/null +++ b/src/test/resources/cli/example_profile_valid.yml @@ -0,0 +1,31 @@ +--- +profile: + uuid: 531e37ca-9ab8-435f-915d-e96c7f4361d2 + metadata: + title: Valid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + imports: + - href: '#fa585705-f386-4e3d-98d9-69a39fb26a0b' + include-controls: + - with-ids: + - control-1 + back-matter: + resources: + - uuid: fa585705-f386-4e3d-98d9-69a39fb26a0b + rlinks: + - href: example_catalog_valid.xml + - href: example_catalog_valid.json + - href: example_catalog_valid.yaml diff --git a/src/test/resources/cli/example_ssp_invalid.json b/src/test/resources/cli/example_ssp_invalid.json new file mode 100644 index 0000000..f79a386 --- /dev/null +++ b/src/test/resources/cli/example_ssp_invalid.json @@ -0,0 +1,39 @@ +{ + "system-security-plan" : { + "uuid" : "680d7607-3832-4119-b1a7-71ade3303ca8", + "metadata" : { + "title" : "Invalid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-profile" : { + "href" : "#bcd167bc-42fa-4334-88f2-aa5e44e9cf55" + }, + "back-matter" : { + "resources" : [ { + "uuid" : "bcd167bc-42fa-4334-88f2-aa5e44e9cf55", + "rlinks" : [ { + "href" : "example_profile_valid.xml" + }, { + "href" : "example_profile_valid.json" + }, { + "href" : "example_profile_valid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_ssp_invalid.xml b/src/test/resources/cli/example_ssp_invalid.xml new file mode 100644 index 0000000..b1cac95 --- /dev/null +++ b/src/test/resources/cli/example_ssp_invalid.xml @@ -0,0 +1,27 @@ + + + + + Invalid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + + + + + + + diff --git a/src/test/resources/cli/example_ssp_invalid.yml b/src/test/resources/cli/example_ssp_invalid.yml new file mode 100644 index 0000000..6e90636 --- /dev/null +++ b/src/test/resources/cli/example_ssp_invalid.yml @@ -0,0 +1,28 @@ +--- +system-security-plan: + uuid: 680d7607-3832-4119-b1a7-71ade3303ca8 + metadata: + title: Invalid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-profile: + href: '#bcd167bc-42fa-4334-88f2-aa5e44e9cf55' + back-matter: + resources: + - uuid: bcd167bc-42fa-4334-88f2-aa5e44e9cf55 + rlinks: + - href: example_profile_valid.xml + - href: example_profile_valid.json + - href: example_profile_valid.yaml diff --git a/src/test/resources/cli/example_ssp_valid.json b/src/test/resources/cli/example_ssp_valid.json new file mode 100644 index 0000000..4601da9 --- /dev/null +++ b/src/test/resources/cli/example_ssp_valid.json @@ -0,0 +1,139 @@ +{ + "system-security-plan" : { + "uuid" : "971bdd00-c808-41fb-ad3b-2aa674e54b68", + "metadata" : { + "title" : "Valid OSCAL Document", + "last-modified" : "2023-10-24T00:00:00Z", + "version" : "1.0", + "oscal-version" : "1.1.1", + "roles" : [ { + "id" : "maintainer", + "title" : "Maintainer of oscal-cli" + } ], + "parties" : [ { + "uuid" : "4ba3f2b7-e894-48d7-b940-91c68661df55", + "type" : "person", + "name" : "NIST ITL CSD Developer" + } ], + "responsible-parties" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + }, + "import-profile" : { + "href" : "#2891ef24-9089-4be5-b848-8293f6fa269b" + }, + "system-characteristics" : { + "system-ids" : [ { + "identifier-type" : "http://ietf.org/rfc/rfc4122", + "id" : "8101e04d-8305-4e73-bb95-6b59f645b143" + } ], + "system-name" : "Example System", + "description" : "This is a description of an example system.", + "security-sensitivity-level" : "moderate", + "system-information" : { + "information-types" : [ { + "uuid" : "bccfbb65-a7f3-41ac-989f-01d96eddfdc7", + "title" : "Example Information Type", + "description" : "This description is for an example information type.", + "categorizations" : [ { + "system" : "https://doi.org/10.6028/NIST.SP.800-60v2r1", + "information-type-ids" : [ "C.2.8.12" ] + } ], + "confidentiality-impact" : { + "base" : "fips-199-low" + }, + "integrity-impact" : { + "base" : "fips-199-low", + "selected" : "fips-199-moderate", + "adjustment-justification" : "Maliciously modified links are a concern" + }, + "availability-impact" : { + "base" : "fips-199-low" + } + } ] + }, + "security-impact-level" : { + "security-objective-confidentiality" : "low", + "security-objective-integrity" : "medium", + "security-objective-availability" : "low" + }, + "status" : { + "state" : "under-development" + }, + "authorization-boundary" : { + "description" : "This description is an explanation of the authorization boundary." + } + }, + "system-implementation" : { + "users" : [ { + "uuid" : "00d323d3-dc3f-4d93-900f-f13430e094d3", + "title" : "System Administrator", + "description" : "This is a description of a user type.", + "role-ids" : [ "maintainer" ], + "authorized-privileges" : [ { + "title" : "System Administrator Privilege", + "functions-performed" : [ "administration" ] + } ] + } ], + "components" : [ { + "uuid" : "551b9706-d6a4-4d25-8207-f2ccec548b89", + "type" : "this-system", + "title" : "Example System Core Component", + "description" : "This description is an explanation of the this-system component.", + "status" : { + "state" : "under-development" + }, + "responsible-roles" : [ { + "role-id" : "maintainer", + "party-uuids" : [ "4ba3f2b7-e894-48d7-b940-91c68661df55" ] + } ] + } ], + "inventory-items" : [ { + "uuid" : "cd39f700-23ab-4574-a17e-c9c8f073cbec", + "description" : "This description is an explanation of the inventory.", + "props" : [ { + "name" : "asset-id", + "value" : "instance-abcd1234" + }, { + "name" : "ipv4-address", + "value" : "172.1.2.3" + } ], + "implemented-components" : [ { + "component-uuid" : "551b9706-d6a4-4d25-8207-f2ccec548b89", + "props" : [ { + "name" : "asset-id", + "value" : "EXAMPLE-SYSTEM-123" + } ] + } ] + } ] + }, + "control-implementation" : { + "description" : "This description is an explanation of the system's control implementation.", + "implemented-requirements" : [ { + "uuid" : "d5f9b263-965d-440b-99e7-77f5df670a11", + "control-id" : "control-1", + "by-components" : [ { + "component-uuid" : "551b9706-d6a4-4d25-8207-f2ccec548b89", + "uuid" : "a4c2d318-26a9-49df-9818-ee0acaf066f2", + "description" : "This description is an explanation of the component that implements this requirement.", + "implementation-status" : { + "state" : "not-implemented" + } + } ] + } ] + }, + "back-matter" : { + "resources" : [ { + "uuid" : "2891ef24-9089-4be5-b848-8293f6fa269b", + "rlinks" : [ { + "href" : "example_profile_valid.xml" + }, { + "href" : "example_profile_valid.json" + }, { + "href" : "example_profile_valid.yaml" + } ] + } ] + } + } +} \ No newline at end of file diff --git a/src/test/resources/cli/example_ssp_valid.xml b/src/test/resources/cli/example_ssp_valid.xml new file mode 100644 index 0000000..6e71c3c --- /dev/null +++ b/src/test/resources/cli/example_ssp_valid.xml @@ -0,0 +1,116 @@ + + + + + Valid OSCAL Document + 2023-10-24T00:00:00.000000-00:00 + 1.0 + 1.1.1 + + Maintainer of oscal-cli + + + NIST ITL CSD Developer + + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + + + + + 8101e04d-8305-4e73-bb95-6b59f645b143 + Example System + +

This is a description of an example system.

+
+ moderate + + + Example Information Type + +

This description is for an example information type.

+
+ + C.2.8.12 + + + fips-199-low + + + fips-199-low + fips-199-moderate + +

Maliciously modified links are a concern

+
+
+ + fips-199-low + +
+
+ + low + medium + low + + + + +

This description is an explanation of the authorization boundary.

+
+
+
+ + + System Administrator + +

This is a description of a user type.

+
+ maintainer + + System Administrator Privilege + administration + +
+ + Example System Core Component + +

This description is an explanation of the this-system component.

+
+ + + 4ba3f2b7-e894-48d7-b940-91c68661df55 + +
+ + +

This description is an explanation of the inventory.

+
+ + + + + +
+
+ + +

This description is an explanation of the system's control implementation.

+
+ + + +

This description is an explanation of the component that implements this requirement.

+
+ +
+
+
+ + + + + + + +
diff --git a/src/test/resources/cli/example_ssp_valid.yml b/src/test/resources/cli/example_ssp_valid.yml new file mode 100644 index 0000000..096b926 --- /dev/null +++ b/src/test/resources/cli/example_ssp_valid.yml @@ -0,0 +1,106 @@ +--- +system-security-plan: + uuid: 971bdd00-c808-41fb-ad3b-2aa674e54b68 + metadata: + title: Valid OSCAL Document + last-modified: 2023-10-24T00:00:00Z + version: "1.0" + oscal-version: 1.1.1 + roles: + - id: maintainer + title: Maintainer of oscal-cli + parties: + - uuid: 4ba3f2b7-e894-48d7-b940-91c68661df55 + type: person + name: NIST ITL CSD Developer + responsible-parties: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + import-profile: + href: '#2891ef24-9089-4be5-b848-8293f6fa269b' + system-characteristics: + system-ids: + - identifier-type: http://ietf.org/rfc/rfc4122 + id: 8101e04d-8305-4e73-bb95-6b59f645b143 + system-name: Example System + description: This is a description of an example system. + security-sensitivity-level: moderate + system-information: + information-types: + - uuid: bccfbb65-a7f3-41ac-989f-01d96eddfdc7 + title: Example Information Type + description: This description is for an example information type. + categorizations: + - system: https://doi.org/10.6028/NIST.SP.800-60v2r1 + information-type-ids: + - C.2.8.12 + confidentiality-impact: + base: fips-199-low + integrity-impact: + base: fips-199-low + selected: fips-199-moderate + adjustment-justification: Maliciously modified links are a concern + availability-impact: + base: fips-199-low + security-impact-level: + security-objective-confidentiality: low + security-objective-integrity: medium + security-objective-availability: low + status: + state: under-development + authorization-boundary: + description: This description is an explanation of the authorization boundary. + system-implementation: + users: + - uuid: 00d323d3-dc3f-4d93-900f-f13430e094d3 + title: System Administrator + description: This is a description of a user type. + role-ids: + - maintainer + authorized-privileges: + - title: System Administrator Privilege + functions-performed: + - administration + components: + - uuid: 551b9706-d6a4-4d25-8207-f2ccec548b89 + type: this-system + title: Example System Core Component + description: This description is an explanation of the this-system component. + status: + state: under-development + responsible-roles: + - role-id: maintainer + party-uuids: + - 4ba3f2b7-e894-48d7-b940-91c68661df55 + inventory-items: + - uuid: cd39f700-23ab-4574-a17e-c9c8f073cbec + description: This description is an explanation of the inventory. + props: + - name: asset-id + value: instance-abcd1234 + - name: ipv4-address + value: 172.1.2.3 + implemented-components: + - component-uuid: 551b9706-d6a4-4d25-8207-f2ccec548b89 + props: + - name: asset-id + value: EXAMPLE-SYSTEM-123 + control-implementation: + description: This description is an explanation of the system's control implementation. + implemented-requirements: + - uuid: d5f9b263-965d-440b-99e7-77f5df670a11 + control-id: control-1 + by-components: + - component-uuid: 551b9706-d6a4-4d25-8207-f2ccec548b89 + uuid: a4c2d318-26a9-49df-9818-ee0acaf066f2 + description: This description is an explanation of the component that implements this requirement. + implementation-status: + state: not-implemented + back-matter: + resources: + - uuid: 2891ef24-9089-4be5-b848-8293f6fa269b + rlinks: + - href: example_profile_valid.xml + - href: example_profile_valid.json + - href: example_profile_valid.yaml