Skip to content

Commit ba8b635

Browse files
authored
Update main.py
1 parent 152e079 commit ba8b635

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

main.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def get_nvd_feed():
99
wget.download(url)
1010
command = 'unzip -o nvdcve-1.0-recent.json.zip' # Unzip json.gz file
1111
os.system(command)
12-
print('JSON Feed Downloaded Successfully')
1312

1413
def get_cpes():
1514
with open('cpe.txt', 'r') as v:
@@ -25,19 +24,17 @@ def parse_nvd_feed(cpes):
2524
message = ""
2625

2726
for x in cve_feed['CVE_Items']:
28-
cve_id = cve_feed['CVE_Items'][cve_index]['cve']['CVE_data_meta']['ID']
29-
cve_description = cve_feed['CVE_Items'][cve_index]['cve']['description']['description_data'][0]['value']
27+
id = cve_feed['CVE_Items'][cve_index]['cve']['CVE_data_meta']['ID']
28+
description = cve_feed['CVE_Items'][cve_index]['cve']['description']['description_data'][0]['value']
3029
try:
3130
cpe_string = cve_feed['CVE_Items'][cve_index]['configurations']['nodes'][0]['cpe_match']
3231
except:
3332
cpe_string = ""
3433
for line in cpes:
3534
for cpe in line.split():
36-
print(cpe)
3735
for x in cpe_string:
3836
if cpe in x.get('cpe23Uri'):
39-
message = message + slack_block_format(cpe, cve_description, cve_id)
40-
print(message)
37+
message = message + slack_block_format(cpe, description, id)
4138
cve_count = cve_count + 1
4239
cve_index = cve_index + 1
4340
return message,cve_count

0 commit comments

Comments
 (0)