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

Security fixes in GitHub actions for Unpinned Tags and Workflow yml that doesn't specifically define perms #1013

Merged
merged 18 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7a4d611
Security compliance fix - Setting CI and Nightly GH actions to Read O…
darrenge Feb 11, 2025
6a5559b
Added Tagged Pin for third party. DeployWebsite & BDN Benchmark
darrenge Feb 11, 2025
25cefa4
Trying different commit SHA for BDN
darrenge Feb 11, 2025
d6d40e1
Added pinned tag for third party for CI. Removed the one for BDN as …
darrenge Feb 11, 2025
082348a
Added Pinned Tag for docker Windows but the BUILD and PUSH steps are …
darrenge Feb 12, 2025
ca2c483
Docker Windows test passed so now enabling actual build and push
darrenge Feb 12, 2025
6b11364
Added Pinned tag with a commit SHA for third party apps - actual buil…
darrenge Feb 12, 2025
83f8303
Enabled the build and push step for docker linux as test of other par…
darrenge Feb 12, 2025
75d7f80
Added Pinned tag using commit SHA for third party Helm chart pipeline…
darrenge Feb 12, 2025
365463b
Enabled the other parts of Helm after testing the changed task
darrenge Feb 12, 2025
4459a99
Trying to get benchmark-action/github-action-benchmark with commit sh…
darrenge Feb 12, 2025
68293b6
Removed the Create Pull Request task as security policy won't allow …
darrenge Feb 12, 2025
06763d9
Putting Create Pull Request task back as might not be right move to d…
darrenge Feb 12, 2025
e3285e7
Merge branch 'main' into darrenge/FixIssuesFromCodeScan
darrenge Feb 17, 2025
3eb0d28
Merge branch 'main' into darrenge/FixIssuesFromCodeScan
darrenge Feb 18, 2025
952d862
Merge branch 'main' into darrenge/FixIssuesFromCodeScan
TalZaccai Feb 18, 2025
a241fd0
Merge branch 'main' into darrenge/FixIssuesFromCodeScan
darrenge Feb 18, 2025
086ecaa
Merge branch 'main' into darrenge/FixIssuesFromCodeScan
TalZaccai Feb 18, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/ci-bdnbenchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- name: Apply filter
uses: dorny/paths-filter@v3
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3 for security reasons have pinned tag (commit SHA) for 3rd party
id: filter
with:
filters: |
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

# Run `github-action-benchmark` action for the Continuous Benchmarking Charts (https://microsoft.github.io/garnet/charts/)
- name: Store benchmark result for charts
uses: benchmark-action/github-action-benchmark@v1
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1 for security reasons have pinned tag (commit SHA) for 3rd party
with:
name: ${{matrix.test}} (${{matrix.os}} ${{matrix.framework}} ${{matrix.configuration}})
tool: 'benchmarkdotnet'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

permissions:
contents: read

jobs:
changes:
name: Check for changes
Expand All @@ -27,7 +30,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- name: Apply filter
uses: dorny/paths-filter@v3
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3 for security reasons have pinned tag (commit SHA) for 3rd party
id: filter
with:
filters: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# Popular action to deploy to GitHub Pages:
# Docs: /~https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
uses: peaceiris/actions-gh-pages@aa83d0c2cfc3d813560e13068d3152aa21490171 #v4 - for security reasons have pinned tag (commit SHA) for 3rd party
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/docker-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@8e1d5461f02b7886d3c1a774bfbd873650445aa2 # was v5 but now v6 with this commit for security reasons have pinned tag (commit SHA) for 3rd party
with:
images: ${{ matrix.image }}
tags: |
Expand All @@ -56,21 +56,22 @@ jobs:
type=raw,value=latest,enable={{is_default_branch}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3 for security reasons have pinned tag (commit SHA) for 3rd party
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3 for security reasons have pinned tag (commit SHA) for 3rd party
-
name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
uses: docker/login-action@327cd5a69de6c009b9ce71bce8395f28e651bf99 # was v3 but now v6 with this commit for security reasons have pinned tag (commit SHA) for 3rd party

with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v5 for security reasons have pinned tag (commit SHA) for 3rd party
with:
file: ${{ matrix.dockerfile }}
provenance: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@8e1d5461f02b7886d3c1a774bfbd873650445aa2 # was v5 but now v6 with this commit for security reasons have pinned tag (commit SHA) for 3rd party
with:
images: ghcr.io/${{ github.repository }}-nanoserver-ltsc2022
tags: |
Expand All @@ -39,7 +39,7 @@ jobs:

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
uses: docker/login-action@327cd5a69de6c009b9ce71bce8395f28e651bf99 # was v3 but now v6 with this commit for security reasons have pinned tag (commit SHA) for 3rd party
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- name: Install helm
uses: azure/setup-helm@v4
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4 for security reasons have pinned tag (commit SHA) for 3rd party
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
git checkout -- charts/garnet/Chart.yaml

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7 for security reasons have pinned tag (commit SHA) for 3rd party
with:
add-paths: charts/garnet/README.md
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -98,4 +98,3 @@ jobs:
fi
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts"
done

3 changes: 3 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

permissions:
contents: read

jobs:
build-test-garnet:
name: Garnet
Expand Down