Feature Request: --json to format output as JSON to stdout for easier use with ansible
See original GitHub issueIt would be very handy for automation if the output could be formatted as a json document by adding “–json” to the command.
Perhaps something like:
[
{
"id" : "Scanner"
"version": "1.6.3"
"scan_path":"/path/to/start"
"files": {
"cve1": [ "pathtojar","pathtojar2"... ]
"cve2": [ "pathtootherjar", ... ]
"permissions": [ "pathtounreadable", "pathtounreadable2" ... ]
}
"scanned_count": 2000
"vuln_count": 3
"perm_count": 10
"mitigated_count": 5
"exitcode": 1
}
]
(apologies for any syntax errors, this is an ad-hoc example.)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Parse JSON using Ansible json_query - Middleware Inventory
Ansible json_query is an on-demand feature that every ansible user wants to explore. In this post we are going to how Ansible JSON...
Read more >Using filters to manipulate data - Ansible Documentation
Filters let you transform JSON data into YAML data, split a URL to extract the hostname, get the SHA1 hash of a string,...
Read more >5 ways to process JSON data in Ansible - Opensource.com
5 ways to process JSON data in Ansible ; Go down the JSON file 2 levels hosts: localhost vars: input · "{{ lookup('file','output.json')...
Read more >Ansible Filter/Parse output to json - python - Stack Overflow
Trying to parse the output from Ansible seems like a waste of time. If you want JSON output from Ansible, just write JSON...
Read more >Filter JSON Data in Ansible Using json_query | The NTC Mag
Parsing structured JSON data in Ansible playbooks is a common task. Nowadays, the JSON format is heavily used by equipment vendors to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve made a first suggestion (see PR). The output is:
{ “files”: [ { “path”: “/opt/log4j/log4j-core-2.14.0.jar”, “entry”: “”, “product”: “Log4j 2”, “hostname”: “saturn.space”, “cve”: “CVE-2021-44228”, “fixed”: false, “detectedAt”: “2021-12-19 22:44:09”, “version”: “2.14.0” } ], “metrics”: { “scanFileCount”: 54, “fixedFileCount”: 0, “lastStatusLoggingTime”: 1639950249455, “statusReporting”: false, “lastVisitDirectory”: “/opt/log4j”, “scanDirCount”: 1, “lastStatusLoggingCount”: 0, “scanStartTime”: 1639950249455, “errorCount”: 0 } }
@jlellis @strawgate Just released v2.4.0. Would you test
--report-json
option? See also https://github.com/logpresso/CVE-2021-44228-Scanner/wiki/JSON-Report-Sample