-
Notifications
You must be signed in to change notification settings - Fork 3
Add image publish action #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Release falco_plugin (OCI) | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read # Default token to read | ||
|
|
||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: harden runner | ||
| uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | ||
Check warningCode scanning / zizmor action has a known vulnerability Warning
action has a known vulnerability
|
||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: install cosign | ||
| uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0 | ||
|
|
||
| - name: checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
Check warningCode scanning / zizmor detects commit SHAs that don't match their version comment tags Warning
detects commit SHAs that don't match their version comment tags
|
||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6 | ||
|
|
||
| - name: docker setup buildx | ||
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 | ||
Check warningCode scanning / zizmor detects commit SHAs that don't match their version comment tags Warning
detects commit SHAs that don't match their version comment tags
|
||
|
|
||
| - name: docker login ghcr.io | ||
| if: github.event_name != 'pull_request' | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | ||
Check warningCode scanning / zizmor detects commit SHAs that don't match their version comment tags Warning
detects commit SHAs that don't match their version comment tags
|
||
| with: | ||
| registry: ghcr.io | ||
| username: "${{ github.actor }}" | ||
| password: '${{ github.token }}' | ||
|
|
||
| - name: extract metadata | ||
| id: meta | ||
| working-directory: ${{ env.CONTAINERFILE_DIR }} | ||
| run: | | ||
| REPO_NAME=${{ github.event.repository.name }} | ||
Check failureCode scanning / zizmor code injection via template expansion Error
code injection via template expansion
Check failureCode scanning / zizmor code injection via template expansion: may expand into attacker-controllable code Error
code injection via template expansion: may expand into attacker-controllable code
|
||
| FULL_IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/edera_falco_plugin | ||
Check noticeCode scanning / zizmor code injection via template expansion: may expand into attacker-controllable code Note
code injection via template expansion: may expand into attacker-controllable code
|
||
| echo "full-image-name=${FULL_IMAGE_NAME,,}" >> $GITHUB_OUTPUT | ||
|
|
||
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
Check noticeCode scanning / zizmor code injection via template expansion: may expand into attacker-controllable code Note
code injection via template expansion: may expand into attacker-controllable code
|
||
| TAGS="${FULL_IMAGE_NAME,,}:pr-${{ github.event.number }}" | ||
Check noticeCode scanning / zizmor code injection via template expansion: may expand into attacker-controllable code Note
code injection via template expansion: may expand into attacker-controllable code
|
||
| else | ||
| TAGS="${FULL_IMAGE_NAME,,}:${{ github.sha }},${FULL_IMAGE_NAME,,}:latest" | ||
Check noticeCode scanning / zizmor code injection via template expansion: may expand into attacker-controllable code Note
code injection via template expansion: may expand into attacker-controllable code
|
||
| fi | ||
| echo "tags=${TAGS}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: build and push Docker image | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6 | ||
| id: push | ||
| with: | ||
| context: . | ||
| file: ./Containerfile | ||
| platforms: "linux/amd64" | ||
| push: ${{ github.event_name != 'pull_request' }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| labels: | | ||
| org.opencontainers.image.title=${{ steps.meta.outputs.target-name }} | ||
| org.opencontainers.image.source=${{ github.event.repository.html_url }} | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
|
|
||
| - name: cosign all images | ||
| if: github.event_name != 'pull_request' | ||
| shell: bash | ||
| run: | | ||
| IFS=',' read -ra TAGS <<< '${{ steps.meta.outputs.tags }}' | ||
Check noticeCode scanning / zizmor code injection via template expansion: may expand into attacker-controllable code Note
code injection via template expansion: may expand into attacker-controllable code
Check noticeCode scanning / zizmor code injection via template expansion Note
code injection via template expansion
|
||
| for tag in "${TAGS[@]}"; do | ||
| pullstring="${tag}@${{ steps.push.outputs.digest }}" | ||
Check noticeCode scanning / zizmor code injection via template expansion: may expand into attacker-controllable code Note
code injection via template expansion: may expand into attacker-controllable code
Check noticeCode scanning / zizmor code injection via template expansion Note
code injection via template expansion
|
||
| echo "Signing ${pullstring}" | ||
| cosign sign --yes "${pullstring}" | ||
| done | ||
| env: | ||
| DIGEST: '${{ steps.push.outputs.digest }}' | ||
| COSIGN_EXPERIMENTAL: 'true' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| FROM rust:1.91-bookworm@sha256:7ccbffbca64e04b1c19647e236b2a41c54eb4ee58891faa43ed70379f264db40 AS build | ||
|
|
||
| RUN apt-get update && apt-get --assume-yes install protobuf-compiler git clang cmake build-essential llvm-dev libclang-dev jq | ||
|
|
||
| WORKDIR /usr/src/app | ||
| COPY . . | ||
| RUN cargo build --release | ||
| RUN mkdir -p /var/lib/edera/protect/falco | ||
| RUN mv ./target/release/libedera_falco_plugin.so /var/lib/edera/protect/falco/ | ||
|
|
||
| FROM scratch | ||
| COPY --from=build /var/lib/edera/protect/falco/libedera_falco_plugin.so /var/lib/edera/protect/falco/libedera_falco_plugin.so |
Check warning
Code scanning / zizmor
permissions without explanatory comments Warning