API でデータを取得する例#
実行前の準備(トークンの用意、jq の利用など)と、サンプルごとに必要なトークン種別・API 権限は、「API の利用例」を参照してください。
脆弱性一覧取得#
$ curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/cves' | jq
{
"paging": {
"totalPage": 8,
"offset": 0,
"page": 1,
"limit": 20,
"totalCount": 158
},
"cves": [
{
"cveID": "CVE-2016-3191",
"scoreV2s": {
"jvn": 7.5,
"nvd": 7.5
},
"scoreV3s": {
"nvd": 9.8
},
"vectorV2s":
...
...
サーバ一覧取得#
lastSyncedAt はサーバの構成情報を最後に同期した日時、lastDetectedAt は最後に検知処理をした日時です。
$ curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/servers' | jq
{
"paging": {
"totalPage": 1,
"offset": 0,
"page": 1,
"limit": 20,
"totalCount": 2
},
"servers": [
{
"id": 21384,
"serverUuid": "",
"hostUuid": "",
"serverName": "ip-192-168-0-188",
"serverIpv4": "192.168.0.188",
"platformName": "aws",
"platformInstanceId": "",
"serverroleId": 1522,
"serverroleName": "default",
"osFamily": "amazon",
"osVersion": "2017.03",
"needKernelRestart": false,
"lastSyncedAt": "2018-12-17T00:05:22.376924Z",
"lastDetectedAt": "2018-12-17T00:05:28.254655Z",
"tags": [
{
"id": 363,
"name": "tag1"
}
],
"successScanCount": 12,
"newTaskCount": 5,
"createdAt": "2018-11-22T07:16:35.665921Z",
"updatedAt": "2018-12-17T00:05:28.289345Z"
},
...
]
}
タスク一覧取得#
$ curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/tasks?filterStatus=new&filterStatus=investigating&filterStatus=ongoing&filterStatus=workaround&filterStatus=patch_applied' | jq
{
"paging": {
"totalPage": 8,
"offset": 0,
"page": 1,
"limit": 20,
"totalCount": 157
},
"tasks": [
{
"id": 1331193,
"cveID": "CVE-2014-9402",
"serverID": 21384,
"serverUuid": "",
"serverName": "ip-192-168-0-188",
"serverTags": [
"tag1"
],
"osFamily": "amazon",
"osVersion": "2017.03",
"server": {
"id": 21384,
"serverName": "ip-192-168-0-188",
"serverroleId": 1522,
"serverroleName": "default",
"osFamily": "amazon",
"osVersion": "2017.03"
},
"hasExploit": false,
"hasMitigation": false,
"pkgCpeNames": [
"glibc",
"glibc-common",
"glibc-devel",
"glibc-headers"
],
"pkgFixedStatus": "entire",
"applyingPatchOn": "1970-01-01T00:00:00Z",
"status": "new",
"priority": "none",
"ignore": false,
"detectionTools": [
{
"name": "vuls"
}
],
"advisoryIDs": [
"ALAS-2018-1017"
],
"createdAt": "2018-11-22T07:16:39.677041Z",
"updatedAt": "2018-12-17T00:05:28.289345Z"
},
...
]
}
タスク一覧 API で取得できるステータス
タスク一覧の取得 API は、デフォルトでは status=["new", "investigating", "ongoing"] のみを取得します。
すべてのステータスを取得するには、filterStatus で 9つのステータスをすべて指定する必要があります。
サーバのロールは server.serverroleId・server.serverroleName、パッチの提供状況は pkgFixedStatus(none: 未提供、some: 一部提供、entire: すべて提供、unknown: 提供状況が不明なものを含む)で確認できます。ステータスが patch_applied のタスクでは、pkgFixedStatus は返りません。
Available values : new, investigating, ongoing, defer, not_affected, risk_accepted, workaround, alt_resolved, patch_applied
タスクコメントバッチ取得#
複数のタスクに対するコメントを一度に取得できます。レートリミット対策として、個別にタスク詳細を取得するよりも効率的です。
| パラメータ | 説明 | 備考 |
|---|---|---|
| taskIDs | 取得するタスクのIDリスト | 最小1件、最大100件 |
| commentTypes | 取得するコメントのタイプ | user, api, system から選択(デフォルト: ["user", "api"]) |
$ curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/taskComments?taskIDs=1331193&taskIDs=1331194&commentTypes=user&commentTypes=api' | jq
[
{
"taskID": 1331193,
"comments": [
{
"id": 12345,
"comment": "調査中です",
"type": "user",
"userID": 1,
"userName": "user-name",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
{
"id": 12346,
"comment": "対応完了しました",
"type": "api",
"userID": 2,
"userName": "api-user",
"createdAt": "2024-01-16T14:20:00Z",
"updatedAt": "2024-01-16T14:20:00Z"
}
]
},
{
"taskID": 1331194,
"comments": [
{
"id": 12347,
"comment": "パッチ適用予定",
"type": "user",
"userID": 1,
"userName": "user-name",
"createdAt": "2024-01-17T09:00:00Z",
"updatedAt": "2024-01-17T09:00:00Z"
}
]
}
]
グループセット脆弱性情報取得#
複数の CVE に紐づく脆弱性情報(タイトル、CVSS、CWE、攻撃コードの有無など)を一度に取得できます。グループセットに所属するグループで検知されている CVE だけが返ります。
| パラメータ | 説明 | 備考 |
|---|---|---|
| cveIDs | 取得するCVE IDのリスト | 最小1件、最大100件 |
$ curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/groupSet/cveVulnInfos?cveIDs=CVE-2023-1234&cveIDs=CVE-2023-5678' | jq
[
{
"cveID": "CVE-2023-1234",
"title": "...",
"cvss": {
"cveID": "CVE-2023-1234",
"maxCvssV2": { ... },
"maxCvssV3": { ... },
"maxCvssV4": { ... },
"vulnInfo": { ... }
},
"cwes": [
{
"cweID": "CWE-79",
"english": "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')",
"japanese": "..."
}
],
"exploitLevel": "high",
"hasExploit": true,
"hasMitigation": true
},
{
"cveID": "CVE-2023-5678",
...
}
]
削除済みソフトウェア一覧取得#
バージョンアップなどによりサーバから削除されたソフトウェアの一覧を取得できます。
ソフトウェアのバージョンアップ時の挙動については、「ソフトウェア一覧・詳細」の「スキャンでソフトウェアのバージョンアップを検知した場合の挙動」の注意書きを参照してください。
$ curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/groupSet/deletedPkgCpes' | jq
{
"paging": {
"totalPage": 1,
"offset": 0,
"page": 1,
"limit": 20,
"totalCount": 3
},
"pkgCpes": [
{
"serverSoftwareID": 10,
"pkgID": 10,
"name": "openssl",
"version": "1.1.1",
"serverID": 501,
"serverUuid": "hoge-fuga",
"serverName": "app-server-1",
"group": {
"ID": 1,
"groupName": "group01"
}
}
]
}
サーバSBOMのダウンロード#
FutureVuls に登録されているサーバ情報を、SBOM 形式でダウンロードできます。 ダウンロード URL を埋め込んだ JSON レスポンスが返されるため、ファイルをダウンロードするには続けてリクエストを送信してください。
| パラメータ | 説明 | 備考 |
|---|---|---|
| serverID | SBOM を生成するサーバのID | serverIDの取得方法 |
| format | SBOM の生成フォーマット | cyclonedx_json、cyclonedx_xml、spdx_json から選択(必須) |
# リクエストを送ると、一時認証のある URL を取得できる
$ curl -s -H 'Accept:application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/server/XXXX/sbom?format=cyclonedx_json' | jq
{
"url": "https://XXXX.s3.ap-northeast-1.amazonaws.com/XXXX/XXXX/XXXXX-XXXXXXX.cyclonedx.json?X-Amz-Algorithm=...&X-Amz-Credential=...&X-Amz-Date=...&X-Amz-Expires=...&X-Amz-Security-Token=..."
}
# ファイルをダウンロードする場合は、続けてリクエストを送る
$ curl -s -O $(curl -s -H 'Accept:application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/server/XXXX/sbom?format=cyclonedx_json' | jq -r '.url')
パラメータを用いたフィルタ#
日時で絞り込むパラメータ#
このページの例で使用している、日時で絞り込むパラメータは次のとおりです。日時は UTC で指定します。
| パラメータ | 基準の日時 | 例で使用している API | 注意点 | 例 |
|---|---|---|---|---|
filterNewedAtAfter・filterNewedAtBefore |
タスクが NEW として登録された日時(PATCH_APPLIED のタスクが再検知されて NEW に戻った場合も更新) |
GET /v1/tasks |
指定した日時は範囲に含まれる。日単位で取得する場合は、終了日時に小数秒(.999999)まで指定する |
指定日以降、期間指定 |
filterStatusUpdatedAtAfter |
タスクのステータスが更新された日時(一括更新で現在と同じステータスを指定した場合も更新される) | GET /v1/groupSet/tasks |
filterStatus と組み合わせて、現在のステータスで絞り込む |
PATCH_APPLIED への変更 |
filterSupplyChainRiskUpdatedAtAfter |
サプライチェーンリスクの更新日時 | GET /v1/groupSet/pkgCpes |
EOL の新規検知のほか、ステータス・担当者・EOL 日付の変更なども含む | サプライチェーンリスクの更新 |
filterCreatedAtAfter |
ソフトウェアが登録された日時(バージョンアップされたソフトウェアを含む) | GET /v1/groupSet/pkgCpes |
ー | ソフトウェアの登録 |
filterDeletedAtAfter |
ソフトウェアが削除された日時 | GET /v1/groupSet/deletedPkgCpes |
例では filterServerID と組み合わせて、特定のサーバに絞り込む |
ソフトウェアの削除 |
日付フィルタなし#
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/tasks?limit=1000'
日本時間の2024年5月17日以降に NEW として登録されたタスクの取得#
filterNewedAtAfter を利用することで抽出できます。日時は UTC で指定します(日本時間の 2024年5月17日 0 時は 2024-05-16T15:00:00Z)。
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/tasks?limit=1000&filterNewedAtAfter=2024-05-16T15:00:00Z'
# 例: 条件に一致するタスクの総件数を取得する場合
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/tasks?limit=1&filterNewedAtAfter=2024-05-16T15:00:00Z' | jq .paging.totalCount
総件数は paging.totalCount で確認します。取得した tasks の要素数で集計する方法では、1 ページ分(最大 1,000 件)しか集計できません。
日本時間の2024年5月17日から2024年5月23日の間に NEW として登録されたタスクの取得#
filterNewedAtAfter と filterNewedAtBefore を組み合わせて抽出できます。
次の例は、日本時間の 2024年5月17日 0 時から 2024年5月23日 23 時 59 分 59.999999 秒までを指定しています。
終了日時を 14:59:59Z のように秒までで指定すると、23 時 59 分 59 秒より後(1 秒未満)に登録されたタスクが範囲に含まれません。
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/tasks?limit=1000&filterNewedAtAfter=2024-05-16T15:00:00Z&filterNewedAtBefore=2024-05-23T14:59:59.999999Z'
ある日付以降にステータスが PATCH_APPLIED に切り替わったタスクの取得#
filterStatusUpdatedAtAfter と filterStatus を組み合わせて抽出できます。
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/groupSet/tasks?filterStatusUpdatedAtAfter=2025-07-14T00:00:00Z&filterStatus=patch_applied'
24時間以内にサプライチェーンリスクが更新されたソフトウェアの取得#
filterSupplyChainRiskUpdatedAtAfter を利用することで、指定時刻以降にサプライチェーンリスク(EOL 、マリシャスパッケージなど)が更新されたソフトウェアを抽出できます。
# 24時間前の日時を指定(例: 2026-01-28T00:00:00Z)
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/groupSet/pkgCpes?filterSupplyChainRiskUpdatedAtAfter=2026-01-28T00:00:00Z' | jq
filterSupplyChainRiskUpdatedAtAfter の注意点
サプライチェーンリスクの更新日時でフィルタするため、EOL の新規検知のほか、ステータス・担当者・EOL 日付・検出方法や検出理由の変更、マリシャスパッケージの新規検知も含みます。「新しく EOL が検知されたソフトウェアのみ」は抽出できません。
指定日時以降に作成されたソフトウェアの取得#
filterCreatedAtAfter を利用することで、指定時刻以降に FutureVuls へ登録されたソフトウェアとバージョンアップされたソフトウェアを抽出できます。
ソフトウェアのバージョンアップ時の挙動については、「ソフトウェア一覧・詳細」の「スキャンでソフトウェアのバージョンアップを検知した場合の挙動」の注意書きを参照してください。
# 2026年1月1日以降に作成されたソフトウェアを取得
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/groupSet/pkgCpes?filterCreatedAtAfter=2026-01-01T00:00:00Z' | jq
特定日時以降に削除されたソフトウェアの取得#
filterServerID と filterDeletedAtAfter を利用することで、特定のサーバで指定時刻以降に削除されたソフトウェアを抽出できます。
# 2026年1月1日以降に削除されたソフトウェアを取得
curl -s -H 'accept: application/json' -H 'Authorization:xxxxxxxxxxxxx' 'https://rest.vuls.biz/v1/groupSet/deletedPkgCpes?filterDeletedAtAfter=2026-01-01T00:00:00Z&filterServerID=501' | jq