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

Add report subcommand, change scan options. #239 #270

Merged
merged 1 commit into from
Jan 10, 2017

Conversation

kotakanbe
Copy link
Member

@kotakanbe kotakanbe commented Nov 17, 2016

Version 0.2.0
#239
I add report subcommand.

The objectives are as follows

  • Reduce scanning time
  • To be able to report multiple times
    (Until now, Vuls was doing both scanning and reporting at the same time, so it was not possible to do reports only)
  • In order to make Vuls' agentization easier

The change of the command line option is as follows

Scan Subcommand

The Scan subcommand connects to the scan target server by SSH and obtains the list of CVE-IDs included in the un-updated packages.
Detailed vulnerability information is acquired by the report subcommand.

./vuls scan -h
scan:
        scan
                [-config=/path/to/config.toml]
                [-results-dir=/path/to/results]
                [-cachedb-path=/path/to/cache.db]
                [-ssh-external]
                [-containers-only]
                [-skip-broken]
                [-http-proxy=http://192.168.0.1:8080]
                [-ask-key-password]
                [-debug]

                [SERVER]...
  -ask-key-password
        Ask ssh privatekey password before scanning
  -cachedb-path string
        /path/to/cache.db (local cache of changelog for Ubuntu/Debian)
  -config string
        /path/to/toml
  -containers-only
        Scan containers only. Default: Scan both of hosts and containers
  -debug
        debug mode
  -http-proxy string
        http://proxy-url:port (default: empty)
  -results-dir string
        /path/to/results
  -skip-broken
        [For CentOS] yum update changelog with --skip-broken option
  -ssh-external
        Use external ssh command. Default: Use the Go native implementation
  • The output of scan subcommand
Scan Summary
============
u16     ubuntu16.04     71 CVEs 103 updatable packages
cent6   centos6.7       87 CVEs 85 updatable packages

Report Subcommand

The Report subcommand obtains detailed vulnerability information from the list of CVE-IDs collected by the Scan subcommand, formats it, and reports it.

./vuls report -h
report:
        report
                [-lang=en|ja]
                [-config=/path/to/config.toml]
                [-results-dir=/path/to/results]
                [-refresh-cve]
                [-cvedb-type=sqlite3|mysql]
                [-cvedb-path=/path/to/cve.sqlite3]
                [-cvedb-url=http://127.0.0.1:1323 or mysql connection string]
                [-cvss-over=7]
                [-ignore-unscored-cves]
                [-to-email]
                [-to-slack]
                [-to-localfile]
                [-to-s3]
                [-to-azure-blob]
                [-format-json]
                [-format-xml]
                [-format-one-line-text]
                [-format-short-text]
                [-format-full-text]
                [-gzip]
                [-aws-profile=default]
                [-aws-region=us-west-2]
                [-aws-s3-bucket=bucket_name]
                [-azure-account=accout]
                [-azure-key=key]
                [-azure-container=container]
                [-http-proxy=http://192.168.0.1:8080]
                [-debug]
                [-debug-sql]

                [SERVER]...
  -aws-profile string
        AWS profile to use (default "default")
  -aws-region string
        AWS region to use (default "us-east-1")
  -aws-s3-bucket string
        S3 bucket name
  -azure-account string
        Azure account name to use. AZURE_STORAGE_ACCOUNT environment variable is used if not specified
  -azure-container string
        Azure storage container name
  -azure-key string
        Azure account key to use. AZURE_STORAGE_ACCESS_KEY environment variable is used if not specified
  -config string
        /path/to/toml 
  -cvedb-path string
        /path/to/sqlite3 (For get cve detail from cve.sqlite3) 
  -cvedb-type string
        DB type for fetching CVE dictionary (sqlite3 or mysql) (default "sqlite3")
  -cvedb-url string
        http://cve-dictionary.com:8080 or mysql connection string
  -cvss-over float
        -cvss-over=6.5 means reporting CVSS Score 6.5 and over (default: 0 (means report all))
  -debug
        debug mode
  -debug-sql
        SQL debug mode
  -format-full-text
        Detail report in plain text
  -format-json
        JSON format
  -format-one-line-text
        One line summary in plain text
  -format-short-text
        Summary in plain text
  -format-xml
        XML format
  -gzip
        gzip compression
  -http-proxy string
        http://proxy-url:port (default: empty)
  -ignore-unscored-cves
        Don't report the unscored CVEs
  -lang string
        [en|ja] (default "en")
  -refresh-cve
        Refresh CVE information in JSON file under results dir
  -results-dir string
        /path/to/results 
  -to-azure-blob
        Write report to Azure Storage blob (container/yyyyMMdd_HHmm/servername.json/xml/txt)
  -to-email
        Send report via Email
  -to-localfile
        Write report to localfile
  -to-s3
        Write report to S3 (bucket/yyyyMMdd_HHmm/servername.json/xml/txt)
  -to-slack
        Send report via Slack
  • format-one-line-text
$ ./vuls report -format-one-line-text -config=$PWD/config.toml
...
One Line Summary
================
cent6   Total: 86 (High:20 Medium:55 Low:5 ?:6)         85 updatable packages
u16     Total: 98 (High:20 Medium:54 Low:7 ?:17)        103 updatable packages
  • -format-short-text
$  ./vuls report -format-short-text -config=$PWD/config.toml

cent6 (centos6.7)
=================
Total: 86 (High:20 Medium:55 Low:5 ?:6) 85 updatable packages


CVE-2016-0705   10.0 (High)     Double free vulnerability in the dsa_priv_decode function in
                                crypto/dsa/dsa_ameth.c in OpenSSL 1.0.1 before 1.0.1s and 1.0.2 before 1.0.2g
                                allows remote attackers to cause a denial of service (memory corruption) or
                                possibly have unspecified other impact via a malformed DSA private key.
                                http://www.cvedetails.com/cve/CVE-2016-0705
                                https://access.redhat.com/security/cve/CVE-2016-0705
                                openssl-1.0.1e-42.el6 -> openssl-1.0.1e-48.el6_8.3

... snip ...
  • -format-full-text
$ ./vuls report -format-full-text -config=$PWD/config.toml
cent6 (centos6.7)
=================
Total: 86 (High:20 Medium:55 Low:5 ?:6) 85 updatable packages

CVE-2016-0705
-------------
Score           10.0 (High)
Vector          (AV:N/AC:L/Au:N/C:C/I:C/A:C)
Summary         Double free vulnerability in the dsa_priv_decode function in
                crypto/dsa/dsa_ameth.c in OpenSSL 1.0.1 before 1.0.1s and 1.0.2 before 1.0.2g
                allows remote attackers to cause a denial of service (memory corruption) or
                possibly have unspecified other impact via a malformed DSA private key.
CWE             https://cwe.mitre.org/data/definitions/.html
NVD             https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-0705
MITRE           https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0705
CVE Details     http://www.cvedetails.com/cve/CVE-2016-0705
CVSS Claculator https://nvd.nist.gov/cvss/v2-calculator?name=CVE-2016-0705&vector=(AV:N/AC:L/...
RHEL-CVE        https://access.redhat.com/security/cve/CVE-2016-0705
Package         openssl-1.0.1e-42.el6 -> openssl-1.0.1e-48.el6_8.3

... snip ...

@kotakanbe kotakanbe force-pushed the report-subcommand branch 3 times, most recently from 08ee9fa to 8a8a554 Compare November 29, 2016 14:38
@kotakanbe kotakanbe force-pushed the report-subcommand branch 4 times, most recently from c4ab23d to 6ec2463 Compare January 2, 2017 00:17
@kotakanbe kotakanbe changed the title [WIP]Add report subcommand, change scan options. #239 Add report subcommand, change scan options. #239 Jan 5, 2017
@kotakanbe kotakanbe force-pushed the report-subcommand branch 6 times, most recently from 46c1281 to 203c54c Compare January 5, 2017 03:29
@kotakanbe kotakanbe merged commit 082b10a into master Jan 10, 2017
@kotakanbe kotakanbe deleted the report-subcommand branch January 10, 2017 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant