-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Linux packages: rpm, deb, apk #98
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
base: main
Are you sure you want to change the base?
Changes from all commits
1f4c620
683a3bf
7a77d11
82a7004
2d086a8
989ef3b
466987f
d88869b
f99efb7
b1e6a3d
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,27 @@ | ||
| FROM golang:1.25-alpine AS go-builder | ||
|
|
||
| FROM alpine:3.21 | ||
|
|
||
| COPY --from=go-builder /usr/local/go /usr/local/go | ||
| ENV PATH="/usr/local/go/bin:/root/go/bin:/root/.cargo/bin:${PATH}" | ||
| ENV GOPATH="/root/go" | ||
|
|
||
| RUN apk add --no-cache \ | ||
| build-base git make curl sudo pkgconf \ | ||
| rpm \ | ||
| ruby ruby-dev \ | ||
| nodejs npm py3-pip \ | ||
| wayland-dev libx11-dev libxkbcommon-dev mesa-dev libxcursor-dev vulkan-loader-dev libffi-dev \ | ||
| perl dpkg dpkg-dev xz wget | ||
|
|
||
| RUN gem install fpm --no-document | ||
|
|
||
| RUN cd /tmp && \ | ||
| wget -q "https://deb.debian.org/debian/pool/main/a/alien/alien_8.95.8.tar.xz" && \ | ||
| tar xf alien_8.95.8.tar.xz && \ | ||
| cd alien && perl Makefile.PL && make && make install && \ | ||
| cd / && rm -rf /tmp/alien* | ||
|
|
||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
|
||
| WORKDIR /workspace | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "SafeChain Ultimate - Alpine", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
| "remoteUser": "root" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| FROM golang:1.25 AS go-builder | ||
|
|
||
| FROM quay.io/centos/centos:stream10 | ||
|
|
||
| COPY --from=go-builder /usr/local/go /usr/local/go | ||
| ENV PATH="/usr/local/go/bin:/root/go/bin:/root/.cargo/bin:${PATH}" | ||
| ENV GOPATH="/root/go" | ||
|
|
||
| RUN dnf install -y epel-release && \ | ||
| dnf config-manager --set-enabled crb && \ | ||
| dnf install -y \ | ||
| gcc gcc-c++ git make cmake curl sudo pkgconf clang-devel procps-ng \ | ||
| rpm-build \ | ||
| dpkg \ | ||
| ruby ruby-devel \ | ||
| nodejs npm python3-pip \ | ||
| perl wget xz \ | ||
| wayland-devel libX11-devel libxkbcommon-devel libxkbcommon-x11-devel \ | ||
| mesa-libGLES-devel mesa-libEGL-devel libffi-devel libXcursor-devel vulkan-loader-devel \ | ||
| && gem install fpm --no-document \ | ||
| && dnf clean all | ||
|
|
||
| RUN cd /tmp && \ | ||
| wget -q "https://deb.debian.org/debian/pool/main/a/alien/alien_8.95.8.tar.xz" && \ | ||
| tar xf alien_8.95.8.tar.xz && \ | ||
| cd alien && perl Makefile.PL && make && make install && \ | ||
| cd / && rm -rf /tmp/alien* | ||
|
|
||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Binary, code or archive is pulled from a remote source without integrity verification - medium severity Remediation: Validate the artifact against a trusted SHA-512 checksum in the CI/CD pipeline using |
||
|
|
||
| WORKDIR /workspace | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "SafeChain Ultimate - CentOS Stream 10", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
| "remoteUser": "root" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| FROM golang:1.25 AS go-builder | ||
|
|
||
| FROM debian:12 | ||
|
|
||
| COPY --from=go-builder /usr/local/go /usr/local/go | ||
| ENV PATH="/usr/local/go/bin:/root/go/bin:/root/.cargo/bin:${PATH}" | ||
| ENV GOPATH="/root/go" | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| build-essential git make curl sudo pkg-config \ | ||
| rpm alien \ | ||
| ruby ruby-dev \ | ||
| nodejs npm python3-pip \ | ||
| libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev \ | ||
| libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev \ | ||
| && gem install fpm --no-document \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Binary, code or archive is pulled from a remote source without integrity verification - medium severity Remediation: Validate the artifact against a trusted SHA-512 checksum in the CI/CD pipeline using |
||
|
|
||
| WORKDIR /workspace | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "SafeChain Ultimate - Debian", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
| "remoteUser": "root" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| FROM golang:1.25 AS go-builder | ||
|
|
||
| FROM ubuntu:24.04 | ||
|
|
||
| COPY --from=go-builder /usr/local/go /usr/local/go | ||
| ENV PATH="/usr/local/go/bin:/root/go/bin:/root/.cargo/bin:${PATH}" | ||
| ENV GOPATH="/root/go" | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| build-essential git make curl sudo pkg-config \ | ||
| rpm alien \ | ||
| ruby ruby-dev \ | ||
| nodejs npm python3-pip \ | ||
| libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev \ | ||
| libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev \ | ||
| && gem install fpm --no-document \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Binary, code or archive is pulled from a remote source without integrity verification - medium severity Remediation: Validate the artifact against a trusted SHA-512 checksum in the CI/CD pipeline using |
||
|
|
||
| WORKDIR /workspace | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "SafeChain Ultimate - Ubuntu", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
| "remoteUser": "root" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| name: Build Linux Packages | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| build-unix: | ||
| uses: ./.github/workflows/build-unix.yml | ||
| with: | ||
| version: ${{ inputs.version || 'dev' }} | ||
|
|
||
| build-rpm: | ||
| needs: build-unix | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - arch: amd64 | ||
| runner: ubuntu-latest | ||
| - arch: arm64 | ||
| runner: ubuntu-24.04-arm | ||
|
|
||
| runs-on: ${{ matrix.runner }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Download agent artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: safechain-ultimate-linux-${{ matrix.arch }} | ||
| path: bin | ||
|
|
||
| - name: Download agent ui artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: safechain-ultimate-ui-linux-${{ matrix.arch }} | ||
| path: bin | ||
|
|
||
| - name: Download proxy artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: safechain-proxy-linux-${{ matrix.arch }} | ||
| path: bin | ||
|
|
||
| - name: Verify binaries exist | ||
| run: | | ||
| ls -lh bin/ | ||
| ls -lh bin/safechain-ultimate-linux-${{ matrix.arch }} | ||
| ls -lh bin/safechain-ultimate-ui-linux-${{ matrix.arch }} | ||
| ls -lh bin/safechain-proxy-linux-${{ matrix.arch }} | ||
|
|
||
| - name: Install packaging tools | ||
| run: | | ||
| sudo apt-get update && sudo apt-get install -y rpm alien ruby ruby-dev | ||
| sudo gem install fpm --no-document | ||
|
|
||
| - name: Build RPM | ||
| run: | | ||
| cd packaging/rpm | ||
| ./build-rpm.sh -v "${{ inputs.version || 'dev' }}" -a "${{ matrix.arch }}" -b "../../bin" -o "../../dist" | ||
|
|
||
| - name: Convert RPM to DEB using alien | ||
| run: | | ||
| cd dist | ||
| sudo alien --to-deb --keep-version SafeChainUltimate-${{ inputs.version || 'dev' }}-${{ matrix.arch }}.rpm | ||
|
|
||
| - name: Convert RPM to APK using fpm | ||
| run: | | ||
| cd dist | ||
| fpm -s rpm -t apk -p SafeChainUltimate-${{ matrix.arch }}.apk SafeChainUltimate-${{ inputs.version || 'dev' }}-${{ matrix.arch }}.rpm | ||
|
|
||
| - name: Rename packages | ||
| run: | | ||
| mv dist/SafeChainUltimate-${{ inputs.version || 'dev' }}-${{ matrix.arch }}.rpm dist/SafeChainUltimate-${{ matrix.arch }}.rpm | ||
| mv dist/safechain-ultimate_*.deb dist/SafeChainUltimate-${{ matrix.arch }}.deb | ||
|
|
||
| - name: Upload RPM artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: SafeChainUltimate-${{ matrix.arch }}.rpm | ||
| path: dist/SafeChainUltimate-${{ matrix.arch }}.rpm | ||
|
|
||
| - name: Upload DEB artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: SafeChainUltimate-${{ matrix.arch }}.deb | ||
| path: dist/SafeChainUltimate-${{ matrix.arch }}.deb | ||
|
|
||
| - name: Upload APK artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: SafeChainUltimate-${{ matrix.arch }}.apk | ||
| path: dist/SafeChainUltimate-${{ matrix.arch }}.apk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Binary, code or archive is pulled from a remote source without integrity verification - medium severity
A Docker container was built using an artifact from a remote source without any integrity verification. If the remote artifact were silently replaced with a malicious version (for example, through a supply chain attack), the integrity and confidentiality of the environment in which the container is deployed could be compromised.
Remediation: Validate the artifact against a trusted SHA-512 checksum in the CI/CD pipeline using
sha512sumin check mode. Store the expected checksum in a file (e.g.,artifact.sha512), then verify it with:sha512sum -c artifact.sha512. Enable strict error handling (for example,set -ein shell scripts) so the pipeline fails if verification fails or outputs errors.View details in Aikido Security