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

Improve tests for Assessment Results #25

Open
gusfcarvalho opened this issue Aug 28, 2023 · 0 comments
Open

Improve tests for Assessment Results #25

gusfcarvalho opened this issue Aug 28, 2023 · 0 comments
Labels
models This means the issue is related to our models (reflecting OSCAL or not) test Increase test coverage of a given method, file or feature

Comments

@gusfcarvalho
Copy link
Contributor

Currently, AssessmentResults tests does not include identified-risks on the payload. We should add it to the test defintion and make sure tests still pass

identified-risks should be added within the results block:

"results": [
{
"assessment-log": {
"entries": [
{
"description": "foo",
"end": "2022-02-03T00:00:00Z",
"start": "2021-02-03T00:00:00Z",
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"logged-by": [
{
"party-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"role-id": "_"
}
],
"related-tasks": [
{
"task-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"identified-subject": {
"subject-placeholder-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"subjects": [
{
"description": "foo",
"exclude-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"include-all": {},
"include-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"type": "tool"
}
]
},
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"responsible-parties": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"party-uuids": [
"9f368125-41c7-4e40-8ee3-bf2815822369"
],
"remarks": "foo",
"role-id": "_"
}
],
"subjects": [
{
"description": "foo",
"exclude-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"include-all": {},
"include-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"type": "tool"
}
]
}
],
"remarks": "foo",
"title": "foo",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
]
},
"attestations": [
{
"parts": [
{
"class": "foo",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"prose": "verb",
"title": "verb",
"name": "my-name",
"ns": "https://foo.bar"
}
],
"responsible-parties": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"party-uuids": [
"9f368125-41c7-4e40-8ee3-bf2815822369"
],
"remarks": "foo",
"role-id": "_"
}
]
}
],
"description": "foo",
"end": "2022-02-03T00:00:00Z",
"start": "2021-02-03T00:00:00Z",
"findings": [
{
"description": "foo",
"implementation-statement-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"origins": [
{
"actors": [
{
"actor-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"role-id": "_",
"type": "tool"
}
],
"related-tasks": [
{
"identified-subject": {
"subject-placeholder-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"subjects": [
{
"description": "foo",
"exclude-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"include-all": {},
"include-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"type": "tool"
}
]
},
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"responsible-parties": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"party-uuids": [
"9f368125-41c7-4e40-8ee3-bf2815822369"
],
"remarks": "foo",
"role-id": "_"
}
],
"subjects": [
{
"description": "foo",
"exclude-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"include-all": {},
"include-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"type": "tool"
}
],
"task-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
]
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"related-observations": [
{
"observation-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
],
"related-risks": [
{
"risk-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
],
"target": {
"type": "objective-id",
"target-id": "_",
"status": {
"state": "satisfied"
},
"remarks": "foo"
},
"title": "foo",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"local-definitions": {
"components": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"description": "foo",
"protocols": [
{
"name": "one",
"port-ranges": [
{
"end": 123,
"start": 1,
"transport": "TCP"
}
],
"title": "foo",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
],
"purpose": "foo",
"remarks": "foo",
"responsible-roles": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"party-uuids": [
"9f368125-41c7-4e40-8ee3-bf2815822369"
],
"remarks": "foo",
"role-id": "_"
}
],
"status": {
"remarks": "foo",
"state": "operational"
},
"title": "foo",
"type": "foo",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
],
"inventory-items": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"description": "foo",
"remarks": "foo",
"implemented-components": [
{
"component-uuid" : "9f368125-41c7-4e40-8ee3-bf2815822369",
"responsible-parties": [
{
"role-id": "_",
"party-uuids": [
"9f368125-41c7-4e40-8ee3-bf2815822369"
],
"remarks": "foo"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo"
}
],
"responsible-parties": [
{
"role-id": "_",
"party-uuids": [
"9f368125-41c7-4e40-8ee3-bf2815822369"
],
"remarks": "foo"
}
],
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
],
"users": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"description": "foo",
"remarks": "foo",
"title": "foo",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"role-ids": [
"foo"
],
"short-name": "foo",
"authorized-privileges": [
{
"description": "foo",
"functions-performed": [
"bar"
],
"title": "me"
}
]
}
]
},
"observations": [
{
"collected": "2022-02-03T00:00:00Z",
"description": "foo",
"expires": "2022-02-05T00:00:00Z",
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"methods": [
"foo"
],
"origins": [
{
"actors": [
{
"actor-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"role-id": "_",
"type": "tool"
}
],
"related-tasks": [
{
"identified-subject": {
"subject-placeholder-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"subjects": [
{
"description": "foo",
"exclude-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"include-all": {},
"include-subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"type": "tool"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"type": "tool"
}
]
},
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"responsible-parties": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"party-uuids": [
"9f368125-41c7-4e40-8ee3-bf2815822369"
],
"remarks": "foo",
"role-id": "_"
}
],
"task-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
]
}
],
"relevant-evidence": [
{
"description": "foo",
"href": "foo",
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo"
}
],
"remarks": "foo",
"subjects": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"subject-uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"title": "foo",
"type": "tool"
}
],
"title": "foo",
"types": [
"foo"
],
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
],
"remarks": "foo",
"reviewed-controls": {
"control-objective-selections": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"description": "foo",
"include-all": {},
"include-objectives": [
{
"objective-id": "foo"
}
],
"exclude-objectives": [
{
"objective-id": "foo"
}
],
"remarks": "foo"
}
],
"control-selections": [
{
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"description": "foo",
"include-all": {},
"include-controls": [
{
"control-id": "_",
"statement-ids": [
"bar"
]
}
],
"exclude-controls": [
{
"control-id": "_",
"statement-ids": [
"bar"
]
}
],
"remarks": "foo"
}
],
"links": [
{
"href": "12345",
"media-type": "jpg",
"rel": "foo",
"resource-fragment": "yes",
"text": "string"
}
],
"props": [
{
"class": "one",
"group": "two",
"name": "three",
"ns": "https://foo.bar",
"remarks": "five",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1",
"value": "seven"
}
],
"remarks": "foo",
"description": "foo"
},
"title": "foo",
"uuid": "54a42462-98ec-404f-887c-43deec5ee2b1"
}
]

@gusfcarvalho gusfcarvalho added models This means the issue is related to our models (reflecting OSCAL or not) test Increase test coverage of a given method, file or feature labels Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models This means the issue is related to our models (reflecting OSCAL or not) test Increase test coverage of a given method, file or feature
Projects
None yet
Development

No branches or pull requests

1 participant