analysis: 运行了info_reveal_ai_analysis
This commit is contained in:
@@ -28,10 +28,10 @@ def analyze_with_ai(data: str) -> str:
|
||||
prompt = """
|
||||
你是一个计算机安全领域的专家,能够更具CVE描述分析出CVE产生于哪个程序、有何影响后果等信息。
|
||||
下面我会发给你一段文本,第一行是CVE的编号与文件位置信息,后续是这个CVE的详细描述。
|
||||
请分析我发送给你的CVE详细描述内容,并进行分析,我有三个分析要求:
|
||||
请分析我发送给你的CVE详细描述内容,并进行分析,我有3个分析要求:
|
||||
1. 分析这个CVE信息是否与namespace、cgroup、container或者容器、隔离相关;
|
||||
2. 分析这个CVE是否会导致容器,例如Docker等,在运行时会影响其他容器或宿主机;
|
||||
3. 如果条件1、2全部不满足,直接返回“N/A”,不需要附带任何信息。
|
||||
2. 告诉我这是什么程序的漏洞,是内核Kernel,还是容器实现Docker,还是容器内部运行的应用,同时告诉我这个漏洞如何发生,它有何效果。
|
||||
注意,如果这个CVE和namespace、cgroup、container或者容器、隔离无关,你只需返回"N/A"即可,无需任何多余信息。
|
||||
"""
|
||||
|
||||
client = OpenAI(
|
||||
@@ -61,7 +61,7 @@ if __name__ == "__main__":
|
||||
pattern = r"\./data/.*x/CVE.*?\.json"
|
||||
regex = re.compile(pattern)
|
||||
|
||||
with open("keyword_filter_11-25.log", "r", encoding="utf-8") as file:
|
||||
with open("keyword_filter_21-25.log", "r", encoding="utf-8") as file:
|
||||
text = file.read()
|
||||
matches = list(regex.finditer(text))
|
||||
|
||||
@@ -79,4 +79,4 @@ if __name__ == "__main__":
|
||||
ans = analyze_with_ai(block)
|
||||
if ans == "N/A":
|
||||
continue
|
||||
log.write(f"cve: {block}, analysis: {ans}\n\n")
|
||||
log.write(f"cve: {block}\n\nanalysis: {ans}\n\n")
|
||||
|
||||
Reference in New Issue
Block a user