Reason of Bug
The current src/gcp_scanner/scanner.py file in the codebase, creates a JSON file with the name of the project to store the output of the scan. If the file already exists, it opens the same file in the append mode and appends the output of the scan to the same file.
Approach to fix the bug
I added the timestamp of the scan to the name of the output file while writing the scan results. In this way, for every scan, there will be different output files where the output would be written into.
Before the changes
The output gets appended to same file in case of multiple scans.
This PR fixes https://github.com/google/gcp_scanner/issues/79. This PR is continuation of #84.
Reason of Bug The current src/gcp_scanner/scanner.py file in the codebase, creates a JSON file with the name of the project to store the output of the scan. If the file already exists, it opens the same file in the append mode and appends the output of the scan to the same file.
Approach to fix the bug I added the timestamp of the scan to the name of the output file while writing the scan results. In this way, for every scan, there will be different output files where the output would be written into.
Before the changes The output gets appended to same file in case of multiple scans.