Import a Docker image layers to Clair for security analysis
Project description
# Clair
Clair is an open source project for the static analysis of vulnerabilities in appc and docker containers (https://github.com/coreos/clair).
This Python package provides methods to analyse a local Docker image and injects image layers to a Clair server.
# Example
cfg = {
'clair.host': 'http://127.0.0.1:6060',
'docker.connect': 'tcp://127.0.0.1:2375'
}
log = logging.getLogger(__name__)
test = Clair(cfg)
layers = test.analyse('docker-registry.genouest.org/osallou/testgit')
layer_ids = []
for layer in layers:
layer_ids.append(layer['id'])
vulnerabilities = test.get_layers_vulnerabilities(layer_ids)
log.warn(str(vulnerabilities))
0.2: Fix packaging
0.1: First release
Clair is an open source project for the static analysis of vulnerabilities in appc and docker containers (https://github.com/coreos/clair).
This Python package provides methods to analyse a local Docker image and injects image layers to a Clair server.
# Example
cfg = {
'clair.host': 'http://127.0.0.1:6060',
'docker.connect': 'tcp://127.0.0.1:2375'
}
log = logging.getLogger(__name__)
test = Clair(cfg)
layers = test.analyse('docker-registry.genouest.org/osallou/testgit')
layer_ids = []
for layer in layers:
layer_ids.append(layer['id'])
vulnerabilities = test.get_layers_vulnerabilities(layer_ids)
log.warn(str(vulnerabilities))
0.2: Fix packaging
0.1: First release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
clair-0.2.tar.gz
(2.9 kB
view details)
File details
Details for the file clair-0.2.tar.gz
.
File metadata
- Download URL: clair-0.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1610ee2fb01f6e0792dc7506ec889a1138d568e99a667a3bea83735fa54e7234 |
|
MD5 | 97af08f21cefd99dd945ad4a5413c345 |
|
BLAKE2b-256 | 2b3e9de549b9da2c9b73593350a2355fc1a38117d9066cff0a1021837d22a026 |