Skip to content

feat: Add security-gates and update README - #1310

Open
emrecanvurallll wants to merge 2 commits into
mainfrom
add-security-gates-latest
Open

feat: Add security-gates and update README#1310
emrecanvurallll wants to merge 2 commits into
mainfrom
add-security-gates-latest

Conversation

@emrecanvurallll

@emrecanvurallll emrecanvurallll commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This PR adds security-gates workflow and updates README with OpenSSF Scorecard badge.

Summary by CodeRabbit

  • Documentation
    • Added an OpenSSF Scorecard badge and link to the README.
  • Security
    • Added automated security checks for changes submitted to the main development branches.
    • Applied restrictive permissions to improve workflow security.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds a GitHub Actions security-gates workflow for main and master, plus an OpenSSF Scorecard badge and link in the README.

Changes

Security gates

Layer / File(s) Summary
Security gates workflow
.github/workflows/security-gates.yml
Triggers on selected pushes and pull requests. It sets restrictive default permissions, validates the workflow, and invokes the reusable security-gates workflow with explicit permissions and inherited secrets.
Scorecard badge
README.md
Adds an OpenSSF Scorecard badge linked to the project’s Scorecard page.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: osoykan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: adding the security-gates workflow and updating the README.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-security-gates-latest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

2 similar comments
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

actions: read
contents: read
security-events: write
secrets: inherit

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/security-gates.yml (1)

12-18: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Make validate perform a real check or remove it.

echo "Validation successful" always passes and does not validate the workflow or repository. If this job is intended to gate security-gates, add needs: validate to the reusable-workflow job and run a meaningful validation command. Otherwise, remove this job to avoid a misleading green check.

🤖 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/security-gates.yml around lines 12 - 18, Update the
validate job to either run a meaningful repository or workflow validation and
add needs: validate to the security-gates job, or remove validate entirely if it
is not a real gate; do not retain the unconditional echo-only check.
🤖 Prompt for all review comments with 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.

Inline comments:
In @.github/workflows/security-gates.yml:
- Line 19: Update the reusable workflow reference in the security-gates
configuration to replace the mutable `@master` ref with the validated full-length
commit SHA for Trendyol/security-actions. Keep the existing workflow path
unchanged.
- Line 24: Replace the broad secrets: inherit configuration in the reusable
workflow invocation with explicit mappings for APPSEC_CA, APPSEC_ELASTIC_URL,
APPSEC_ELASTIC_USER, APPSEC_ELASTIC_PASS, and SLACK_WEBHOOK_URL, passing only
those secrets to the called workflow.

---

Nitpick comments:
In @.github/workflows/security-gates.yml:
- Around line 12-18: Update the validate job to either run a meaningful
repository or workflow validation and add needs: validate to the security-gates
job, or remove validate entirely if it is not a real gate; do not retain the
unconditional echo-only check.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d77f7415-ba64-417e-8f8b-fde2966046b4

📥 Commits

Reviewing files that changed from the base of the PR and between 5d485c8 and 1436547.

📒 Files selected for processing (2)
  • .github/workflows/security-gates.yml
  • README.md

run: echo "Validation successful"

security-gates:
uses: Trendyol/security-actions/.github/workflows/security-gates.yml@master

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

sha="$(gh api repos/Trendyol/security-actions/commits/master --jq '.sha')"
printf 'Current master SHA: %s\n' "$sha"

gh api "repos/Trendyol/security-actions/contents/.github/workflows/security-gates.yml?ref=$sha" \
  --jq '.content' | base64 --decode | sed -n '1,220p'

Repository: Trendyol/stove

Length of output: 7334


Pin the reusable workflow to an immutable commit.

@master lets the called workflow change without a change in Trendyol/stove. Pin this call to the full-length commit SHA that you validate before merging.

🧰 Tools
🪛 zizmor (1.29.0)

[warning] 19-19: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow

(secrets-inherit)

🤖 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/security-gates.yml at line 19, Update the reusable
workflow reference in the security-gates configuration to replace the mutable
`@master` ref with the validated full-length commit SHA for
Trendyol/security-actions. Keep the existing workflow path unchanged.

actions: read
contents: read
security-events: write
secrets: inherit

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

sha="$(gh api repos/Trendyol/security-actions/commits/master --jq '.sha')"

gh api "repos/Trendyol/security-actions/contents/.github/workflows/security-gates.yml?ref=$sha" \
  --jq '.content' | base64 --decode | rg -n 'workflow_call|secrets:|secrets\.'

Repository: Trendyol/stove

Length of output: 447


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sha="$(gh api repos/Trendyol/security-actions/commits/master --jq '.sha')"

echo "called workflow:"
gh api "repos/Trendyol/security-actions/contents/.github/workflows/security-gates.yml?ref=$sha" \
  --jq '.content' | base64 --decode | nl -ba | sed -n '1,180p'

echo
echo "caller usage:"
if [ -f .github/workflows/security-gates.yml ]; then
  nl -ba .github/workflows/security-gates.yml | sed -n '1,120p'
fi

Repository: Trendyol/stove

Length of output: 209


🏁 Script executed:

#!/bin/bash
set -euo pipefail

caller_file=".github/workflows/security-gates.yml"

echo "caller file:"
if [ -f "$caller_file" ]; then
  awk '{printf "%6d\t%s\n", NR, $0}' "$caller_file" | sed -n '1,120p'
else
  echo "missing $caller_file"
fi

echo
echo "called workflow refs/secrets:"
sha="$(gh api repos/Trendyol/security-actions/commits/master --jq '.sha')"
for f in .github/workflows/*.yml; do
  if [ "$(gh api -XGET "repos/Trendyol/security-actions/contents/$f?ref=$sha" --jq '.type == \"file\"" 2>/dev/null || true)" == "true" ]; then
    content="$(gh api "repos/Trendyol/security-actions/contents/$f?ref=$sha" --jq '.type == "file" and .content' 2>/dev/null || true)"
    if [ "$content" = "true" ]; then
      echo "--- $f (maybe no content) ---"
    else
      echo "--- $f ---"
    fi
  fi
done

echo
echo "called workflow security-gates.yml:"
gh api "repos/Trendyol/security-actions/contents/.github/workflows/security-gates.yml?ref=$sha" \
  --jq '.content' | awk '{printf "%6d\t%s\n", NR, $0}' | sed -n '1,180p'

echo
echo "called workflow env var usages:"
gh api "repos/Trendyol/security-actions/contents/.github/workflows/security-gates.yml?ref=$sha" \
  --jq '.content' | java -jar /dev/null 2>/dev/null || awk '
  /secrets\./ || /env:/ || /curl -X POST/ || /GITHUB_EVENT_PATH/ || /POST\/|PUT\/$/ || /X-Slack|Authorization:/ {
    print NR "\t" $0
  }'

echo
echo "github docs excerpt via web page text unavailable here; checking if gh docs command exists"
if command -v gh >/dev/null 2>&1; then
  gh --version
fi

Repository: Trendyol/stove

Length of output: 888


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sha="$(gh api repos/Trendyol/security-actions/commits/master --jq '.sha')"

echo "called workflow:"
gh api "repos/Trendyol/security-actions/contents/.github/workflows/security-gates.yml?ref=$sha" \
  --jq '.content' | awk '{printf "%6d\t%s\n", NR, $0}' | sed -n '1,180p'

echo
echo "secrets/env/url matches in called workflow:"
gh api "repos/Trendyol/security-actions/contents/.github/workflows/security-gates.yml?ref=$sha" \
  --jq '.content' | awk '
/secrets\./{print NR"\n"$0}
/env:/||/curl -X POST/||/POST\/|PUT\/$/||/SLACK_WEBHOOK_URL/||/APPSEC_ELASTIC/||/APPSEC_CA'

Repository: Trendyol/stove

Length of output: 11236


Pass only the secrets required by the called workflow.

This reusable workflow reads APPSEC_CA, APPSEC_ELASTIC_URL, APPSEC_ELASTIC_USER, APPSEC_ELASTIC_PASS, and SLACK_WEBHOOK_URL. secrets: inherit also makes any other caller secrets available to that repository-owned workflow; drop it if unused, or pass only those required secrets explicitly.

🤖 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/security-gates.yml at line 24, Replace the broad secrets:
inherit configuration in the reusable workflow invocation with explicit mappings
for APPSEC_CA, APPSEC_ELASTIC_URL, APPSEC_ELASTIC_USER, APPSEC_ELASTIC_PASS, and
SLACK_WEBHOOK_URL, passing only those secrets to the called workflow.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants