WIP -DO NOT MERGE - HOFF-615: Replace Anchore with Trivy #215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
I've added Trivy Scanner to Pipeline and removed deprecated Anchore Scanner for the UKVI end tenancy service, see ticket
https://collaboration.homeoffice.gov.uk/jira/browse/HOFF-615
Why?
Trivy will let you scan images, file systems and repositories for any vulnerabilities and issues. It will detect CVEs of OS packages, applications susceptibilities, and exposures of IaC in Terraform files, Kubernetes and Docker. Drawback of Anchore Scanner is it’s significantly slower, the process of using it is more cumbersome, the output is less friendly and most importantly, it scans fewer CVEs.
How?
Removed Anchore cve exception file and added trivy cve exception file in hof-services-config repo from UKVI end tenancy configs. Removed Anchore Scanner steps from pipeline and added trivy scanner steps with cron scanner. Our Acceptance criteria is to list the Medium to Critical vulnerabilities.
Testing?
We can test it by raising pull request to Master branch. Drone Pipeline should run through the steps and should list the Medium to Critical Vulnerabilties and should progress to next steps of deployment to branch
https://drone-gh.acp.homeoffice.gov.uk/UKHomeOffice/end-tenancy/1178
Screenshots This screenshot is from Drone CI console
![image](https://private-user-images.githubusercontent.com/146218064/307420485-26044a7d-6ff1-4ec3-8598-1a5682124147.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjg3MzQsIm5iZiI6MTczOTI2ODQzNCwicGF0aCI6Ii8xNDYyMTgwNjQvMzA3NDIwNDg1LTI2MDQ0YTdkLTZmZjEtNGVjMy04NTk4LTFhNTY4MjEyNDE0Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxMDA3MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xODZhYzZiNDVhODllYjM4ZjZkOGY0NDE1ZGVkY2M0NGQ4MGUwNzY1NDE1OTQ3MWI5NDQ5ZmFhNTFhZTg1ZjA5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.2m9DLEGyueQEUQcwtVtXzr9LuypDvXsMrcnmCedtLAM)