Skip to content
Open
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions docs/dynamic_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ curl --fail $PROXY_URL/OTHER/core/other/jsonreport/?formMethod=GET --output repo
```
Than, use [jq](https://stedolan.github.io/jq/) to flatten the report so Glue can parse it:
```
jq '{ "@name" : .site."@name",
jq '{ "@name" : .site[0]."@name",
"alerts":
[.site.alerts[] as $in
[.site[] | .alerts[] as $in
| $in.instances[] as $h
| $in
| $h * $in
Expand All @@ -65,10 +65,10 @@ jq '{ "@name" : .site."@name",
"source": "URI: \($h.uri) Method: \($h.method)",
"detail": "\($in.name) \n Evidence: \($h.evidence) \n Solution: \($in.solution) \n Other info: \($in.otherinfo) \n Reference: \($in.reference)",
"severity": $in.riskdesc | split(" ") | .[0],
"fingerprint": "\($in.pluginid)_\($h.uri)_\($h.method)"
"fingerprint": "\($in.pluginid)_\($in.name)_\($h.uri)_\($h.method)"
}
]
} ' report.json > output.json
}' report.json > output.json
```
Now use Glue to process the report:
```
Expand All @@ -78,4 +78,4 @@ You can modify the jq pattern to modify the fields in Glue's results. For exampl
## Adding a new tool
First, create the mapping file.
After you have a working mapping file, open a PR and add it under `/lib/glue/mappings/`.
Also add a test to `dynamic_spec`, see mobsf tests for reference.
Also add a test to `dynamic_spec`, see mobsf tests for reference.