Skip to content

Devin.ford/workflow updates #30172

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
31 changes: 31 additions & 0 deletions .github/workflows/temp-octo-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Octo STS Test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Code Vulnerability

No explicit permissions set for at the workflow level (...read more)

Check the permissions granted to jobs

Datadog’s GitHub organization defines default permissions for the GITHUB_TOKEN to be restricted (contents:read, metadata:read and packages:read).

Your repository may require different setup, but please consider defining permissions for each job following the least privilege principle to restrict the impact of a possible compromission.

You can find the list of all possible permissions in Workflow syntax for GitHub Actions - GitHub Docs. Please note they can be defined at the job or the workflow level.

View in Datadog  Leave us feedback  Documentation

on:
pull_request:
branches:
- master
types: ["review_requested", "synchronize", "opened", "reopened"]

jobs:
read-other-repo:
name: read contents of another repo
runs-on: ubuntu-latest
permissions:
id-token: write # Needed to federate tokens.
steps:
# <TESTING> Only for debugging, remove after testing
- name: Debug OIDC Claims
uses: github/actions-oidc-debugger@main

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Code Vulnerability

Workflow depends on a GitHub actions pinned by tag (...read more)

Pin third party actions by hash

When using a third party action, one needs to provide its GitHub path (owner/project) and can eventually pin it to a git ref (a branch name, a git tag, or a commit hash).

No pinned git ref means the action will use the latest commit of the default branch each time it runs, eventually running newer versions of the code that were not audited by Datadog. Specifying a git tag is better, but since they are mutable, using a full length hash is recommended to make sure the action's content is actually frozen to some reviewed state.

If you wanna benefit from auto-updates, you can enable Dependabot on your repository. It is able to update actions pinned by hash and comment version numbers after them for better readability (see for instance this example PR).

View in Datadog  Leave us feedback  Documentation

with:
audience: "octo-debugger"
# </TESTING>
- uses: DataDog/dd-octo-sts-action@08f2144903ced3254a3dafec2592563409ba2aa0 # v1.0.1
id: octo-sts
with:
scope: DataDog
policy: documentation.read-org-members
- name: Use GH token
run: |
gh auth status
gh api orgs/DataDog/teams/documentation/members
env:
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
Loading