尝试过滤来自Json的输出,到目前为止,当软件版本不存在时,当软件版本被找到时,使用的过滤器将按预期工作,jq将导致错误。基本上,如何在csv文件中转义()并返回空值。
.result [] | [ "https://vuldb.com/?id." + .entry.id ,.software.vendor // "empty"
,.software.name // "empty", (.software.version []| tostring // "empty")
,.software.type // "empty"
,.software.platform //"empty" ] "result": [
{
"entry": {
"id": "206880",
"title": "CrowdStrike Falcon 6.31.14505.0\/6.42.15610 Uninstallation authorization",
"summary": "A vulnerability was found in CrowdStrike Falcon 6.31.14505.0\/6.42.15610. It has been classified as problematic. Affected is some unknown functionality of the component Uninstallation Handler. There is no information about possible countermeasures known. It may be suggested to replace the affected object with an alternative product.",
"details": {
"affected": "A vulnerability was found in CrowdStrike Falcon 6.31.14505.0\/6.42.15610. It has been classified as problematic.",
"vulnerability": "CWE is classifying the issue as CWE-862. The software does not perform an authorization check when an actor attempts to access a resource or perform an action.",
"impact": "This is going to have an impact on availability.",
"exploit": "It is declared as functional. The vulnerability was handled as a non-public zero-day exploit for at least 54 days. During that time the estimated underground price was around $0-$5k.",
"countermeasure": "There is no information about possible countermeasures known. It may be suggested to replace the affected object with an alternative product.",
"sources": "Further details are available at modzero.com."
},
"timestamp": {
"create": "1661155277",
"change": "1661155462"
},
"changelog": [
"vulnerability_cvss3_meta_basescore",
"vulnerability_cvss3_meta_tempscore",
"vulnerability_cvss3_researcher_basescore"
]
},
"software": {
"vendor": "CrowdStrike",
"name": "Falcon",
"version": [
"6.31.14505.0",
"6.42.15610"
],发布于 2022-08-30 20:31:35
抑制错误并为空值提供一个替代方案:
.result | map(
"https://vuldb.com/?id.\(.entry.id)",
(
.software |
.vendor // "empty",
.name // "empty",
(.version[] | tostring // "empty")? // "no version",
.type // "empty",
.platform // "empty"
)
)https://stackoverflow.com/questions/73458432
复制相似问题