- Notifications
You must be signed in to change notification settings - Fork60
feat: Add security-gates and update README#59
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Closed
Uh oh!
There was an error while loading.Please reload this page.
Closed
Changes fromall commits
Commits
Show all changes
3 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
62 changes: 62 additions & 0 deletions.github/workflows/scorecard.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Scorecard supply-chain security | ||
on: | ||
branch_protection_rule: | ||
schedule: | ||
- cron: '29 23 * * 3' | ||
push: | ||
branches: [ "main", "master"] | ||
pull_request: | ||
branches: ["main", "master"] | ||
permissions: read-all | ||
jobs: | ||
visibility-check: | ||
# Bu job, deponun public/private olduğunu belirler | ||
outputs: | ||
visibility: ${{ steps.drv.outputs.visibility }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Determine repository visibility | ||
id: drv | ||
run: | | ||
visibility=$(gh api /repos/$GITHUB_REPOSITORY --jq '.visibility') | ||
echo "visibility=$visibility" >> $GITHUB_OUTPUT | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
analysis: | ||
if: ${{ needs.visibility-check.outputs.visibility == 'public' }} | ||
needs: visibility-check | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
id-token: write | ||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
with: | ||
persist-credentials: false | ||
- name: "Run analysis" | ||
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 | ||
with: | ||
results_file: results.sarif | ||
results_format: sarif | ||
publish_results: true | ||
- name: "Upload artifact" | ||
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db | ||
with: | ||
name: SARIF file | ||
path: results.sarif | ||
retention-days: 5 | ||
- name: "Upload to code-scanning" | ||
uses: github/codeql-action/upload-sarif@v3 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium score is 2: GitHub-owned GitHubAction not pinned by hash Click Remediation section below to solve this issue | ||
with: | ||
sarif_file: results.sarif | ||
21 changes: 21 additions & 0 deletions.github/workflows/security-gates.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Security Gates | ||
Check failureCode scanning / Scorecard Token-Permissions High score is 0: no topLevel permission defined Remediation tip: Visithttps://app.stepsecurity.io/secureworkflow. Tick the 'Restrict permissions for GITHUB_TOKEN' Untick other options NOTE: If you want to resolve multiple issues at once, you can visithttps://app.stepsecurity.io/securerepo instead. Click Remediation section below for further remediation help | ||
on: | ||
push: | ||
branches: [main, develop] | ||
pull_request: | ||
branches: [main, develop] | ||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Validate Workflow | ||
run: echo "Validation successful" | ||
security-gates: | ||
uses: Trendyol/security-actions/.github/workflows/security-gates.yml@master | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
Check failureCode scanning / Scorecard Token-Permissions High score is 0: jobLevel 'security-events' permission set to 'write' Remediation tip: Verify which permissions are needed and consider whether you can reduce them. Click Remediation section below for further remediation help |
2 changes: 2 additions & 0 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.