Our Python script is designed to extract security bug fixes commits and convert them into a JSON format, to be used with the pyszz implementation provided by grosa1 on GitHub.
It is also able to extract relevant information from pyszz output, such as:
- developer name : number of security vulnerabilities introduced
- percentage of commits that fix a previously introduced vulnerability
-
Pull the project
-
install the requirements
pip3 install requirements.txt
-
Run the following command
python3 pyszz_json_generator.py [param]
Whereparam
should be replaced with the project path on which you want to extract commits related to security bug fixes.
the script will generate a file calleddata.json
in the folder where it is located.
By default it generates entries in the following form:
[
{
"repo_name": "apache/tomcat",
"fix_commit_hash": "30ae3f5421"
},
...
]
Where "repo_name"
will be the name of the folder passed as input to the script.
-
launch
pyszz
script from this repo using thedata.json
provided by thepyszz_json_generator.py
script. -
finally use the following command to extract information from the pyszz output
python3 pyszz_data_analyzer.py pyszz/out/outuput.json path/to/project