Skip to content

Commit

Permalink
[StepSecurity] Apply security best practices (liblouis#1338)
Browse files Browse the repository at this point in the history
* [StepSecurity] Apply security best practices

Signed-off-by: StepSecurity Bot <[email protected]>

* Pin the debian version in all Dockerfiles

* Remove dependency review as we have no dependency manifests

* Enable codeql for cpp

* Change dependabot frequency to weekly

* Change dependabot frequency to monthly

---------

Signed-off-by: StepSecurity Bot <[email protected]>
Co-authored-by: Christian Egli <[email protected]>
  • Loading branch information
step-security-bot and egli authored Apr 13, 2023
1 parent 0fd4c4c commit b6535c4
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 7 deletions.
13 changes: 12 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@ updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
interval: "monthly"


- package-ecosystem: docker
directory: /
schedule:
interval: "monthly"

- package-ecosystem: gomod
directory: /extra/generate-display-names
schedule:
interval: "monthly"
5 changes: 5 additions & 0 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y clang-format-14
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/check-table-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y licensecheck
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,25 @@ jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@027c5886032f59e952af751069dcb3d4cb134c73 # master
with:
oss-fuzz-project-name: 'liblouis'
language: c
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@027c5886032f59e952af751069dcb3d4cb134c73 # master
with:
oss-fuzz-project-name: 'liblouis'
fuzz-seconds: 300
language: c
- name: Upload Crash
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# 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: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
schedule:
- cron: "0 0 * * 1"

permissions:
contents: read

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

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

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
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.

# 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@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7

# ℹ️ 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@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
with:
category: "/language:${{matrix.language}}"
5 changes: 5 additions & 0 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0

# Contains tests and js snippets appended to builds. The tests are
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
ucs: [ucs2]
# ucs4
steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y libyaml-dev texinfo texlive clang llvm
Expand Down Expand Up @@ -56,6 +61,11 @@ jobs:
table: [ afr-za-g1.ctb, afr-za-g2.ctb, ar-ar-comp8.utb, ar-ar-g1.utb, ar-ar-g2.ctb, as-in-g1.utb, aw-in-g1.utb, ba.utb, be-in-g1.utb, bel.utb, bel-comp.utb, bg.ctb, bg.utb, bh.ctb, bo.ctb, boxes.ctb, br-in-g1.utb, ca-g1.ctb, chr-us-g1.ctb, ckb-g1.ctb, cop-eg-comp8.utb, cs-comp8.utb, cs-g1.ctb, cy-cy-g1.utb, cy-cy-g2.ctb, da-dk-g08_1993.ctb, da-dk-g08.ctb, da-dk-g16_1993.ctb, da-dk-g16.ctb, da-dk-g16-lit_1993.ctb, da-dk-g18_1993.ctb, da-dk-g18.ctb, da-dk-g26_1993.ctb, da-dk-g26.ctb, da-dk-g26l_1993.ctb, da-dk-g26-lit_1993.ctb, da-dk-g26l-lit_1993.ctb, da-dk-g28_1993.ctb, da-dk-g28.ctb, da-dk-g28l_1993.ctb, de-chess.ctb, de-comp6.utb, de-de-comp8.ctb, de-g0.utb, de-g0-detailed.utb, de-g1.ctb, de-g1-detailed.ctb, de-g2.ctb, de-g2-detailed.ctb, dra.ctb, el.ctb, en_CA.ctb, en-chess.ctb, en-gb-comp8.ctb, en-gb-g1.utb, en-GB-g2.ctb, en-in-g1.ctb, en-nabcc.utb, en-ueb-g1.ctb, en-ueb-g2.ctb, en-ueb-math.ctb, en-us-comp6.ctb, en-us-comp8.ctb, en-us-comp8-ext.utb, en-us-g1.ctb, en-us-g2.ctb, en-us-interline.ctb, en-us-mathtext.ctb, eo-g1.ctb, eo-g1-x-system.ctb, Es-Es-G0.utb, es-g1.ctb, es-g2.ctb, et.ctb, et-g0.utb, ethio-g1.ctb, fa-ir-comp8.ctb, fa-ir-g1.utb, fi-fi-8dot.ctb, fi.utb, fr-bfu-comp6.utb, fr-bfu-comp8.utb, fr-bfu-g2.ctb, ga-g1.utb, ga-g2.ctb, gd.ctb, gon.ctb, grc-international-en.utb, gu-in-g1.utb, haw-us-g1.ctb, he-IL.utb, he-IL-comp8.utb, hi-in-g1.utb, hr-comp8.utb, hr-g1.ctb, hu-hu-comp8.ctb, hu-hu-g1.ctb, hu-hu-g2.ctb, hy.ctb, IPA.utb, is.ctb, it-it-comp6.utb, it-it-comp8.utb, iu-ca-g1.ctb, ja-kantenji.utb, ka.utb, ka-in-g1.utb, kh-in-g1.utb, kk.utb, km-g1.utb, ko-2006-g1.ctb, ko-2006-g2.ctb, ko-g1.ctb, ko-g2.ctb, kok.ctb, kru.ctb, ks-in-g1.utb, lg-ug-g1.utb, lt-6dot.utb, lt.ctb, Lv-Lv-g1.utb, mao-nz-g1.ctb, ml-in-g1.utb, mn-in-g1.utb, mn-MN-g1.utb, mn-MN-g2.ctb, mr-in-g1.utb, ms-my-g2.ctb, mt.ctb, mun.ctb, mwr.ctb, my-g1.utb, my-g2.ctb, ne.ctb, nl-comp8.utb, nl-NL-g0.utb, no-no-8dot-fallback-6dot-g0.utb, no-no-8dot.utb, no-no-comp8.ctb, no-no-g0.utb, no-no-g1.ctb, no-no-g2.ctb, no-no-g3.ctb, no-no-generic.ctb, np-in-g1.utb, nso-za-g1.utb, nso-za-g2.ctb, ny-mw.utb, or-in-g1.utb, pi.ctb, pl-pl-comp8.ctb, Pl-Pl-g1.utb, pt-pt-comp8.ctb, pt-pt-g1.utb, pt-pt-g2.ctb, pu-in-g1.utb, ro.ctb, ru-compbrl.ctb, ru.ctb, ru-litbrl.ctb, ru-litbrl-detailed.utb, ru-ru-g1.ctb, rw-rw-g1.utb, sa-in-g1.utb, sah.utb, se-se.ctb, si-in-g1.utb, sin.utb, sk-g1.ctb, sk-sk-g1.utb, sk-sk.utb, sl-si-comp8.ctb, sl-si-g1.utb, sot-za-g1.ctb, sot-za-g2.ctb, sr-g1.ctb, sv-1989.ctb, sv-1996.ctb, sv-g0.utb, sv-g1.ctb, sv-g2.ctb, sw-ke-g1-2.ctb, sw-ke-g1-3.ctb, sw-ke-g1-4.ctb, sw-ke-g1-5.ctb, sw-ke-g1.utb, sw-ke-g2.ctb, ta.ctb, ta-ta-g1.ctb, te-in-g1.utb, tr.ctb, tr-g1.ctb, tr-g2.ctb, tsn-za-g1.ctb, tsn-za-g2.ctb, tt.utb, uk.utb, uk-comp.utb, unicode-braille.utb, ur-pk-g1.utb, ur-pk-g2.ctb, uz-g1.utb, ve-za-g1.utb, ve-za-g2.ctb, vi-cb8.utb, vi-saigon-g1.ctb, vi-vn-g0.utb, vi-vn-g1.ctb, vi-vn-g2.ctb, xh-za-g1.utb, xh-za-g2.ctb, zh-chn.ctb, zhcn-cbs.ctb, zhcn-g1.ctb, zhcn-g2.ctb, zh-hk.ctb, zh-tw.ctb, zu-za-g1.utb, zu-za-g2.ctb, ]

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: /home/runner/work/liblouis/liblouis
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/macro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y libyaml-dev
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
ucs: [ucs2, ucs4]

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y libyaml-dev texinfo texlive
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y libyaml-dev texinfo texlive golang
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
PREFIX: /tmp/build/win64

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y autoconf automake curl libtool make mingw-w64 pkg-config texinfo wine64 zip patch
Expand Down Expand Up @@ -81,6 +86,11 @@ jobs:
PREFIX: /tmp/build/win32

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y autoconf automake curl libtool make pkg-config texinfo zip patch
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
- sanitizer: "undefined"
options: "UBSAN_OPTIONS=halt_on_error=1"
steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y libyaml-dev
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
# actions: read

steps:
- name: Harden Runner
uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- name: "Checkout code"
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.1.0
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:jessie
FROM debian:jessie@sha256:32ad5050caffb2c7e969dac873bce2c370015c2256ff984b70c1c08b3a2816a0

LABEL maintainer="Liblouis Maintainers <[email protected]>"

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.win32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:latest AS builder
FROM debian:jessie@sha256:32ad5050caffb2c7e969dac873bce2c370015c2256ff984b70c1c08b3a2816a0 AS builder

LABEL maintainer="Liblouis Maintainers <[email protected]>"

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.win64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:latest AS builder
FROM debian:jessie@sha256:32ad5050caffb2c7e969dac873bce2c370015c2256ff984b70c1c08b3a2816a0 AS builder

LABEL maintainer="Liblouis Maintainers <[email protected]>"

Expand Down

0 comments on commit b6535c4

Please sign in to comment.