diff --git a/.github/workflows/sysdig-iac-scan.yaml b/.github/workflows/sysdig-iac-scan.yaml new file mode 100644 index 0000000000..14d17b1acd --- /dev/null +++ b/.github/workflows/sysdig-iac-scan.yaml @@ -0,0 +1,38 @@ +name: Sysdig IaC Scan + +on: + workflow_dispatch: + pull_request: + paths: + - '**/*.tf' + - '**/*.yaml' + - '**/*.yml' + - '.github/workflows/sysdig-iac-scan.yaml' + push: + branches: + - main + paths: + - '**/*.tf' + - '**/*.yaml' + - '**/*.yml' + - '.github/workflows/sysdig-iac-scan.yaml' + +jobs: + iac-scan: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Sysdig IaC Scan + uses: sysdiglabs/scan-action@v6 + with: + iac-scan: true + sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }} + sysdig-secure-url: https://app.us4.sysdig.com + stop-on-failed-policy-eval: false + stop-on-processing-error: true diff --git a/.github/workflows/sysdig-image-scan.yaml b/.github/workflows/sysdig-image-scan.yaml new file mode 100644 index 0000000000..1199fe02b4 --- /dev/null +++ b/.github/workflows/sysdig-image-scan.yaml @@ -0,0 +1,65 @@ +name: Sysdig Image Scan + +on: + workflow_dispatch: + pull_request: + paths: + - 'vote/**' + - 'worker/**' + - 'result/**' + - '.github/workflows/sysdig-image-scan.yaml' + push: + branches: + - main + paths: + - 'vote/**' + - 'worker/**' + - 'result/**' + - '.github/workflows/sysdig-image-scan.yaml' + +jobs: + image-scan: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build vote image + run: docker build -t examplevotingapp_vote:ci ./vote + + - name: Build worker image + run: docker build -t examplevotingapp_worker:ci ./worker + + - name: Build result image + run: docker build -t examplevotingapp_result:ci ./result + + - name: Scan vote image + uses: sysdiglabs/scan-action@v6 + with: + image-tag: examplevotingapp_vote:ci + sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }} + sysdig-secure-url: https://app.us4.sysdig.com + stop-on-failed-policy-eval: false + stop-on-processing-error: true + + - name: Scan worker image + uses: sysdiglabs/scan-action@v6 + with: + image-tag: examplevotingapp_worker:ci + sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }} + sysdig-secure-url: https://app.us4.sysdig.com + stop-on-failed-policy-eval: false + stop-on-processing-error: true + + - name: Scan result image + uses: sysdiglabs/scan-action@v6 + with: + image-tag: examplevotingapp_result:ci + sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }} + sysdig-secure-url: https://app.us4.sysdig.com + stop-on-failed-policy-eval: false + stop-on-processing-error: true diff --git a/k8s-specifications/vote-deployment.yaml b/k8s-specifications/vote-deployment.yaml index 165a9478f8..8808968206 100644 --- a/k8s-specifications/vote-deployment.yaml +++ b/k8s-specifications/vote-deployment.yaml @@ -20,3 +20,10 @@ spec: ports: - containerPort: 80 name: vote + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "256Mi"