-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# eks-stack Scripts | ||
|
||
The scripts in this directory are used alongside the deployment configurations in this repository to provide insights into our deployment and help the team to explore the metrics generated by tools such as Trivy. | ||
|
||
## scripts/trivy_to_csv.py | ||
|
||
This script is intended to be used to convert a Trivy YAML report (other than VulnerabilityAssessmentReports) into a CSV file. | ||
|
||
Using this script will require a couple of setup steps. You will need to: | ||
1. Authenticate with AWS using credentials for the appropriate AWS account that k8s is deployed to. | ||
``` | ||
export AWS_PROFILE=<my-aws-profile> | ||
aws sso login | ||
``` | ||
1. Update your kube-config with eks for the k8s cluster. | ||
``` | ||
aws eks update-kubeconfig --region us-east-1 --name dpe-k8 | ||
``` | ||
1. Extract the Trivy report(s) that you are interested in. | ||
``` | ||
kubectl get Clusterinfraassessmentreports -A -o yaml > cluster_infra_reports.yaml | ||
``` | ||
1. Then, you can execute this script. | ||
``` | ||
python scripts/trivy_to_csv.py cluster_infra_reports.yaml cluster_infra_reports.csv | ||
``` | ||
|
||
## scripts/trivy_vulnerabilities_to_csv.py | ||
|
||
This script is intended to be used to convert a Trivy Vulnerabilities YAML report into a CSV file. | ||
|
||
Using this script will require following the same setup steps as [above](#scripts/trivy_to_csv.py). This script should be used when generating a report file for the VulnerabilityAssessmentReports. | ||
1. Extract the Trivy report(s) that you are interested in. | ||
``` | ||
kubectl get Vulnerabilityassessmentreports -A -o yaml > vulnerability_reports.yaml | ||
``` | ||
1. Then, you can execute this script. | ||
``` | ||
python scripts/trivy_to_csv.py vulnerability_reports.yaml vulnerability_reports.csv | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters