Перейти к основному содержимому
Версия: 1.4

Загрузка внешнего отчета

Загрузка внешнего отчета может быть произведена вручную. Для загрузки необходимо выполнить следующие шаги:

  1. Перейти в раздел Проекты → Название проекта → Слои проекта

  2. В дополнительных действиях (кнопка Доп.действия) напротив ранее созданной проверки безопасности необходимо выбрать Импортировать результаты Импорт

    подсказка

    Для некоторых инструментов также предусмотрена возможность загружать отчеты в формате SBOM. Подробнее см. Загрузка SBOM-отчета.

  3. В открывшейся форме загрузить JSON или SARIF файл с результатами

    примечание

    Предусмотрена возможность загрузки не более одного файла в формате JSON или SARIF. Также доступна возможность частичного импорта (при этом не будут закрыты отсутствующие проблемы безопасности).

  4. Нажать на кнопку Сохранить

Требования к JSON-файлу

{
"properties": {
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"category": { "type": "string" },
"severity": {
"type": "string",
"enum": ["critical", "high", "medium", "low", "undefined"]
},
"id": { "type": "string" },
"cwe": { "type": "string" },
"cve": { "type": "string" },
"line": { "type": "integer", "minimum": 1 },
"code": { "type": "string" },
"libraryName": { "type": "string" },
"libraryVersion": { "type": "string" },
"file": { "type": "string" },
"links": {
"type": "array",
"items": { "type": "string", "format": "uri" }
},
"description": { "type": "string" },
"recommendation": { "type": "string" },
"fixedVersion": { "type": "string" },
"ratings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"metric": { "type": "string" },
"score": { "type": "number", "minimum": 0, "maximum": 10 }
},
"required": ["metric", "score"]
}
},
"path": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["category", "severity"]
}
}
},
"required": ["issues"]
}

Пример тела запроса

[
{
"category": "OS dependency vulnerability",
"severity": "high",
"sсan_object": "jfrog.tronsec.ru/tron/event-broker:1.1.2-patch",
"cwe": "CWE-79",
"cve": "CVE-2023-1234",
"tool_type_name": "KCS",
"lib_name": "example-library",
"lib_version": "1.2.3",
"info_links": ["https://example.com/cve-2023-1234"],
"description": "This is a vulnerability description.",
"recommendations": "Sanitize user input before executing commands.",
"fixed_version": "1.2.4",
"ratings": "CVSS: 9.1 (Critical)",
"path": "/src/controllers/userController.js",
"exploit": "Proof-of-concept exploit code here."
}
]

Пример отчета в формате SARIF

{
"version": "2.1.0",
"runs": [
{
"tool": {
"driver": {
"name": "MySecurityScanner",
"rules": [
{
"id": "SEC001",
"name": "InsecureLibraryUse",
"helpUri": "https://example.com/rules/SEC001-CVE-2023-12345",
"properties": {
"tags": ["security", "CWE-79", "injection"],
"references": [
"https://cwe.mitre.org/data/definitions/79.html",
"https://nvd.nist.gov/vuln/detail/CVE-2023-12345"
]
}
}
]
}
},
"properties": {
"category": "dependency-analysis"
},
"results": [
{
"ruleId": "SEC001",
"level": "error",
"message": {
"text": "Vulnerable library detected: lodash@4.17.11"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/utils/parser.js"
},
"region": {
"startLine": 42,
"snippet": {
"text": "const _ = require('lodash');"
}
}
}
}
],
"codeFlows": [
{
"threadFlows": [
{
"locations": [
{
"location": {
"physicalLocation": {
"artifactLocation": {
"uri": "src/utils/parser.js"
},
"region": {
"startLine": 42
}
}
}
}
]
}
]
}
],
"properties": {
"input_issue_id": "ISSUE-00123",
"security-severity": 8.5,
"info_links": [
"https://cwe.mitre.org/data/definitions/79.html",
"https://nvd.nist.gov/vuln/detail/CVE-2023-12345"
],
"library_name": "lodash",
"library_version": "4.17.11"
}
}
]
}
]
}

к сведению

При использовании внешних скриптов и в зависимости от выбранного инструмента сканирования (например, CLI-инструмента), у проверки безопасности может быть доступна опция получения результатов сканирования извне путём http-запроса от внешнего инструмента на эндпоинт TRON.ASOC.