Bug 12997

Summary: MITRE import not working
Product: [Yocto Project Subprojects] Security Response Tool Reporter: Ross Burton <ross.burton>
Component: GeneralAssignee: David Reyna <david.reyna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium    
Version: unspecified   
Target Milestone: 2.7 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2018-11-09 12:49:23 UTC
Running the MITRE fetch command manually:

$ ./bin/srtool_mitre.py -u --source="Mitre 2018"
--file=data/allitems-cvrf-year-2018.xml
--url-file=allitems-cvrf-year-2018.xml
MITRE downloading
'https://cve.mitre.org/data/downloads/allitems-cvrf-year-2018.xml' as
'/home/ross/Yocto/srtool/data/allitems-cvrf-year-2018.xml'
Traceback (most recent call last):
  File "./bin/srtool_mitre.py", line 314, in <module>
    main(sys.argv[1:])
  File "./bin/srtool_mitre.py", line 304, in main
    init_mitre(args.source,args.url_file,args.cve_file)
  File "./bin/srtool_mitre.py", line 181, in init_mitre
    result_returncode,result_stdout,result_stderr = execute_process(
NameError: name 'execute_process' is not defined
Comment 1 David Reyna 2018-11-09 21:00:10 UTC
Add missing "execute_process" helper method.
Comment 2 Ross Burton 2018-11-12 11:30:53 UTC
So this happens:

$ ./bin/srtool_mitre.py -u --source="Mitre 2018" --file=data/allitems-cvrf-year-2018.xml --url-file=allitems-cvrf-year-2018.xml
MITRE File already downloaded:/home/ross/Yocto/srtool/data/allitems-cvrf-year-2018.xml

Shouldn't it be refreshing the file?

Once I delete that file then the download is successful.
Comment 3 David Reyna 2018-12-22 02:18:46 UTC
The automatic source file update will happen when we start the CRON job that triggers the refresh actions via "bin/common/srtool_utils.py --run-all-updates".

This tool in turn examines the datasource list for the update frequency, and executed the update actions accordingly.