-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add image scanning and refactor Makefile (#335)
fix: add fixes for vuln
- Loading branch information
Showing
14 changed files
with
201 additions
and
149 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
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
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
steps: | ||
- script: | | ||
# Allow errors in case the images do not exist | ||
set +e | ||
az account set -s=$(SUBSCRIPTION_ID) | ||
az acr login -n $(REGISTRY_NAME) | ||
az acr repository delete --name $(REGISTRY_NAME) --image secrets-store-csi-driver-provider-azure:${IMAGE_VERSION}-linux-amd64 -y || true | ||
az acr repository delete --name $(REGISTRY_NAME) --image secrets-store-csi-driver-provider-azure:${IMAGE_VERSION}-windows-1809-amd64 -y || true | ||
az acr repository delete --name $(REGISTRY_NAME) --image secrets-store-csi-driver-provider-azure:${IMAGE_VERSION} -y || true | ||
# an empty tag will result in deleting the whole repo. | ||
if [[ -n "${IMAGE_VERSION:-}" ]]; then | ||
# Allow errors in case the images do not exist | ||
set +e | ||
az account set -s=$(SUBSCRIPTION_ID) | ||
az acr login -n $(REGISTRY_NAME) | ||
az acr repository delete --name $(REGISTRY_NAME) --image k8s/csi/secrets-store/provider-azure:${IMAGE_VERSION}-linux-amd64 -y || true | ||
az acr repository delete --name $(REGISTRY_NAME) --image k8s/csi/secrets-store/provider-azure:${IMAGE_VERSION}-windows-1809-amd64 -y || true | ||
az acr repository delete --name $(REGISTRY_NAME) --image k8s/csi/secrets-store/provider-azure:${IMAGE_VERSION}-windows-1903-amd64 -y || true | ||
az acr repository delete --name $(REGISTRY_NAME) --image k8s/csi/secrets-store/provider-azure:${IMAGE_VERSION}-windows-1909-amd64 -y || true | ||
az acr repository delete --name $(REGISTRY_NAME) --image k8s/csi/secrets-store/provider-azure:${IMAGE_VERSION}-windows-2004-amd64 -y || true | ||
az acr repository delete --name $(REGISTRY_NAME) --image k8s/csi/secrets-store/provider-azure:${IMAGE_VERSION} -y || true | ||
fi | ||
condition: always() | ||
displayName: "Cleanup" |
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,19 @@ | ||
parameters: | ||
- name: logUID | ||
displayName: 'uid for log directory' | ||
type: string | ||
|
||
steps: | ||
- script: | | ||
mkdir -p $(Build.ArtifactStagingDirectory)/logs/${{ parameters.logUID }} | ||
kubectl logs -n kube-system -l app.kubernetes.io/name=secrets-store-csi-driver -c secrets-store --tail=-1 > $(Build.ArtifactStagingDirectory)/logs/${{ parameters.logUID }}/secrets-store-csi-driver.json | ||
kubectl logs -n kube-system -l app.kubernetes.io/name=secrets-store-csi-driver -c node-driver-registrar --tail=-1 > $(Build.ArtifactStagingDirectory)/logs/${{ parameters.logUID }}/node-driver-registrar.json | ||
kubectl logs -n kube-system -l app.kubernetes.io/name=secrets-store-csi-driver -c liveness-probe --tail=-1 > $(Build.ArtifactStagingDirectory)/logs/${{ parameters.logUID }}/liveness-probe.json | ||
kubectl logs -n kube-system -l app.kubernetes.io/name=csi-secrets-store-provider-azure --tail=-1 > $(Build.ArtifactStagingDirectory)/logs/${{ parameters.logUID }}/csi-secrets-store-provider-azure.json | ||
kubectl get pods -A -o wide | ||
condition: always() | ||
displayName: "Get logs" | ||
- task: PublishBuildArtifacts@1 | ||
displayName: Save artifacts | ||
condition: succeededOrFailed() |
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,12 @@ | ||
steps: | ||
- script: | | ||
export REGISTRY="e2e" | ||
export IMAGE_VERSION="test" | ||
OUTPUT_TYPE=docker make container | ||
wget https://github.com/aquasecurity/trivy/releases/download/v$(TRIVY_VERSION)/trivy_$(TRIVY_VERSION)_Linux-64bit.tar.gz | ||
tar zxvf trivy_$(TRIVY_VERSION)_Linux-64bit.tar.gz | ||
# show all vulnerabilities in the logs | ||
./trivy "${REGISTRY}/provider-azure:${IMAGE_VERSION}" | ||
./trivy --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL "${REGISTRY}/provider-azure:${IMAGE_VERSION}" || exit 1 | ||
displayName: "Scan images for vulnerability" |
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
Oops, something went wrong.