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 #129

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ updates:
directory: /
schedule:
interval: monthly


- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
rajbos marked this conversation as resolved.
Show resolved Hide resolved

- package-ecosystem: npm
directory: /
schedule:
interval: daily
rajbos marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Lint GitHub Actions workflows
on: [push, pull_request]

permissions: # added using https://github.com/step-security/secure-workflows
rajbos marked this conversation as resolved.
Show resolved Hide resolved
contents: read

jobs:
actionlint:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- run: npm ci
- run: npm run all

dependency-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@c090f4e553673e6e505ea70d6a95362ee12adb94 # v3.0.3
76 changes: 76 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
schedule:
- cron: "0 0 * * 1"

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript", "typescript"]
# CodeQL supports [ $supported-codeql-languages ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@515828d97454b8354517688ddc5b48402b723750 # v2.1.38
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@515828d97454b8354517688ddc5b48402b723750 # v2.1.38

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@515828d97454b8354517688ddc5b48402b723750 # v2.1.38
with:
category: "/language:${{matrix.language}}"
12 changes: 6 additions & 6 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- run: npm ci
- run: npm run all

test-local-action:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

# execute the action locally for testing if anything breaks
- uses: ./
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# get code
- uses: actions/checkout@v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

# build it
- run: |
Expand All @@ -44,10 +44,10 @@ jobs:
# get tag for this release
- name: Get tag value
id: tag
uses: rajbos-actions/action-get-tag@v1
uses: rajbos-actions/action-get-tag@12319896edaa290b27558e34a177804e9b8d077b # v1

# publish a release with the build assets
- uses: rajbos-actions/action-gh-release@v1
- uses: rajbos-actions/action-gh-release@6034af24fba4e5a8e975aaa6056554efe4c794d0 # v1
id: publish
with:
name: Release ${{ steps.tag.outputs.tag }}
Expand All @@ -61,7 +61,7 @@ jobs:
env:
url: ${{ steps.publish.outputs.url }}

- uses: rajbos-actions/slack@v1
- uses: rajbos-actions/slack@e4e71685b9b239384b0f676a63c32367f59c2522 # v1.2.2
with:
status: ${{ job.status }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing-on-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
#if: github.ref == 'refs/heads/main' # don't run on PRs or branches
steps:
- uses: actions/checkout@v3 # this will checkout the compiled Typescript
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 # this will checkout the compiled Typescript

#- uses: hmarr/debug-action@v2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
#if: github.ref == 'refs/heads/main' # don't run on PRs
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- run: npm ci
- run: npm run all

Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
#if: github.ref == 'refs/heads/main' # don't run on PRs or branches
steps:
- uses: actions/checkout@v3 # this will checkout the compiled Typescript
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 # this will checkout the compiled Typescript

#- uses: hmarr/debug-action@v2

Expand Down