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

feat(scan): add -wordpress-only and -libs-only flag #898

Merged
merged 1 commit into from
Sep 6, 2019

Conversation

kotakanbe
Copy link
Member

@kotakanbe kotakanbe commented Sep 5, 2019

What did you implement:

Add -libs-only flag that doesn't detect OS packages Vulns to the scan command.

https://vuls.io/docs/en/usage-scan-non-os-packages.html#options

Add -wordpress-only flag that doesn't detect OS packages Vulns to the scan command.

https://vuls.io/docs/en/usage-scan-wordpress.html#scan-wordpress-core-plugin-theme

$ ./vuls scan -h
scan:
        scan
                [-config=/path/to/config.toml]
                [-results-dir=/path/to/results]
                [-log-dir=/path/to/log]
                [-cachedb-path=/path/to/cache.db]
                [-ssh-native-insecure]
                [-ssh-config]
                [-containers-only]
                [-images-only]
                [-libs-only]
                [-skip-broken]
                [-http-proxy=http://192.168.0.1:8080]
                [-ask-key-password]
                [-timeout=300]
                [-timeout-scan=7200]
                [-debug]
                [-pipe]
                [-vvv]
                [-ips]


                [SERVER]...
  -ask-key-password
        Ask ssh privatekey password before scanning
  -cachedb-path string
        /path/to/cache.db (local cache of changelog for Ubuntu/Debian) (default "/home/ubuntu/go/src/github.com/future-architect/vuls/cache.db")
  -config string
        /path/to/toml (default "/home/ubuntu/go/src/github.com/future-architect/vuls/config.toml")
  -containers-only
        Scan running containers only. Default: Scan both of hosts and running containers
  -debug
        debug mode
  -http-proxy string
        http://proxy-url:port (default: empty)
  -images-only
        Scan container images only. Default: Scan both of hosts and images
  -ips
        retrieve IPS information
  -libs-only
        Scan libraries (lock files) specified in config.toml only.
  -log-dir string
        /path/to/log (default "/var/log/vuls")
  -pipe
        Use stdin via PIPE
  -results-dir string
        /path/to/results (default "/home/ubuntu/go/src/github.com/future-architect/vuls/results")
  -skip-broken
        [For CentOS] yum update changelog with --skip-broken option
  -ssh-config
        Use SSH options specified in ssh_config preferentially
  -ssh-native-insecure
        Use Native Go implementation of SSH. Default: Use the external command
  -timeout int
        Number of seconds for processing other than scan (default 300)
  -timeout-scan int
        Number of seconds for scanning vulnerabilities for all servers (default 7200)
  -vvv
        ssh -vvv

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

$ ./vuls scan -libs-only
$ ./vuls scan -wordpress-only

and reporting

Checklist:

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

@kotakanbe kotakanbe merged commit b7ca5e5 into master Sep 6, 2019
@kotakanbe kotakanbe deleted the add-libs-only branch September 9, 2019 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant