Skip to content

Commit a5a5c5f

Browse files
committed
First security update in 3ys
Switch Docker container to run as unprivileged user (nobody), switch seccomp to DENY by default, deny clone as we are running in an environment without cgroups. Remove old deployments infrastructure.
1 parent ecc2fb0 commit a5a5c5f

File tree

17 files changed

+10
-585
lines changed

17 files changed

+10
-585
lines changed

.github/workflows/build-and-trigger-deploy.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
env:
1111
IMAGEID: rapidlua/luajit.me
12-
PACKERV: 1.5.1
1312

1413
jobs:
1514
version-stamp:
@@ -21,22 +20,6 @@ jobs:
2120
- uses: actions/[email protected]
2221
with: { name: version, path: version }
2322

24-
cloud-images:
25-
runs-on: ubuntu-latest
26-
needs: version-stamp
27-
steps:
28-
- name: Install packer
29-
run: >
30-
curl https://releases.hashicorp.com/packer/${PACKERV}/packer_${PACKERV}_linux_$(dpkg --print-architecture).zip > packer.zip &&
31-
unzip packer.zip &&
32-
sudo install packer /usr/bin &&
33-
rm packer.zip packer
34-
- uses: actions/checkout@v1
35-
- uses: actions/[email protected]
36-
with: { name: version }
37-
- name: Build cloud images
38-
run: packer build -var "version=$(cat version/version)" -var "digitalocean_token=${{ secrets.DIGITALOCEAN_TOKEN }}" deployments/cloud-images.json
39-
4023
docker-image-amd64:
4124
runs-on: ubuntu-latest
4225
needs: version-stamp
@@ -54,7 +37,7 @@ jobs:
5437

5538
postprocess-and-trigger-deploy:
5639
runs-on: ubuntu-latest
57-
needs: [version-stamp, cloud-images, docker-image-amd64]
40+
needs: [version-stamp, docker-image-amd64]
5841
steps:
5942
- uses: actions/[email protected]
6043
with: { name: version }
@@ -77,11 +60,3 @@ jobs:
7760
docker manifest create "${IMAGEID}:latest" "${IID}-amd64" &&
7861
docker manifest push "${IMAGEID}:latest"
7962
fi
80-
- name: Trigger deploy
81-
run: >
82-
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
83-
ENV=production; REF=${GITHUB_REF}
84-
else
85-
ENV=staging; REF=${GITHUB_SHA}
86-
fi;
87-
curl -sd "{\"ref\":\"${REF}\",\"required_contexts\":[],\"environment\":\"${ENV}\",\"payload\":{\"version\":\"$(cat version/version)\"}}" https://api.github.com/repos/${GITHUB_REPOSITORY}/deployments -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"

.github/workflows/cloud-gc.js

Lines changed: 0 additions & 199 deletions
This file was deleted.

.github/workflows/cloud-gc.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RUN mkdir -p /root/dist/usr/src/luajit.me \
4040
# Lua runtime dependencies
4141
#
4242
#######################################################################
43-
FROM alpine AS lua-img-base
43+
FROM alpine:3.9 AS lua-img-base
4444

4545
# install lua runtime dependencies
4646
RUN apk update && apk upgrade && apk add libgcc
@@ -59,7 +59,7 @@ RUN find / -xdev | sed -e '/[/]\(root\|run\)[/]/d' > /root/system-files.list &&
5959
# also includes some of the source code to build
6060
#
6161
#######################################################################
62-
FROM alpine AS c-src-builder
62+
FROM alpine:3.9 AS c-src-builder
6363

6464
# install build dependencies
6565
RUN apk update && apk upgrade && \
@@ -128,7 +128,7 @@ RUN REV=v2.1.0-beta3 GC64=1 /root/dist-build.sh
128128
# combines bits and pieces together
129129
#
130130
#######################################################################
131-
FROM alpine AS luajit.me.staging
131+
FROM alpine:3.9 AS luajit.me.staging
132132
RUN apk add fdupes
133133

134134
RUN mkdir -p /root/dist/usr/lib/luajit.me/images/dev/shm
@@ -151,4 +151,5 @@ FROM node:10-alpine AS luajit.me
151151
COPY --from=luajit.me.staging root/dist /
152152

153153
EXPOSE 8000
154+
USER nobody
154155
CMD ["node", "/usr/src/luajit.me/server/app.js"]

deployments/cloud-images.json

Lines changed: 0 additions & 41 deletions
This file was deleted.

deployments/modules/backend/app.nginx.conf

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)