如果趨勢科技 Artifact Scanner (TMAS) 報告了一個已被判定為誤報的弱點或秘密,或任何您想暫不處理的發現,您可以透過在覆蓋配置檔案中定義一個或多個規則來指示
TMAS 覆蓋這些發現(例如,
~/tmas_overrides.yml)。
注意目前不支援覆蓋惡意程式的檢測結果。
|
您可以使用這些規則執行掃瞄,方法是使用
--override 標誌向 TMAS 提供覆蓋檔案的路徑。tmas scan <artifact_to_scan> -VMS --override path/to/tmas_overrides.yml
覆寫檔案使用 YAML 結構,並在每個掃瞄類型下定義規則,例如
弱點 或 機密。當為機密和弱點提供覆寫時,請在同一個 YAML 檔案中指定所有覆寫。覆蓋弱點發現
弱點覆蓋被結構化為規則列表。每個規則可以指定以下條件的任意組合:
- 弱點 ID(例如,
"CVE-2008-4318") - 修復狀態(允許的值:
"fixed"、"not-fixed"、"wont-fix"或"unknown") - 套件名稱(例如,
"libcurl") - 套件版本(例如,
「1.5.1」) - 套件類型(例如,
"npm"、"go-package"、"rpm",或出現在 TMAS JSON 弱點報告中的任何套件類型) - 包位置資訊(例如,
"/usr/local/lib/node_modules/**";支援全域模式)
每條規則還必須附有說明,說明為什麼實施該規則(例如,「誤報」、「已緩解」、「未調用易受攻擊的包函數」等)。
vulnerabilities:
# This is the full set of supported rule fields:
- rule:
vulnerability: CVE-0000-0000
fixState: unknown
package:
name: libcurl
version: 1.5.1
type: npm
location: "/usr/local/lib/node_modules/**"
reason: A descriptor specifying why the override rule implemented
如果覆蓋檔案中指定的任何規則適用於特定的弱點發現,則該弱點發現將被覆蓋。只有當規則中的所有欄位都與弱點發現中的欄位匹配時,才認為該規則適用於該發現。
vulnerabilities:
# Override vulnerability findings whose CVE-ID is CVE-0000-0000
- rule:
vulnerability: CVE-0000-0000
reason: Not executed
# Override vulnerability findings detected on libcurl version 1.5.1
- rule:
package:
name: libcurl
version: 1.5.1
reason: Dev dependency
任何符合規則的弱點發現將在 JSON 報告中的
"Overridden" 部分呈現,而不是根據其嚴重性分類。
{
"vulnerabilities": {
"totalVulnCount": 1,
"criticalCount": 0,
"highCount": 0,
"mediumCount": 0,
"lowCount": 0,
"negligibleCount": 0,
"unknownCount": 0,
"overriddenCount": 1,
"findings": {
"High": [],
"Low": [],
"Medium": [],
"Negligible": [],
"Overridden": [
{
"name": "libcurl",
"type": "npm",
"version": "1.5.1",
"id": "CVE-0000-0000",
"source": "https://nvd.nist.gov/vuln/detail/CVE-0000-0000",
"severity": "Low",
"fix": "not-fixed",
"locations": ["/usr/local/lib/node_modules/**"],
"cvssSummaries": [],
"relatedVulnerabilities": []
}
]
}
}
}
覆蓋機密發現
秘密覆蓋支援多個目標:
- 路徑
- 規則
- 發現
每個覆蓋都是一個正則表達式模式的列表,這些模式會導致目標被排除。每個模式列表還必須附帶實施規則的原因(例如,「誤報」、「第三方依賴」等)。
secrets:
paths:
- patterns:
- node_modules
- .tox
reason: Third party dependencies
- patterns:
- .*_test.go
reason: Development resources
rules:
- patterns:
- generic-api-key
reason: A descriptor specifying why the override is implemented
findings:
- patterns:
- ".*example"
reason: "Used in testing"
如果覆蓋檔案中指定的任何正則表達式適用於該秘密發現,則該秘密發現將被覆蓋。
任何符合規則的秘密發現都會在 JSON 報告中以
overridden 顯示。{
"secrets": {
"totalFilesScanned": 3,
"unmitigatedFindingsCount": 0,
"overriddenFindingsCount": 1,
"findings": {
"overridden": [
{
"ruleID": "aws-access-token",
"description": "Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",
"secret": "AKIAIRYLJVKMPEXAMPLE",
"location": {
"path": "/workdir/test-fixtures/aws_access_key",
"startLine": 1,
"endLine": 1,
"startColumn": 1,
"endColumn": 20,
}
}
]
}
}
}
