Skip to content

Commit 87cbc16

Browse files
committed
ci: address OSSF Scorecard warnings (#243)
* remediate the `Token-Permissions` warning/low score by moving the F5 CLA GH Action permissions around * remediate the `Pinned-Dependencies` warning/low score by using specific Docker image SHAs and adding Docker image updates to Dependabot * hopefully remediate the `Vulnerabilities` warning/low score by recreating `package-lock.json` * ci: add `workflow_dispatch` and cron jobs to both the Scorecard and the S3 gateway build actions be able to run the workflow on demand and run the workflow at least once a week in case there's been no new builds/PRs in the last week
1 parent 62caea4 commit 87cbc16

File tree

12 files changed

+361
-256
lines changed

12 files changed

+361
-256
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
version: 2
33
updates:
4+
- package-ecosystem: docker
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
day: monday
9+
time: "00:00"
410
- package-ecosystem: github-actions
511
directory: /
612
schedule:

.github/workflows/f5-cla.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
---
12
name: F5 CLA
23
on:
34
issue_comment:
45
types: [created]
56
pull_request_target:
67
types: [opened, closed, synchronize]
7-
8-
permissions:
9-
actions: write
10-
pull-requests: write
11-
statuses: write
12-
8+
permissions: read-all
139
jobs:
1410
f5-cla:
11+
name: F5 CLA
1512
runs-on: ubuntu-22.04
13+
permissions:
14+
actions: write
15+
pull-requests: write
16+
statuses: write
1617
steps:
1718
- name: Run F5 Contributor License Agreement (CLA) assistant
1819
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have hereby read the F5 CLA and agree to its terms') || github.event_name == 'pull_request_target'
@@ -31,7 +32,7 @@ jobs:
3132
remote-repository-name: 'f5-cla-data'
3233
path-to-signatures: 'signatures/beta/signatures.json'
3334
# Comma separated list of usernames for maintainers or any other individuals who should not be prompted for a CLA.
34-
allowlist: 4141done, dekobon, bot*
35+
allowlist: 4141done, alessfg, dekobon, bot*
3536
# Do not lock PRs after a merge.
3637
lock-pullrequest-aftermerge: false
3738
env:

.github/workflows/ossf_scorecard.yml renamed to .github/workflows/ossf-scorecard.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ name: OSSF Scorecard
44
on:
55
# For Branch-Protection check. Only the default branch is supported. See https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection.
66
branch_protection_rule:
7+
push:
8+
branches: [main]
79
# To guarantee Maintained check is occasionally updated. See https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained.
810
schedule:
911
- cron: "0 0 * * 1"
10-
push:
11-
branches: [main]
12+
workflow_dispatch:
1213
# Declare default permissions as read only.
1314
permissions: read-all
1415
jobs:

.github/workflows/main.yml renamed to .github/workflows/s3-gateway.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
2-
name: CI
2+
name: NGINX S3 Gateway CI/CD
33
on:
44
push:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
schedule:
9+
- cron: "0 0 * * 1"
10+
workflow_dispatch:
811
env:
912
CI: true
1013
permissions: read-all
@@ -24,6 +27,7 @@ permissions: read-all
2427

2528
jobs:
2629
build-oss-for-test:
30+
name: Build NGINX OSS image
2731
runs-on: ubuntu-22.04
2832
steps:
2933
- name: Check out the codebase
@@ -49,6 +53,7 @@ jobs:
4953
if-no-files-found: error
5054

5155
test-oss:
56+
name: Test NGINX OSS image
5257
runs-on: ubuntu-22.04
5358
needs: build-oss-for-test
5459
strategy:
@@ -91,6 +96,7 @@ jobs:
9196
run: S3_STYLE=${{ matrix.path_style }} ./test.sh --type oss
9297

9398
build-latest-njs-for-test:
99+
name: Build NGINX OSS image using latest njs commit
94100
runs-on: ubuntu-22.04
95101
needs: test-oss
96102
steps:
@@ -134,6 +140,7 @@ jobs:
134140
if-no-files-found: error
135141

136142
test-latest-njs:
143+
name: Test NGINX OSS image using latest njs commit
137144
runs-on: ubuntu-22.04
138145
needs: build-latest-njs-for-test
139146
steps:
@@ -174,6 +181,7 @@ jobs:
174181
run: ./test.sh --latest-njs --type oss
175182

176183
build-unprivileged-for-test:
184+
name: Build NGINX OSS unprivileged image
177185
runs-on: ubuntu-22.04
178186
needs: test-oss
179187
steps:
@@ -217,6 +225,7 @@ jobs:
217225
if-no-files-found: error
218226

219227
test-unprivileged:
228+
name: Test NGINX OSS unprivileged image
220229
runs-on: ubuntu-22.04
221230
needs: build-unprivileged-for-test
222231
steps:
@@ -258,6 +267,7 @@ jobs:
258267

259268
# As a last step (only if run from main) multi-architecture images are built and pushed to Docker Hub and the GitHub Container Registry
260269
tag-and-push:
270+
name: Tag and push all built and tested NGINX images
261271
runs-on: ubuntu-22.04
262272
needs: [test-oss, test-latest-njs, test-unprivileged]
263273
if: |

Dockerfile.buildkit.plus

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bookworm-slim
1+
FROM debian:bookworm-slim@sha256:155280b00ee0133250f7159b567a07d7cd03b1645714c3a7458b2287b0ca83cb
22

33
ENV NGINX_PLUS_VERSION 30-2
44
ENV NGINX_VERSION 1.25.1

Dockerfile.oss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM nginx:1.25.3
1+
FROM nginx:1.25.5@sha256:711cc227e3c4181ab27cde13cf662f6dd1d06d16b3344f871c6d04cbff22f6f8
22

3-
ENV NGINX_VERSION "1.25.3"
4-
ENV NJS_VERSION "0.8.2"
3+
ENV NGINX_VERSION 1.25.5
4+
ENV NJS_VERSION 0.8.4
5+
ENV NJS_RELEASE 3~bookworm
56

67
ENV PROXY_CACHE_MAX_SIZE "10g"
78
ENV PROXY_CACHE_INACTIVE "60m"
@@ -32,12 +33,12 @@ RUN set -eux \
3233
mkdir -p /var/cache/nginx/s3_proxy; \
3334
chown nginx:nginx /var/cache/nginx/s3_proxy; \
3435
chmod -R -v +x /docker-entrypoint.sh /docker-entrypoint.d/*.sh; \
35-
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/mainline/debian/ $(echo $PKG_RELEASE | cut -f2 -d~) nginx" >> /etc/apt/sources.list.d/nginx.list; \
36+
echo "deb [signed-by=/etc/apt/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/mainline/debian/ $(echo $PKG_RELEASE | cut -f2 -d~) nginx" >> /etc/apt/sources.list.d/nginx.list; \
3637
apt-get update; \
3738
apt-get install --no-install-recommends --no-install-suggests --yes \
3839
curl \
3940
libedit2 \
40-
nginx-module-njs=${NGINX_VERSION}+${NJS_VERSION}-${PKG_RELEASE}; \
41+
nginx-module-njs=${NGINX_VERSION}+${NJS_VERSION}-${NJS_RELEASE}; \
4142
apt-get remove --purge --auto-remove --yes; \
4243
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list
4344

Dockerfile.plus

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM debian:bookworm-slim
1+
FROM debian:bookworm-slim@sha256:155280b00ee0133250f7159b567a07d7cd03b1645714c3a7458b2287b0ca83cb
22

33
ENV NGINX_PLUS_VERSION 30-2
44
ENV NGINX_VERSION 1.25.1
55
ENV NJS_VERSION 30+0.8.0-1
66
ENV XSLT_VERSION 30-1
7-
7+
88
ENV PROXY_CACHE_MAX_SIZE "10g"
99
ENV PROXY_CACHE_INACTIVE "60m"
1010
ENV PROXY_CACHE_SLICE_SIZE "1m"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
[![CI](https://github.com/nginxinc/nginx-s3-gateway/actions/workflows/main.yml/badge.svg)](https://github.com/nginxinc/nginx-s3-gateway/actions/workflows/main.yml)
1+
[![NGINX S3 Gateway CI/CD](https://github.com/nginxinc/nginx-s3-gateway/actions/workflows/s3-gateway.yml/badge.svg)](https://github.com/nginxinc/nginx-s3-gateway/actions/workflows/s3-gateway.yml)
22
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-s3-gateway/badge)](https://securityscorecards.dev/viewer/?uri=github.com/nginxinc/nginx-s3-gateway)
33
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
4-
[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](/SUPPORT.md))
4+
[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](/SUPPORT.md)
55
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](/CODE_OF_CONDUCT.md)
66

77
# NGINX S3 Gateway

examples/brotli-compression/Dockerfile.oss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
FROM nginxinc/nginx-s3-gateway
2-
1+
FROM nginxinc/nginx-s3-gateway@sha256:8aa48324479b3653b5936183cc97f2ca1aa9078d229042f1bca357834bd906f4
32
ENV BROTLI_VERSION "v1.0.0rc"
43

54
# Build Brotli module from source because there is no repository package
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM nginxinc/nginx-s3-gateway
1+
FROM nginxinc/nginx-s3-gateway@sha256:8aa48324479b3653b5936183cc97f2ca1aa9078d229042f1bca357834bd906f4
22

33
COPY etc/nginx/conf.d /etc/nginx/conf.d

0 commit comments

Comments
 (0)