|
1 | 1 | [](https://travis-ci.com/joelee2012/claircli) |
2 | 2 | [](https://coveralls.io/github/joelee2012/claircli?branch=master) |
3 | 3 | # claircli |
4 | | -## claircli is a simple command line tool to interact with [CoreOS Clair](https://github.com/coreos/clair) |
5 | | -- analyze loacl/remote docker image with [clair](https://github.com/coreos/clair) |
| 4 | +## claircli is a command line tool to interact with [CoreOS Clair](https://github.com/quay/clair) |
| 5 | +- analyze loacl/remote docker image with [Clair](https://github.com/quay/clair) |
6 | 6 | - generate HTML/JSON report, the html report template is from [analysis-template.html](https://github.com/jgsqware/clairctl/blob/master/clair/templates/analysis-template.html) |
7 | 7 |
|
8 | 8 | # Installation |
9 | 9 |
|
10 | 10 | ```bash |
11 | 11 | pip install claircli |
12 | | -``` |
| 12 | +``` |
13 | 13 |
|
14 | 14 | # Commands |
15 | 15 |
|
16 | 16 | ``` |
17 | 17 | claircli -h |
18 | | -usage: claircli [-h] [-V] {batch-analyze,fuzzy-analyze} ... |
| 18 | +usage: claircli [-h] [-V] [-c CLAIR] [-w WHITE_LIST] [-T THRESHOLD] |
| 19 | + [-f {html,json}] [-L LOG_FILE] [-d] [-l LOCAL_IP | -r] |
| 20 | + images [images ...] |
| 21 | +
|
| 22 | +Command line tool to interact with CoreOS Clair, analyze docker image with |
| 23 | +clair in different ways |
19 | 24 |
|
20 | | -Simple command line tool to interact with CoreOS Clair |
| 25 | +positional arguments: |
| 26 | + images docker images or regular expression |
21 | 27 |
|
22 | 28 | optional arguments: |
23 | 29 | -h, --help show this help message and exit |
24 | 30 | -V, --version show program's version number and exit |
| 31 | + -c CLAIR, --clair CLAIR |
| 32 | + clair url, default: http://localhost:6060 |
| 33 | + -w WHITE_LIST, --white-list WHITE_LIST |
| 34 | + path to the whitelist file |
| 35 | + -T THRESHOLD, --threshold THRESHOLD |
| 36 | + cvd severity threshold, if any servity of |
| 37 | + vulnerability above of threshold, will return non- |
| 38 | + zero, default: Unknown, choices are: ['Defcon1', |
| 39 | + 'Critical', 'High', 'Medium', 'Low', 'Negligible', |
| 40 | + 'Unknown'] |
| 41 | + -f {html,json}, --formats {html,json} |
| 42 | + output report file with give format, default: ['html'] |
| 43 | + -L LOG_FILE, --log-file LOG_FILE |
| 44 | + save log to file |
| 45 | + -d, --debug print more logs |
| 46 | + -l LOCAL_IP, --local-ip LOCAL_IP |
| 47 | + ip address of local host |
| 48 | + -r, --regex if set, repository and tag of images will be treated |
| 49 | + as regular expression |
| 50 | +
|
| 51 | +Examples: |
| 52 | +
|
| 53 | + # analyze and output report to html |
| 54 | + # clair is running at http://localhost:6060 |
| 55 | + claircli example.reg.com/myimage1:latest example.reg.com/myimage2:latest |
| 56 | +
|
| 57 | + # analyze and output report to html |
| 58 | + # clair is running at https://example.clair.com:6060 |
| 59 | + claircli -c https://example.clair.com:6060 example.reg.com/myimage1:latest |
| 60 | +
|
| 61 | + # analyze and output report to html, json |
| 62 | + claircli -f html -f json example.reg.com/myimage1:latest |
| 63 | +
|
| 64 | + # analyze with threshold and white list |
| 65 | + claircli -t High -w white_list_file.yml example.reg.com/myimage1:latest |
| 66 | +
|
| 67 | + # analyze image on local host |
| 68 | + claircli -l <local ip address> myimage1:latest myimage2:latest |
| 69 | +
|
| 70 | + # analyze image on other host foo |
| 71 | + export DOCKER_HOST=tcp://<ip of foo>:<port of docker listen> |
| 72 | + claircli -l <local ip address> myimage1:latest |
| 73 | +
|
| 74 | + # analyze with regular expression, following will match |
| 75 | + # example.reg.com/myimage1:latest |
| 76 | + # and example.reg.com/myimage2:latest |
| 77 | + claircli -r example.reg.com/myimage:latest |
25 | 78 |
|
26 | | -subcommands: |
27 | | - Subcommands of claircli |
| 79 | + # analyze with regular expression, following will match |
| 80 | + # example.reg.com/myimage1:latest only |
| 81 | + claircli -r example.reg.com/^myimage1$:^latest$ |
28 | 82 |
|
29 | | - {batch-analyze,fuzzy-analyze} |
30 | | - batch-analyze Batch analyze docker images with clair |
31 | | - fuzzy-analyze Fuzzy analyze docker images with clair |
32 | 83 | ``` |
33 | 84 |
|
34 | 85 | ## Optional whitelist yaml file |
|
0 commit comments