It returns the versions of the API and the layer processing engine.
GET /v1/versions
- The versions are integers.
- The API version number is raised each time there is an structural change.
- The Engine version is increased when the a new layer analysis could find new relevant data.
curl -s 127.0.0.1:6060/v1/versions | python -m json.tool
HTTP/1.1 200 OK
{
"APIVersion": "1",
"EngineVersion": "1"
}
GET /v1/health
Returns 200 if essential services are healthy (ie. database) and 503 otherwise.
This call is also available on the API port + 1, without any security, allowing external monitoring systems to easily access it.
curl -s 127.0.0.1:6060/v1/health | python -m json.tool
curl -s 127.0.0.1:6061/ | python -m json.tool
HTTP/1.1 200 OK
{
"database":{
"IsHealthy":true
},
"notifier":{
"IsHealthy":true,
"Details":{
"QueueSize":0
}
},
"updater":{
"IsHealthy":true,
"Details":{
"HealthIdentifier":"cf65a8f6-425c-4a9c-87fe-f59ddf75fc87",
"HealthLockOwner":"1e7fce65-ee67-4ca5-b2e9-61e9f5e0d3ed",
"LatestSuccessfulUpdate":"2015-09-30T14:47:47Z",
"ConsecutiveLocalFailures":0
}
}
}
HTTP/1.1 503 Service unavailable
{
"database":{
"IsHealthy":false
},
"notifier":{
"IsHealthy":true,
"Details":{
"QueueSize":0
}
},
"updater":{
"IsHealthy":true,
"Details":{
"HealthIdentifier":"cf65a8f6-425c-4a9c-87fe-f59ddf75fc87",
"HealthLockOwner":"1e7fce65-ee67-4ca5-b2e9-61e9f5e0d3ed",
"LatestSuccessfulUpdate":"2015-09-30T14:47:47Z",
"ConsecutiveLocalFailures":0
}
}
}
It processes and inserts a new Layer in the database.
POST /v1/layers
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Layer |
Path | String | Absolute path or HTTP link pointing to the Layer's tar file |
ParentID | String | (Optionnal) Unique ID of the Layer's parent |
If the Layer has not parent, the ParentID field should be omitted or empty.
curl -s -H "Content-Type: application/json" -X POST -d \
'{
"ID": "39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8",
"Path": "https://layers_storage/39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8.tar",
"ParentID": "df2a0347c9d081fa05ecb83669dcae5830c67b0676a6d6358218e55d8a45969c"
}' \
127.0.0.1:6060/v1/layers
If the layer has been successfully processed, the version of the engine which processed it is returned.
HTTP/1.1 201 Created
{
"Version": "1"
}
HTTP/1.1 400 Bad Request
{
"Message": "Layer 39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8's parent (df2a0347c9d081fa05ecb83669dcae5830c67b0676a6d6358218e55d8a45969c) is unknown."
}
It could also return a 415 Unsupported Media Type
response with a Message
if the request content is not valid JSON.
It returns the operating system a given Layer.
GET /v1/layers/{ID}/os
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Layer |
curl -s 127.0.0.1:6060/v1/layers/39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8/os | python -m json.tool
HTTP/1.1 200 OK
{
"OS": "debian:8",
}
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}
It returns the parent's ID of a given Layer. It returns an empty ID string when the layer has no parent.
GET /v1/layers/{ID}/parent
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Layer |
curl -s 127.0.0.1:6060/v1/layers/39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8/parent | python -m json.tool
HTTP/1.1 200 OK
{
"ID": "df2a0347c9d081fa05ecb83669dcae5830c67b0676a6d6358218e55d8a45969c",
}
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}
It returns the package list of a given Layer.
GET /v1/layers/{ID}/packages
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Layer |
curl -s 127.0.0.1:6060/v1/layers/39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8/packages | python -m json.tool
HTTP/1.1 200 OK
{
"Packages": [
{
"Name": "gcc-4.9",
"OS": "debian:8",
"Version": "4.9.2-10"
},
[...]
]
}
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}
It returns the lists of packages a given Layer installs and removes.
GET /v1/layers/{ID}/packages/diff
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Layer |
curl -s 127.0.0.1:6060/v1/layers/39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8/packages/diff | python -m json.tool
HTTP/1.1 200 OK
{
"InstalledPackages": [
{
"Name": "gcc-4.9",
"OS": "debian:8",
"Version": "4.9.2-10"
},
[...]
],
"RemovedPackages": null
}
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}
It returns the lists of vulnerabilities which affect a given Layer.
GET /v1/layers/{ID}/vulnerabilities(?minimumPriority=Low)
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Layer |
minimumPriority | Priority | (Optionnal) The minimum priority of the returned vulnerabilities. Defaults to High |
curl -s "127.0.0.1:6060/v1/layers/39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8/vulnerabilities?minimumPriority=Negligible" | python -m json.tool
HTTP/1.1 200 OK
{
"Vulnerabilities": [
{
"ID": "CVE-2014-2583",
"Link": "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2583",
"Priority": "Low",
"Description": "Multiple directory traversal vulnerabilities in pam_timestamp.c in the pam_timestamp module for Linux-PAM (aka pam) 1.1.8 allow local users to create aribitrary files or possibly bypass authentication via a .. (dot dot) in the (1) PAM_RUSER value to the get_ruser function or (2) PAM_TTY value to the check_tty funtion, which is used by the format_timestamp_name function."
},
[...]
}
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}
It returns the lists of vulnerabilities which are introduced and removed by the given Layer.
GET /v1/layers/{ID}/vulnerabilities/diff(?minimumPriority=Low)
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Layer |
minimumPriority | Priority | (Optionnal) The minimum priority of the returned vulnerabilities |
curl -s "127.0.0.1:6060/v1/layers/39bb80489af75406073b5364c9c326134015140e1f7976a370a8bd446889e6f8/vulnerabilities?minimumPriority=Negligible" | python -m json.tool
HTTP/1.1 200 OK
{
"Adds": [
{
"ID": "CVE-2014-2583",
"Link": "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2583",
"Priority": "Low",
"Description": "Multiple directory traversal vulnerabilities in pam_timestamp.c in the pam_timestamp module for Linux-PAM (aka pam) 1.1.8 allow local users to create aribitrary files or possibly bypass authentication via a .. (dot dot) in the (1) PAM_RUSER value to the get_ruser function or (2) PAM_TTY value to the check_tty funtion, which is used by the format_timestamp_name function."
},
[...]
],
"Removes": null
}
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}
It returns the lists of vulnerabilities which affect the given Layers.
POST /v1/batch/layers/vulnerabilities(?minimumPriority=Low)
Counterintuitively, this request is actually a POST to be able to pass a lot of parameters.
Name | Type | Description |
---|---|---|
LayersIDs | Array of strings | Unique IDs of Layers |
minimumPriority | Priority | (Optionnal) The minimum priority of the returned vulnerabilities. Defaults to High |
curl -s -H "Content-Type: application/json" -X POST -d \
'{
"LayersIDs": [
"a005304e4e74c1541988d3d1abb170e338c1d45daee7151f8e82f8460634d329",
"f1b10cd842498c23d206ee0cbeaa9de8d2ae09ff3c7af2723a9e337a6965d639"
]
}' \
127.0.0.1:6060/v1/batch/layers/vulnerabilities
HTTP/1.1 200 OK
{
"a005304e4e74c1541988d3d1abb170e338c1d45daee7151f8e82f8460634d329": {
"Vulnerabilities": [
{
"ID": "CVE-2014-2583",
"Link": "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2583",
"Priority": "Low",
"Description": "Multiple directory traversal vulnerabilities in pam_timestamp.c in the pam_timestamp module for Linux-PAM (aka pam) 1.1.8 allow local users to create aribitrary files or possibly bypass authentication via a .. (dot dot) in the (1) PAM_RUSER value to the get_ruser function or (2) PAM_TTY value to the check_tty funtion, which is used by the format_timestamp_name function."
},
[...]
]
},
[...]
}
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}
It returns all known informations about a Vulnerability and its fixes.
GET /v1/vulnerabilities/{ID}
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Vulnerability |
curl -s 127.0.0.1:6060/v1/vulnerabilities/CVE-2015-0235 | python -m json.tool
HTTP/1.1 200 OK
{
"ID": "CVE-2015-0235",
"Link": "https://security-tracker.debian.org/tracker/CVE-2015-0235",
"Priority": "High",
"Description": "Heap-based buffer overflow in the __nss_hostname_digits_dots function in glibc 2.2, and other 2.x versions before 2.18, allows context-dependent attackers to execute arbitrary code via vectors related to the (1) gethostbyname or (2) gethostbyname2 function, aka \"GHOST.\"",
"AffectedPackages": [
{
"Name": "eglibc",
"OS": "debian:7",
"AllVersions": false,
"BeforeVersion": "2.13-38+deb7u7"
},
{
"Name": "glibc",
"OS": "debian:8",
"AllVersions": false,
"BeforeVersion": "2.18-1"
},
{
"Name": "glibc",
"OS": "debian:9",
"AllVersions": false,
"BeforeVersion": "2.18-1"
},
{
"Name": "glibc",
"OS": "debian:unstable",
"AllVersions": false,
"BeforeVersion": "2.18-1"
},
{
"Name": "eglibc",
"OS": "debian:6",
"AllVersions": true,
"BeforeVersion": "",
}
],
}
The AffectedPackages
array represents the list of affected packages and provides the first known versions in which the Vulnerability has been fixed - each previous versions may be vulnerable. If AllVersions
is equal to true
, no fix exists, thus, all versions may be vulnerable.
HTTP/1.1 404 Not Found
{
"Message":"the resource cannot be found"
}
It manually inserts a new Vulnerability.
POST /v1/vulnerabilities
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Vulnerability |
Link | String | Link to the Vulnerability tracker |
Priority | Priority | Priority of the Vulnerability |
AffectedPackages | Array of Package | Affected packages (Name, OS) and fixed version (or all versions) |
If no fix exists for a package, AllVersions
should be set to true
.
Valid Priorities are based on Ubuntu CVE Tracker/README
- Unknown is either a security problem that has not been ssigned to a priority yet or a priority that our system did not recognize
- Negligible is technically a security problem, but is only theoretical in nature, requires a very special situation, has almost no install base, or does no real damage. These tend not to get backport from upstreams, and will likely not be included in security updates unless there is an easy fix and some other issue causes an update.
- Low is a security problem, but is hard to exploit due to environment, requires a user-assisted attack, a small install base, or does very little damage. These tend to be included in security updates only when higher priority issues require an update, or if many low priority issues have built up.
- Medium is a real security problem, and is exploitable for many people. Includes network daemon denial of service attacks, cross-site scripting, and gaining user privileges. Updates should be made soon for this priority of issue.
- High is a real problem, exploitable for many people in a default installation. Includes serious remote denial of services, local root privilege escalations, or data loss.
- Critical is a world-burning problem, exploitable for nearly all people in a default installation of Ubuntu. Includes remote root privilege escalations, or massive data loss.
- Defcon1 is a Critical problem which has been manually highlighted by the team. It requires an immediate attention.
curl -s -H "Content-Type: application/json" -X POST -d \
'{
"ID": "CVE-2015-0235",
"Link": "https:security-tracker.debian.org/tracker/CVE-2015-0235",
"Priority": "High",
"Description": "Heap-based buffer overflow in the __nss_hostname_digits_dots function in glibc 2.2, and other 2.x versions before 2.18, allows context-dependent attackers to execute arbitrary code via vectors related to the (1) gethostbyname or (2) gethostbyname2 function, aka \"GHOST.\"",
"AffectedPackages": [
{
"Name": "eglibc",
"OS": "debian:7",
"BeforeVersion": "2.13-38+deb7u7"
},
{
"Name": "glibc",
"OS": "debian:8",
"BeforeVersion": "2.18-1"
},
{
"Name": "glibc",
"OS": "debian:9",
"BeforeVersion": "2.18-1"
},
{
"Name": "glibc",
"OS": "debian:unstable",
"BeforeVersion": "2.18-1"
},
{
"Name": "eglibc",
"OS": "debian:6",
"AllVersions": true,
"BeforeVersion": ""
}
]
}' \
127.0.0.1:6060/v1/vulnerabilities
HTTP/1.1 201 Created
HTTP/1.1 400 Bad Request
{
"Message":"Could not insert a vulnerability which has an invalid priority"
}
It could also return a 415 Unsupported Media Type
response with a Message
if the request content is not valid JSON.
It updates an existing Vulnerability.
PUT /v1/vulnerabilities/{ID}
The Link, Priority and Description fields can be updated. FixedIn packages are added to the vulnerability. However, as a vulnerability can be fixed by only one package on a given branch (OS, Name): old FixedIn packages, which belong to the same branch as a new added one, will be removed.
Name | Type | Description |
---|---|---|
Link | String | Link to the Vulnerability tracker |
Priority | Priority | Priority of the Vulnerability |
FixedIn | Array of Package | Affected packages (Name, OS) and fixed version (or all versions) |
If no fix exists for a package, AllVersions
should be set to true
.
curl -s -H "Content-Type: application/json" -X PUT -d '{"Priority": "Critical" }' 127.0.0.1:6060/v1/vulnerabilities/CVE-2015-0235
HTTP/1.1 204 No content
HTTP/1.1 404 Not Found
{
"Message":"the resource cannot be found"
}
It could also return a 415 Unsupported Media Type
response with a Message
if the request content is not valid JSON.
It deletes an existing Vulnerability.
DEL /v1/vulnerabilities/{ID}
Be aware that it does not prevent fetcher's to re-create it. Therefore it is only useful to remove manually inserted vulnerabilities.
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Vulnerability |
curl -s -X DEL 127.0.0.1:6060/v1/vulnerabilities/CVE-2015-0235
HTTP/1.1 204 No content
HTTP/1.1 404 Not Found
{
"Message":"the resource cannot be found"
}
It gets all the layers (their IDs) that introduce the given vulnerability.
GET /v1/vulnerabilities/:id/introducing-layers
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Vulnerability |
curl -s -X GET 127.0.0.1:6060/v1/vulnerabilities/CVE-2015-0235/introducing-layers
HTTP/1.1 200
{
"IntroducingLayers":[
"fb9cc58bde0c0a8fe53e6fdd23898e45041783f2d7869d939d7364f5777fde6f"
]
}
HTTP/1.1 404 Not Found
{
"Message":"the resource cannot be found"
}
It returns whether the specified Layers are vulnerable to the given Vulnerability or not.
POST /v1/vulnerabilities/{ID}/affected-layers
Counterintuitively, this request is actually a POST to be able to pass a lot of parameters.
Name | Type | Description |
---|---|---|
ID | String | Unique ID of the Vulnerability |
LayersIDs | Array of strings | Unique IDs of Layers |
curl -s -H "Content-Type: application/json" -X POST -d \
'{
"LayersIDs": [
"a005304e4e74c1541988d3d1abb170e338c1d45daee7151f8e82f8460634d329",
"f1b10cd842498c23d206ee0cbeaa9de8d2ae09ff3c7af2723a9e337a6965d639"
]
}' \
127.0.0.1:6060/v1/vulnerabilities/CVE-2015-0235/affected-layers
HTTP/1.1 200 OK
{
"f1b10cd842498c23d206ee0cbeaa9de8d2ae09ff3c7af2723a9e337a6965d639": {
"Vulnerable": false
},
"fb9cc58bde0c0a8fe53e6fdd23898e45041783f2d7869d939d7364f5777fde6f": {
"Vulnerable": true
}
}
Returned when the Layer or the Vulnerability does not exist.
HTTP/1.1 404 Not Found
{
"Message": "the resource cannot be found"
}