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

Json output does not follow json specified format for Reporter.PlaybookExecutionReport model. #197

Closed
RabbITCybErSeC opened this issue Aug 1, 2024 · 1 comment · Fixed by #196
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@RabbITCybErSeC
Copy link
Collaborator

RabbITCybErSeC commented Aug 1, 2024

for the /reporter api the output model such as,

[
	{
		"ExecutionId": "5143a847-4fd8-11ef-b6a0-4e4484cf4692",
		"PlaybookId": "playbook--300270f9-0e64-42c8-93cc-0927edbe3ae7",
		"Started": "2024-08-01T09:33:16.669452425+02:00",
		"Ended": "2024-08-01T09:33:16.933900524+02:00",
		"StepResults": {
			"action--eb9372d4-d524-49fc-bf24-be26ea084779": {
				"ExecutionId": "5143a847-4fd8-11ef-b6a0-4e4484cf4692",
				"StepId": "action--eb9372d4-d524-49fc-bf24-be26ea084779",
				"Started": "2024-08-01T09:33:16.669482987+02:00",
				"Ended": "2024-08-01T09:33:16.933898184+02:00",
				"CommandsB64": [
					"R0VUIGdldCBIVFRQMS4x"
				],
				"Variables": {
					"__soarca_http_api_result__": {
						"type": "string",
						"name": "__soarca_http_api_result__",
						"value": "{\n  \"args\": {}, \n  \"headers\": {\n    \"Accept-Encoding\": \"gzip\", \n    \"Host\": \"httpbin.org\", \n    \"User-Agent\": \"Go-http-client/1.1\", \n    \"X-Amzn-Trace-Id\": \"Root=1-66ab3a3e-4cf1d4ec61a13edc639a94b1\"\n  }, \n  \"origin\": \"31.177.35.215\", \n  \"url\": \"http://httpbin.org/get\"\n}\n"
					}
				},
				"Status": 0,
				"Error": null,
				"IsAutomated": true
			}
		},
		"Error": null,
		"Status": 0
	}
]

Does not follow the json unmarshalling tags such as execution_id as specified in:

type PlaybookExecutionReport struct {
	Type            string                         `bson:"type" json:"type"`
	ExecutionId     string                         `bson:"execution_id" json:"execution_id"`
	PlaybookId      string                         `bson:"playbook_id" json:"playbook_id"`
	Started         time.Time                      `bson:"started" json:"started"`
	Ended           time.Time                      `bson:"ended" json:"ended"`
	Status          int                            `bson:"status" json:"status"`
	StatusText      string                         `bson:"status_text" json:"status_text"`
	StepResults     map[string]StepExecutionReport `bson:"step_results" json:"step_results"`
	RequestInterval int                            `bson:"request_interval" json:"request_interval"`
}

This gives issues parsing the model correctly on the GUI side as I am copying the exact model.

@RabbITCybErSeC RabbITCybErSeC added the bug Something isn't working label Aug 1, 2024
@lucamrgs
Copy link
Collaborator

lucamrgs commented Aug 1, 2024

@RabbITCybErSeC this is fixed in PR #196

@MaartendeKruijf MaartendeKruijf added the duplicate This issue or pull request already exists label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants