Skip to content
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

[StepSecurity] Apply security best practices #63

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: 'Build container image'
Expand All @@ -23,6 +26,11 @@
IMAGE_TAG: 'experimental ${{ github.sha }}'

steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@v2

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
egress-policy: audit

- name: 'Checkout'
uses: actions/checkout@v4

Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/prettify.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/security-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# TODO: Experimental feature
name: 'CI/Security-Dependencies'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
name: 'Dependency analysis'
runs-on: ubuntu-latest
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@v2

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
egress-policy: audit

- name: 'Checkout'
uses: actions/checkout@v4
Dismissed Show dismissed Hide dismissed

- name: 'Dependency Review'
uses: actions/dependency-review-action@v4

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
43 changes: 41 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
# TODO: Experimental feature
name: 'CI/Security'
on:
schedule:
- cron: '44 1 * * 0'
- cron: '33 3 * * 1'
push:
branches: ['dev']
paths-ignore:
- '*.md'
- '.*ignore'
pull_request:
branches: ['dev']
paths-ignore:
- '*.md'
- '.*ignore'

permissions: read-all

jobs:
codeql:
name: 'CodeQL analysis'
runs-on: ubuntu-latest
permissions:
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript', 'typescript']

steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@v2

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
egress-policy: audit

- name: 'Checkout'
uses: actions/checkout@v4

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue

- name: 'Setup CodeQL'
uses: github/codeql-action/init@v3

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
languages: '${{ matrix.language }}'

- name: 'Run analysis'
uses: github/codeql-action/analyze@v3

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
category: '/language:${{matrix.language}}'

scoreboard:
name: 'Scorecard analysis'
runs-on: ubuntu-latest
Expand All @@ -20,6 +54,11 @@
id-token: write

steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@v2

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
egress-policy: audit

- name: 'Checkout'
uses: actions/checkout@v4
with:
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
name: "Test suite"
name: 'Test suite'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@v2

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium test

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
egress-policy: audit

- name: 'Checkout'
uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm run fix
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"fix": "pnpm run prettier && pnpm run lint",
"lint": "pnpm run lint:tsc",
"lint:tsc": "pnpm exec tsc --noEmit",
"prepare": "husky",
"prettier": "pnpm exec prettier . --write",
"prod": "pnpm run build && pnpm run start",
"start": "pnpm exec next start"
Expand All @@ -35,6 +36,7 @@
"zustand": "^4.5.0"
},
"devDependencies": {
"husky": "^9.0.2",
"prettier": "^3.2.4",
"prettier-plugin-jsdoc": "^1.3.0",
"prettier-plugin-packagejson": "^2.4.9"
Expand Down
Loading
Loading