{"action":"opened","issue":{"url":"https://api.github.com/repos/freebsd/pkg/issues/1305","labels_url":"https://api.github.com/repos/freebsd/pkg/issues/1305/labels{/name}","comments_url":"https://api.github.com/repos/freebsd/pkg/issues/1305/comments","events_url":"https://api.github.com/repos/freebsd/pkg/issues/1305/events","html_url":"https://github.com/freebsd/pkg/issues/1305","id":101179851,"number":1305,"title":"--raw/--raw-format=* for pkg-audit","user":{"login":"0xf10e","id":6215293,"avatar_url":"https://avatars.githubusercontent.com/u/6215293?v=3","gravatar_id":"","url":"https://api.github.com/users/0xf10e","html_url":"https://github.com/0xf10e","followers_url":"https://api.github.com/users/0xf10e/followers","following_url":"https://api.github.com/users/0xf10e/following{/other_user}","gists_url":"https://api.github.com/users/0xf10e/gists{/gist_id}","starred_url":"https://api.github.com/users/0xf10e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xf10e/subscriptions","organizations_url":"https://api.github.com/users/0xf10e/orgs","repos_url":"https://api.github.com/users/0xf10e/repos","events_url":"https://api.github.com/users/0xf10e/events{/privacy}","received_events_url":"https://api.github.com/users/0xf10e/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-15T14:09:40Z","updated_at":"2015-08-15T14:09:40Z","closed_at":null,"body":"`pkg audit` would be easier to integrate in monitoring (like Nagios, see #1156) and configuration management system with a `--raw` option.\r\nA structure turned into something like the following shouldn't be too hard to implement using libucl (for someone fluent in C that is...):\r\n```json\r\n\"count\": 2;\r\n\"pkgs\": [\r\n    \"pcre\" {\r\n        \"version\": \"8.37_2\",\r\n        \"description\": \"pcre -- heap overflow vulnerability in '(?|' situations\",\r\n        \"href\": \"https://vuxml.FreeBSD.org/freebsd/ff0acfb4-3efa-11e5-93ad-002590263bf5.html\",\r\n        \"dependent\":  [\r\n            \"nmap\"\r\n        ]\r\n    }\r\n    \"foobar\" {\r\n        \"version\": \"2.0\",\r\n        \"description\": \"doing a thing causes foobar to spill secrets\",\r\n        \"href\": \"https://vuxml.FreeBSD.org/freebsd/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.html\",\r\n        \"dependent\": [\r\n            \"qux-server\",\r\n            \"qux-client\"\r\n        ]\r\n    }\r\n]\r\n```\r\nOr maybe like this:\r\n```libucl\r\npkg_count = 3\r\n\r\nvuln {\r\n    pkg = libzmq4;\r\n    version = 4.0.5;\r\n    description = \"V3 protocol handler vulnerable to downgrade attacks\";\r\n    CVE = CVE-2014-9721\r\n    WWW: \"http://vuxml.FreeBSD.org/freebsd/10a6d0aa-0b1c-11e5-bb90-002590263bf5.html\"\r\n}\r\nvuln {\r\n    pkg = pcre;\r\n    version = 8.35_2;\r\n    description = \"heap overflow vulnerability in '(?|' situations\";\r\n    WWW: \"http://vuxml.FreeBSD.org/freebsd/ff0acfb4-3efa-11e5-93ad-002590263bf5.html\"\r\nvuln { \r\n    pkg: pcre;\r\n    version: 8.35_2;\r\n    description: \"multiple vulnerabilities\";\r\n    CVE: CVE-2015-3217\r\n    CVE: CVE-2015-3210\r\n    WWW: \"http://vuxml.FreeBSD.org/freebsd/e69af246-0ae2-11e5-90e4-d050996490d0.html\"\r\n}\r\nvuln {\r\n    pkg: pcre\r\n    version: 8.35_2\r\n    description: \"multiple vulnerabilities\"\r\n    CVE: CVE-2015-2326\r\n    CVE: CVE-2015-2325\r\n    WWW: \"http://vuxml.FreeBSD.org/freebsd/4a88e3ed-00d3-11e5-a072-d050996490d0.html\"\r\n}\r\nvuln {\r\n    pkg: pcre\r\n    version: 8.35_2\r\n    description: \"Heap Overflow Vulnerability in find_fixedlength()\"\r\n    CVE: CVE-2015-5073\r\n    WWW: http://vuxml.FreeBSD.org/freebsd/8a1d0e63-1e07-11e5-b43d-002590263bf5.html\r\n}\r\nvuln {\r\n    pkg: py27-salt\r\n    version: 2014.7.2\r\n    description: \"potential shell injection vulnerabilities\"\r\n    WWW: http://vuxml.FreeBSD.org/freebsd/865863af-fb5e-11e4-8fda-002590263bf5.html\r\n}\r\n```\r\n\r\nLists of dictionaries (mappings?) are rather ugly in YAML but it should be possible to come up with a structure that's usable in all of the supported `--raw-format`s."}}