From fc82a074a6011d82df7519a6e43a7faf82727d32 Mon Sep 17 00:00:00 2001 From: Roman Balashevich <65680726+rbalashevich@users.noreply.github.com> Date: Wed, 13 Jul 2022 13:52:26 +0300 Subject: [PATCH] Update test2.yaml Update README.md Update test2.yaml Update test2.yaml Update test2.yaml Update test2.yaml Update Dockerfile Update test2.yaml Update test2.yaml Update test2.yaml Update test2.yaml Update test2.yaml Update test2.yaml Update test2.yaml Update test2.yaml --- .github/workflows/test2.yaml | 7 +++++-- Dockerfile | 9 +++------ README.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test2.yaml b/.github/workflows/test2.yaml index d0bff89..edc6328 100644 --- a/.github/workflows/test2.yaml +++ b/.github/workflows/test2.yaml @@ -9,13 +9,16 @@ jobs: uses: actions/checkout@v3 - name: Write kubeconfig to file run: echo "${{ secrets.KUBECONFIG_CONTENT }}" > mykubeconfig - - name: Verify kubeconfig substitution + - name: Verify kubeconfig substitution and set context + id: verifyandset run: | + var=$(kubectl config current-context) echo $KUBECONFIG curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" chmod +x kubectl kubectl config current-context kubectl get pod -A + echo "::set-output name=KUBE_CONTEXT::$var" env: KUBECONFIG: mykubeconfig - name: Scan cluster @@ -23,7 +26,7 @@ jobs: with: ksversion: 'v2.0.155' format: 'json' - context: ${{ steps.savecontext.outputs.KUBE_CONTEXT }} + context: ${{ steps.verifyandset.outputs.KUBE_CONTEXT }} env: KUBECONFIG: mykubeconfig - name: Retrieve Scan Results via File Upload diff --git a/Dockerfile b/Dockerfile index 23d86e0..211e4a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,18 +3,15 @@ FROM ubuntu:20.04 ARG KUBECONFIG_CONTENT ENV kubeconfig_content=$KUBECONFIG_CONTENT -RUN echo $kubeconfig_content +# RUN echo $kubeconfig_content RUN mkdir .kube RUN echo "$kubeconfig_content" > /.kube/config RUN export KUBECONFIG=/.kube/config -RUN ls -a / -RUN ls -a /.kube - -RUN ls -a /.kube/config -RUN cat /.kube/config +# RUN ls -a /.kube +# RUN cat /.kube/config ENV KUBESCAPE_SKIP_UPDATE_CHECK 1 RUN apt-get update && apt-get install -y curl diff --git a/README.md b/README.md index b59a6b5..9c79a2c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ How to use kubescape in CI. Sample actions. Desired features (schematically, wit ksversion: 'v2.0.155' # [⚠️ Required] # A version of involved binary (See ARMO releases page: https://github.com/armosec/kubescape/releases ). - path: '.' + path: '' # [⚙️ Optional] # A path where to look for deployments' YAML to scan. Default is repo's home dir. threshold: 20