Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
[StepSecurity] Apply security best practices
Browse files Browse the repository at this point in the history
Signed-off-by: StepSecurity Bot <[email protected]>
  • Loading branch information
step-security-bot authored and pdxjohnny committed Jan 3, 2024
1 parent 33338d2 commit 3d2fe3b
Show file tree
Hide file tree
Showing 25 changed files with 338 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/python:3.9 AS builder
FROM docker.io/library/python:3.9@sha256:30678bb79d9eeaf98ec0ce83cdcd4d6f5301484ef86873a711e69df2ca77e8ac AS builder

COPY images_containers_manifest.py /images_containers_manifest.py

Expand Down
65 changes: 65 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,68 @@ updates:
directory: /
schedule:
interval: daily

- package-ecosystem: docker
directory: /.github/actions/create_manifest_instance_build_images_containers
schedule:
interval: daily

- package-ecosystem: docker
directory: /dffml/skel/operations
schedule:
interval: daily

- package-ecosystem: docker
directory: /examples/ffmpeg
schedule:
interval: daily

- package-ecosystem: pip
directory: /examples/innersource/swportal
schedule:
interval: daily

- package-ecosystem: pip
directory: /examples
schedule:
interval: daily

- package-ecosystem: docker
directory: /operations/binsec
schedule:
interval: daily

- package-ecosystem: docker
directory: /operations/data
schedule:
interval: daily

- package-ecosystem: docker
directory: /operations/deploy
schedule:
interval: daily

- package-ecosystem: docker
directory: /operations/image
schedule:
interval: daily

- package-ecosystem: docker
directory: /operations/neo4j
schedule:
interval: daily

- package-ecosystem: docker
directory: /operations/nlp
schedule:
interval: daily

- package-ecosystem: docker
directory: /service/http
schedule:
interval: daily

- package-ecosystem: pip
directory: /service/ossse
schedule:
interval: daily
7 changes: 6 additions & 1 deletion .github/workflows/alice_async_comms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:
name: Create Async Comms Posts in Relevant Locations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Post engineering log entry
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ on:
type: string


permissions:
contents: read

jobs:
contribute:
name: Contribute
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Set up Python 3.9
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.9
- name: Configure git user info
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/alice_shouldi_contribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ on:
type: string


permissions:
contents: read

jobs:
collector:
name: Collector
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Set up Python 3.9
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.9
- name: Configure git user info
Expand Down Expand Up @@ -59,7 +67,7 @@ jobs:
set -x
pwd
alice shouldi contribute -keys "${REPO_URL}" -log debug
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: collector_output
path: .tools/open-architecture/innersource/repos.json
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build_images_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ on:
type: string
description: 'https://github.com/intel/dffml/tree/main/schema/dffml/image/container/build/0.0.1.schema.json'

permissions:
contents: read

jobs:
build:
name: Build container images
Expand All @@ -63,7 +66,12 @@ jobs:
max-parallel: 40
matrix: ${{ fromJSON(inputs.manifests) }}
steps:
- uses: actions/checkout@v4
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: '${{ github.repository }}'
ref: '${{ matrix.commit }}'
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: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
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: ["javascript", "python"]
# 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@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

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

# ℹ️ 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@1500a131381b66de0c52ac28abb13cd79f4b7ecc # v2.22.12
with:
category: "/language:${{matrix.language}}"
27 changes: 27 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: 'Dependency Review'
uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1
7 changes: 6 additions & 1 deletion .github/workflows/dffml_build_images_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
length: ${{ steps.create-manifest-instance.outputs.length }}
manifest: ${{ steps.create-manifest-instance.outputs.github_actions_manifest }}
steps:
- uses: actions/checkout@v4
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build manifest from changed dockerfiles
uses: "./.github/actions/create_manifest_instance_build_images_containers"
id: create-manifest-instance
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/dispatch_build_images_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ jobs:
outputs:
manifest: ${{ steps.create-manifest-instance.outputs.manifest }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Set up Python 3.9
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.9
- name: Build manifest
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/new_2nd_party_tcb_eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:
repo_name: ${{ steps.issue-parser.outputs.issueparser_repo_name }}
runs-on: ubuntu-latest
steps:
- uses: stefanbuck/github-issue-parser@v3
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: stefanbuck/github-issue-parser@51ca3d60963b9cea813101636b0c596945082867 # v3
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/new_plugin.yml
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/pin_downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
manifest:
runs-on: ubuntu-latest
Expand All @@ -25,11 +28,16 @@ jobs:
length: ${{ steps.create-manifest-instance.outputs.length }}
manifest: ${{ steps.create-manifest-instance.outputs.github_actions_manifest }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.11"
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build manifest from plugins.json from pull request
id: create-manifest-instance
env:
Expand Down Expand Up @@ -70,6 +78,8 @@ jobs:
pin_downstream_pep_440:
permissions:
contents: write # for Git to git push
name: "Pin downstream to latest commit"
runs-on: ubuntu-latest
# Disabled currently
Expand All @@ -88,6 +98,11 @@ jobs:
max-parallel: 100
matrix: ${{ fromJSON(needs.manifest.outputs.manifest) }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Checkout downstream
env:
# TODO Pull requests on pull requests, probably from renovate/dependabot
Expand Down
Loading

0 comments on commit 3d2fe3b

Please sign in to comment.