Red Hat Security Data API
API 文档
摘要
第 1 章 概述 复制链接链接已复制到粘贴板!
红帽产品安全团队承诺提供工具和安全数据,以帮助您更好地了解安全威胁。这个数据已在我们的 Security Data 页面中提供,现在可以使用 Security Data API 以机器使用的格式提供。此服务允许客户以编程方式查询之前只能通过我们的安全数据页面上的文件公开的数据。
安全数据 API 提供的数据与安全数据页面中提供的数据相同: Common Security Advisory Framework (CSAF)文档、OVAL v2 (OVAL streams)和 CVE 数据。可以使用 API 以 JSON 或 XML 格式获取数据。
此努力是红帽产品安全团队的承诺的一部分,以易于使用的格式为客户提供安全数据。
请注意:仅维护一个版本,并在文档中记录任何更改。
安全数据 API 为信息和指标提供。如需与 API 或它提供的数据相关的问题或有疑问,请联络 红帽产品安全团队。
基本 URL
https://access.redhat.com/hydra/rest/securitydata
https://access.redhat.com/hydra/rest/securitydata
支持的格式
API 支持 JSON、XML 和 HTML 格式。格式可以指定为 url 的扩展,如 .json 或 .xml。
压缩的"gzip"响应
默认情况下,以压缩的 'gzip' 格式返回响应。大多数浏览器和下载工具将自动解压响应数据。如果需要未压缩响应数据,可以将查询参数 为Compressed=false 添加到查询 URL 中。(请参阅各个部分的参数描述和示例查询 URL。)
弃用通知
通用漏洞报告框架(CVRF)格式现已弃用,且不再被支持。请参阅 CVRF 兼容性常见问题解答。此格式的用户应迁移到通用安全公告框架(CSAF)格式。
OVAL v1 文件已弃用,不再可用。如需更多信息,请参阅 OVAL v1 弃用公告。此格式的用户应该迁移到 OVAL v2 (OVAL 流)。
第 2 章 CSAF 复制链接链接已复制到粘贴板!
2.1. 列出所有 CSAFs 复制链接链接已复制到粘贴板!
摘要
在未传递参数时,为所有最新的 CSAF 文档提供索引,其中包含其内容摘要。使用最小属性,返回一个方便的对象作为响应。
有关红帽勘误(RHSA、RHBA 和 RHEA)的更多信息,请参阅 解释 红帽勘误文章。
JSON
GET /csaf.json
GET /csaf.json
XML
GET /csaf.xml
GET /csaf.xml
HTML
GET /csaf
GET /csaf
2.2. 参数 复制链接链接已复制到粘贴板!
| Name | 描述 | 示例 |
|---|---|---|
| 之前 | 在查询日期前 CSAF 文档的索引。[ISO 8601 是预期的格式] | 2016-03-01 |
| after | 查询日期后的 CSAF 文档的索引。[ISO 8601 是预期的格式] | 2016-02-01 |
| rhsa_ids | RHSA_ID 的 CSAF 文档的索引用逗号分开 | RHSA-2018:2748,RHSA-2018:2791 |
| 错误 | Bugzilla Ids 的 CSAF 文档的索引 | 1326598,1084875 |
| CVE | CVE 的 CSAF 文档的索引 | CVE-2014-0160,CVE-2016-3990 |
| 严重性 | CSAF 文档的索引具有严重性 | low,moderate,important,critical |
| package | 影响软件包的 CSAF 文档的索引 | samba,thunderbird |
| page | 页号的 CSAF 文档的索引 | 默认:1 |
| per_page | 按页面返回的 CSAF 文档的索引数 | 默认: 1000 |
| created_days_ago | 在天前创建的 CSAF 文档的索引 | 10 |
| isCompressed | 以压缩 'gzip' 格式返回响应 | 默认: true |
By default, search will return the first page of 1000 results, ordered by date. To change the page size use the 'per_page' param, and then iterate through pages using the 'page' param.
By default, search will return the first page of 1000 results, ordered by date. To change the page size use the 'per_page' param, and then iterate through pages using the 'page' param.
以上所有查询参数都可以相互一起使用,以检索所需结果。
2.3. 检索 CSAF 复制链接链接已复制到粘贴板!
摘要
RHSA 的 CSAF 详情。
JSON
CSAF 文档采用 JSON 格式;XML 视图是 XML 格式的 CSAF 数据的表示。
GET /csaf/<RHSA_ID>.json
GET /csaf/<RHSA_ID>.json
XML
GET /csaf/<RHSA_ID>.xml
GET /csaf/<RHSA_ID>.xml
备注:
通用安全公告框架(CSAF)的 JSON 格式由 OASIS 定义,请参见 此处用于 GitHub 仓库,这里包括了 schema。
有关红帽提供的 CSAF/VEX 数据的详情,请参考: https://www.redhat.com/en/blog/csaf-vex-documents-now-generally-available
Query URL 示例
https://access.redhat.com/hydra/rest/securitydata/csaf
https://access.redhat.com/hydra/rest/securitydata/csaf.xml
https://access.redhat.com/hydra/rest/securitydata/csaf.json
https://access.redhat.com/hydra/rest/securitydata/csaf.json?after=2023-09-01
https://access.redhat.com/hydra/rest/securitydata/csaf.json?created_days_ago=10
https://access.redhat.com/hydra/rest/securitydata/csaf.json?cve=CVE-2023-1829,CVE-2023-3090,CVE-2023-3390
https://access.redhat.com/hydra/rest/securitydata/csaf.json?rhsa_ids=RHSA-2022:6155,RHSA-2023:2378
https://access.redhat.com/hydra/rest/securitydata/csaf.json?bug=2053532,2153399
https://access.redhat.com/hydra/rest/securitydata/csaf.json?severity=important&created_days_ago=30
https://access.redhat.com/hydra/rest/securitydata/csaf.json?package=thunderbird
https://access.redhat.com/hydra/rest/securitydata/csaf/RHSA-2022:6155
https://access.redhat.com/hydra/rest/securitydata/csaf/RHSA-2022:6155.xml
https://access.redhat.com/hydra/rest/securitydata/csaf/RHSA-2022:6155.json
https://access.redhat.com/hydra/rest/securitydata/csaf?isCompressed=false
https://access.redhat.com/hydra/rest/securitydata/csaf.json?isCompressed=false
https://access.redhat.com/hydra/rest/securitydata/csaf.json?after=2022-11-30&isCompressed=false
第 3 章 CVE 复制链接链接已复制到粘贴板!
3.1. 列出所有 CVE 复制链接链接已复制到粘贴板!
摘要
在没有传递参数时列出所有最新的 CVE。返回方便的对象作为带有非常最小属性的响应。
JSON
GET /cve.json
GET /cve.json
XML
GET /cve.xml
GET /cve.xml
HTML
GET /cve
GET /cve
3.2. 参数 复制链接链接已复制到粘贴板!
| Name | 描述 | 示例 |
|---|---|---|
| 之前 | 查询日期之前的 CVE。[ISO 8601 是预期的格式] | 2016-03-01 |
| after | 查询日期后的 CVE。[ISO 8601 是预期的格式] | 2016-02-01 |
| id | 用逗号分开的 Ids 的 CVE | CVE-2017-8797,CVE-2014-0161 |
| 错误 | Bugzilla Ids 的 CVE | 1326598,1084875 |
| advisory | 公告的 CVE | RHSA-2016:0614,RHSA-2016:0610 |
| 严重性 | CVE 的严重性 | low,moderate,important |
| package | 影响软件包的 CVE | samba,thunderbird |
| 产品 | 影响该产品的 CVE。参数支持 Perl 兼容正则表达式。 | linux 7,openstack |
| cwe | 带有 CWE 的 CVE | 295,300 |
| cvss_score | CVSS 分数的 CVE 大于或等于这个值 | 7.0 |
| cvss3_score | CVSSv3 分数的 CVE 大于或等于这个值 | 7.0 |
| page | 页面号的 CVE | 默认:1 |
| per_page | 每个页面返回的 CVE 数量 | 默认: 1000 |
| created_days_ago | 之前创建的 CVE 定义的索引 | 10 |
| include_package_state | 带有 package_state 信息的 CVE | true, false |
| isCompressed | 以压缩 'gzip' 格式返回响应 | 默认: true |
By default, search will return the first page of 1000 results, ordered by date. To change the page size use the 'per_page' param, and then iterate through pages using the 'page' param.
By default, search will return the first page of 1000 results, ordered by date. To change the page size use the 'per_page' param, and then iterate through pages using the 'page' param.
以上所有查询参数都可以相互一起使用,以检索所需结果。
3.3. 检索 CVE 复制链接链接已复制到粘贴板!
摘要
检索完整的 CVE 详情。
路径
GET /cve/<CVE>.json
GET /cve/<CVE>.json
示例:/cve/CVE-2016-3706.json
返回 CVE-2016-3706 的 CVE 数据的 JSON 表示。
3.4. CVE 格式 复制链接链接已复制到粘贴板!
摘要
与 CSAF 或 OVAL 不同,CVE 表示不是标准的。有关哪些字段可能存在的备注,它们的含义如下。
| Name | 描述 | 其它信息 |
|---|---|---|
| ThreatSeverity | 漏洞的严重性。 | 如需更多信息,请参阅本文档。https://access.redhat.com/security/updates/classification |
| PublicDate | 当此缺陷变得公开时。 | ISO 8601 格式。 |
| Bugzilla | 红帽 Bugzilla 中错误的 ID、URL 和描述。 | |
| CVSS | CVSSv2 分数和指标. | 'status' 属性可能的值为 'draft' 或 'verified',这表示在调查漏洞时如何进行。如需更多信息,请参阅本文档。https://access.redhat.com/security/updates/classification |
| CVSS3 | CVSSv3 分数和指标. | 'status' 属性可能的值为 'draft' 或 'verified',这表示在调查漏洞时如何进行。如需更多信息,请参阅本文档。https://access.redhat.com/security/updates/classification |
| CWE | 用于此缺陷的 CWE 链。 | 请参阅 mitre.org 描述以及我们 可能的 cwe 值列表。 |
| 详情 | 有关此漏洞的详细信息,可能来自红帽或 Mitre。 | |
| 声明 | 有关此问题的声明。 | |
| 参考 | 有关此问题的更多信息的链接。 | |
| 致谢 | 受认可的人员或组织。 | |
| 缓解方案 | 在没有更新的软件的情况下修复或减少问题的方法。 | |
| AffectedRelease | 一个发布的 Erratum,用于修复特定产品的漏洞。 | 包含产品名称和 cp,以及 Erratum 链接、类型和发行日期。(可选)还包括描述 src.rpm 的名称和版本用来修复问题的"Package"信息(如果多个 src.rpms 位于同一 Erratum 中则不存在)。 |
| PackageState | 有关软件包/产品的信息,还没有发布修复。 | 包含产品名称和 cp、软件包(src.rpm)名称和修复状态,这是 ['Affected','Fix deferred','New','Not affected',' will not fix'] 之一。 |
| UpstreamFix | 修复程序的上游项目的版本。 |
Query URL 示例
https://access.redhat.com/hydra/rest/securitydata/cve
https://access.redhat.com/hydra/rest/securitydata/cve.xml
https://access.redhat.com/hydra/rest/securitydata/cve.json
https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2022-33980
https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2022-33980.xml
https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2022-33980.json
https://access.redhat.com/hydra/rest/securitydata/cve?after=2024-07-05
https://access.redhat.com/hydra/rest/securitydata/cve.json?after=2024-07-05
https://access.redhat.com/hydra/rest/securitydata/cve.xml?after=2024-07-05
https://access.redhat.com/hydra/rest/securitydata/cve.json?after=2024-07-05&before=2024-07-06
https://access.redhat.com/hydra/rest/securitydata/cve.json?created_days_ago=5
https://access.redhat.com/hydra/rest/securitydata/cve?isCompressed=false
https://access.redhat.com/hydra/rest/securitydata/cve.json?isCompressed=false
第 4 章 OVALSTREAMS 复制链接链接已复制到粘贴板!
4.1. 列出所有 OVAL 流 复制链接链接已复制到粘贴板!
摘要
向可以从中下载的所有 OVAL 流文件提供索引。如果没有传递参数,则返回所有 OVAL 流文件的列表。
JSON
GET oval/ovalstreams.json
GET oval/ovalstreams.json
XML
GET oval/ovalstreams.xml
GET oval/ovalstreams.xml
HTML
GET oval/ovalstreams
GET oval/ovalstreams
4.2. 参数 复制链接链接已复制到粘贴板!
| Name | 描述 | 示例 |
|---|---|---|
| after | 在查询日期后修改 OVAL 流文件的索引。预期格式:ISO 8601。 | 2016-02-01 |
| label | 产品版本标签的 OVAL 流文件的索引。 | jboss-eap-6 |
| isCompressed | 以压缩 'gzip' 格式返回响应 | 默认: true |
By default, returned results are ordered by date.
By default, returned results are ordered by date.
以上所有查询参数都可以相互一起使用,以检索所需结果。
4.3. 检索 OVAL 流 复制链接链接已复制到粘贴板!
摘要
返回由基础名称标识的产品的 OVAL 流数据。
JSON
OVAL 流文件采用 XML 格式;JSON 视图是 JSON 格式的 OVAL 数据表示。
GET oval/ovalstreams/<BASE>.json
GET oval/ovalstreams/<BASE>.json
示例:oval/ovalstreams/RHEL7.json
返回 Red Hat Enterprise Linux 7 的 OVAL 流的 JSON 表示。
XML
GET oval/ovalstreams/<BASE>.xml
GET oval/ovalstreams/<BASE>.xml
有关 OVAL 格式的更多信息,请参阅 FAQ。
Query URL 示例
https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams
https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams.xml
https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams.json
rhacm
HEKETI
ithttps://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams/RHEL9https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams/RHEL9.xmlhttps://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams/RHEL9.jsonhttps://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams?label=jboss-eap-8https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams.xml?label=jboss-eap-8https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams.json?label=jboss-eap-8https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams?after=2022-11-30https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams.xml?after=2022-11-30
https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams?isCompressed=false
https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams.json?isCompressed=false
https://access.redhat.com/hydra/rest/securitydata/oval/ovalstreams?after=2022-11-30&isCompressed=false