Skip to content

Commit fb61fb9

Browse files
authored
Merge pull request #31 from dash14/security/add-ignore-scripts-to-examples
Add --ignore-scripts to npm install in example Dockerfiles
2 parents dd3b478 + c11d6fb commit fb61fb9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/workflows/example-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
cat <<'EOF' > /tmp/build-context/Dockerfile
2828
FROM node:24-alpine
2929
WORKDIR /app
30-
RUN npm init -y && npm install express
30+
RUN npm init -y && npm install --ignore-scripts express
3131
EOF
3232
3333
- name: Build test image

.github/workflows/example-restrict.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
cat <<'EOF' > /tmp/build-context/Dockerfile
3131
FROM node:24-alpine
3232
WORKDIR /app
33-
RUN npm init -y && npm install express
33+
RUN npm init -y && npm install --ignore-scripts express
3434
RUN wget -q -O /dev/null --timeout=5 https://example.com/ || true
3535
EOF
3636

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ run_audit_example: ## Run audit mode example tests
8787
@printf '%s\n' \
8888
"FROM node:24-alpine" \
8989
"WORKDIR /app" \
90-
"RUN npm init -y && npm install express" \
90+
"RUN npm init -y && npm install --ignore-scripts express" \
9191
> /tmp/build-context/Dockerfile
9292
docker buildx build --no-cache \
9393
--builder buildcage \
@@ -107,7 +107,7 @@ run_restrict_example: ## Run restrict mode example tests
107107
@printf '%s\n' \
108108
"FROM node:24-alpine" \
109109
"WORKDIR /app" \
110-
"RUN npm init -y && npm install express" \
110+
"RUN npm init -y && npm install --ignore-scripts express" \
111111
"RUN wget -q -O /dev/null --timeout=5 https://example.com/ || true" \
112112
> /tmp/build-context/Dockerfile
113113
docker buildx build --no-cache \

0 commit comments

Comments
 (0)