Skip to content
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
38 changes: 38 additions & 0 deletions .github/workflows/datadog-synthetics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will trigger Datadog Synthetic tests within your Datadog organisation
# For more information on running Synthetic tests within your GitHub workflows see: https://docs.datadoghq.com/synthetics/cicd_integrations/github_actions/

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# To get started:

# 1. Add your Datadog API (DD_API_KEY) and Application Key (DD_APP_KEY) as secrets to your GitHub repository. For more information, see: https://docs.datadoghq.com/account_management/api-app-keys/.
# 2. Start using the action within your workflow

name: Run Datadog Synthetic tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only verification: find unpinned GitHub Actions and checkout steps missing persist-credentials:false
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' 'uses:\s*actions/checkout@'
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' -A3 -B1 'uses:\s*actions/checkout@'
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' 'uses:\s*[^@]+@v[0-9]+(\.[0-9]+)?(\.[0-9]+)?\s*$'

Repository: tinyfish-io/bigset

Length of output: 509


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflows files =="
ls -la .github || true
ls -la .github/workflows || true
rg -n --hidden --no-ignore -S "datadog-synthetics" .github/workflows || true

echo "== show workflow file =="
if [ -f ".github/workflows/datadog-synthetics.yml" ]; then
  nl -ba .github/workflows/datadog-synthetics.yml | sed -n '1,160p'
else
  echo "Missing: .github/workflows/datadog-synthetics.yml"
  exit 1
fi

echo "== targeted pin/persist checks =="
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' 'uses:\s*actions/checkout@' .github/workflows || true
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' -C 3 'uses:\s*actions/checkout@' .github/workflows || true
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' -C 2 'persist-credentials:\s*(false|true)' .github/workflows || true

Repository: tinyfish-io/bigset

Length of output: 1045


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== show workflow file with line numbers =="
awk '{printf "%5d\t%s\n", NR, $0}' .github/workflows/datadog-synthetics.yml | sed -n '1,200p'

echo "== targeted pin/persist checks =="
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' 'uses:\s*actions/checkout@' .github/workflows
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' -C 3 'uses:\s*actions/checkout@' .github/workflows
rg -n --glob '.github/workflows/*.yml' --glob '.github/workflows/*.yaml' 'persist-credentials:\s*(false|true)' .github/workflows

Repository: tinyfish-io/bigset

Length of output: 3784


Pin actions/checkout to a commit SHA and disable credential persistence

In .github/workflows/datadog-synthetics.yml step (line 27), actions/checkout@v4 is used as a mutable tag and persist-credentials: false is not set, which can leave credentials configured for later steps. Pin to a full commit SHA and add persist-credentials: false.

Suggested patch
-    - uses: actions/checkout@v4
+    - uses: actions/checkout@<FULL_COMMIT_SHA_FOR_V4>
+      with:
+        persist-credentials: false
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 27-30: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 27-27: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/datadog-synthetics.yml at line 27, Replace the mutable
actions/checkout@v4 reference with a pinned commit SHA for the same action and
add the persist-credentials: false setting to that checkout step; specifically,
locate the step that uses actions/checkout@v4 and change the uses value to the
full commit SHA (e.g., actions/checkout@<commit-sha>) and add the key
persist-credentials: false under that step to prevent credentials from being
left configured for later steps.

Source: Linters/SAST tools


# Run Synthetic tests within your GitHub workflow.
# For additional configuration options visit the action within the marketplace: https://github.com/marketplace/actions/datadog-synthetics-ci
- name: Run Datadog Synthetic tests
uses: DataDog/synthetics-ci-github-action@87b505388a22005bb8013481e3f73a367b9a53eb # v1.4.0
with:
api_key: ${{secrets.DD_API_KEY}}
app_key: ${{secrets.DD_APP_KEY}}
test_search_query: 'tag:e2e-tests' #Modify this tag to suit your tagging strategy