diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5694221..431cc26 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,4 +15,9 @@ updates: directory: "/" schedule: # Check for updates to GitHub Actions every week - interval: "weekly" \ No newline at end of file + interval: "weekly" + + - package-ecosystem: docker + directory: / + schedule: + interval: daily diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..1ed6eeb --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,73 @@ +# 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: ["python"] + # 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@928ff8c822d966a999092a6a35e32177899afb7c # v2.24.6 + 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@928ff8c822d966a999092a6a35e32177899afb7c # v2.24.6 + + # ℹī¸ 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@928ff8c822d966a999092a6a35e32177899afb7c # v2.24.6 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/deny.yml b/.github/workflows/deny.yml index 4008a59..56cf206 100644 --- a/.github/workflows/deny.yml +++ b/.github/workflows/deny.yml @@ -21,11 +21,11 @@ jobs: continue-on-error: ${{ matrix.checks == 'sources' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - run: git config --global http.postBuffer 524288000 - run: git config --global http.sslVerify "false" - run: git submodule update --init --recursive --depth 1 - run: bash sh_script/pre-build.sh - - uses: EmbarkStudios/cargo-deny-action@v1 + - uses: EmbarkStudios/cargo-deny-action@64015a69ee7ee08f6c56455089cdaf6ad974fd15 # v1.6.1 with: command: check ${{ matrix.checks }} \ No newline at end of file diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index aa585d8..95f0f43 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Initialize and update submodules run: | @@ -29,16 +29,16 @@ jobs: # Install first since it's needed to build NASM - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e # v1 with: version: "10.0" directory: ${{ runner.temp }}/llvm - name: install NASM - uses: ilammy/setup-nasm@v1 + uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1 - name: Install toolchain with clippy available - uses: actions-rs/toolchain@v1 + uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 with: profile: minimal toolchain: nightly-2023-08-28 @@ -58,16 +58,16 @@ jobs: # Install first since it's needed to build NASM - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e # v1 with: version: "10.0" directory: ${{ runner.temp }}/llvm - name: install NASM - uses: ilammy/setup-nasm@v1 + uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1 - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Initialize and update submodules run: | @@ -76,7 +76,7 @@ jobs: git submodule update --init --recursive --depth 1 - name: Install toolchain with rustfmt available - uses: actions-rs/toolchain@v1 + uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 with: profile: minimal toolchain: nightly-2023-08-28 @@ -87,12 +87,12 @@ jobs: run: bash sh_script/pre-build.sh - name: Run cargo check - uses: actions-rs/cargo@v1 + uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 with: command: check - name: Run cargo fmt - uses: actions-rs/cargo@v1 + uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 with: command: fmt args: -- --check \ No newline at end of file diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 16835c6..afc901f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -12,6 +12,9 @@ env: RUST_TOOLCHAIN: nightly-2023-08-28 TOOLCHAIN_PROFILE: minimal +permissions: + contents: read + jobs: integration: name: Run vTPM Integration Test @@ -19,7 +22,7 @@ jobs: steps: - name: Checkout sources - vTpm - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Initialize and update submodules run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a47a51..4deb125 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout vTPM-Td Sources - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Initialize and update submodules run: | @@ -30,19 +30,19 @@ jobs: git submodule update --init --recursive --depth 1 - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e # v1 with: version: "10.0" directory: ${{ runner.temp }}/llvm - name: install NASM - uses: ilammy/setup-nasm@v1 + uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1 - name: Install tools for tpm-ref build run: sudo apt-get install autoconf-archive pkg-config build-essential automake gcc libssl-dev ocaml ocamlbuild autoconf libtool wget python-is-python3 cmake perl gcc-multilib - name: Install toolchain - uses: actions-rs/toolchain@v1 + uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 with: profile: ${{ env.TOOLCHAIN_PROFILE }} toolchain: ${{ env.RUST_TOOLCHAIN }} @@ -50,7 +50,7 @@ jobs: components: rust-src - name: Run cargo install cargo-xbuild - uses: actions-rs/cargo@v1 + uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 with: command: install args: cargo-xbuild diff --git a/.github/workflows/oss-fuzz.yml b/.github/workflows/oss-fuzz.yml index d913fcb..a9a6595 100644 --- a/.github/workflows/oss-fuzz.yml +++ b/.github/workflows/oss-fuzz.yml @@ -9,26 +9,26 @@ jobs: steps: - name: Build Fuzzers id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@c0c4b5402db632b5dbdb57831b7b357e14033ba1 # master with: oss-fuzz-project-name: 'vtpm-td' language: rust - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@c0c4b5402db632b5dbdb57831b7b357e14033ba1 # master with: oss-fuzz-project-name: 'vtpm-td' language: rust fuzz-seconds: 600 output-sarif: true - name: Upload Crash - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 if: failure() && steps.build.outcome == 'success' with: name: artifacts path: ./out/artifacts - name: Upload Sarif if: always() && steps.build.outcome == 'success' - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@928ff8c822d966a999092a6a35e32177899afb7c # v2.24.6 with: # Path to SARIF file relative to the root of the repository sarif_file: cifuzz-sarif/results.sarif diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 2ffe1a6..0110418 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Initialize and update submodules run: | @@ -34,16 +34,16 @@ jobs: # Install first since it's needed to build NASM - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e # v1 with: version: "10.0" directory: ${{ runner.temp }}/llvm - name: install NASM - uses: ilammy/setup-nasm@v1 + uses: ilammy/setup-nasm@13cbeb366c45c4379d3478cdcbadd8295feb5028 # v1.5.1 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 + uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 with: profile: ${{ env.TOOLCHAIN_PROFILE }} toolchain: ${{ env.NIGHTLY_RUST_TOOLCHAIN }} diff --git a/Dockerfile b/Dockerfile index f64f9ff..cd5e90f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:22.04@sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e # Adding rust binaries to PATH. ENV PATH="$PATH:/root/.cargo/bin"