Skip to content

Commit

Permalink
build kernel object with armo image
Browse files Browse the repository at this point in the history
  • Loading branch information
rcohencyberarmor committed Dec 25, 2022
1 parent 5551527 commit 39cd436
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ jobs:
id: image-version
run: echo '::set-output name=IMAGE_VERSION::v0.0.${{ github.run_number }}'

- name: Set image name
id: image-name
- name: Set userspace image name
id: image-name-userspace
run: echo '::set-output name=IMAGE_NAME::quay.io/${{ github.repository_owner }}/sneeffer'

- name: Set kernelspace image name
id: image-name-kernelspace
run: echo '::set-output name=IMAGE_NAME::quay.io/${{ github.repository_owner }}/sneeffer-kernel'

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand All @@ -81,7 +85,13 @@ jobs:
QUAY_USERNAME: ${{ secrets.QUAYIO_REGISTRY_USERNAME }}
run: docker login -u="${QUAY_USERNAME}" -p="${QUAY_PASSWORD}" quay.io

- name: Build the Docker image
- name: Build the kernel space Docker image

run: docker buildx build . --file ./kernel/Dockerfile_build_kernel_obj --tag ${{ steps.image-name-kernelspace.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} --tag ${{ steps.image-name-kernelspace.outputs.IMAGE_NAME }}:latest --build-arg image_version=${{ steps.image-version.outputs.IMAGE_VERSION }} --push

- name: Build the userspace Docker image

run: docker buildx build . --file ./Dockerfile --tag ${{ steps.image-name.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} --tag ${{ steps.image-name.outputs.IMAGE_NAME }}:latest --build-arg image_version=${{ steps.image-version.outputs.IMAGE_VERSION }} --push
run: docker buildx build . --file ./Dockerfile --tag ${{ steps.image-name-userspace.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} --tag ${{ steps.image-name-userspace.outputs.IMAGE_NAME }}:latest --build-arg image_version=${{ steps.image-version.outputs.IMAGE_VERSION }} --push



10 changes: 10 additions & 0 deletions kernel/Dockerfile_build_kernel_obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:latest as builder

RUN apt update && apt install git curl llvm clang cmake make libelf-dev golang-go -y

RUN git clone https://github.com/falcosecurity/libs.git /etc/falco-libs
WORKDIR /etc/falco-libs
RUN git checkout 5a02ca746cda9866d574061fc61c146dae906526
COPY ./kernel/entrypoint.sh /etc/entrypoint.sh

ENTRYPOINT ["/etc/entrypoint.sh"]
8 changes: 8 additions & 0 deletions kernel/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -x

apt install linux-headers-$(uname -r) -y
mkdir /etc/falco-libs/build && cd /etc/falco-libs/build
cmake -DBUILD_BPF=true -DINSTALL_GTEST=OFF ../
make bpf
cp /etc/falco-libs/build/driver/bpf/probe.o /root/.falco/falco-bpf.o

0 comments on commit 39cd436

Please sign in to comment.