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

Ensure top-level permissions are not set to write-all #1309

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Conversation

buberdds
Copy link
Contributor

@buberdds buberdds commented Mar 6, 2023

Fix MegaLinter error. Currently CI is failing due to (default write-all?)

  	FAILED for resource: on(Mega-Linter)
  	File: /.github/workflows/mega-linter.yml:0-1
  Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
  	FAILED for resource: on(dump-validators)
  	File: /.github/workflows/dump-validators.yml:0-1
  Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
  	FAILED for resource: on(Build and test)
  	File: /.github/workflows/build-test.yaml:0-1```

@github-actions
Copy link

github-actions bot commented Mar 6, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 3 0 0.12s
✅ EDITORCONFIG editorconfig-checker 3 0 0.01s
✅ REPOSITORY checkov yes no 14.51s
✅ REPOSITORY git_diff yes no 0.0s
✅ YAML prettier 3 0 0 0.62s
✅ YAML v8r 3 0 2.95s
✅ YAML yamllint 3 0 0.23s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 6, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e43e764
Status: ✅  Deploy successful!
Preview URL: https://e168cd38.oasis-wallet.pages.dev
Branch Preview URL: https://mz-linterfix.oasis-wallet.pages.dev

View logs

@buberdds buberdds changed the title test Ensure top-level permissions are not set to write-all Mar 6, 2023
@buberdds buberdds requested review from lukaw3d and csillag March 6, 2023 12:02
@buberdds buberdds assigned lubej and unassigned lubej Mar 6, 2023
@buberdds buberdds requested a review from lubej March 6, 2023 12:02
@@ -6,6 +6,8 @@ on:
schedule:
- cron: '0 0 1 * *'

permissions: read-all
Copy link
Member

Choose a reason for hiding this comment

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

Ah, I was planning to add these at some point
dump-validators needs:

permissions: # Limit secrets.GITHUB_TOKEN permissions
  contents: write
  pull-requests: write

Comment on lines 12 to 15
permissions: read-all

Copy link
Member

Choose a reason for hiding this comment

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

I think megalinter currently needs:

permissions: # Limit secrets.GITHUB_TOKEN permissions
  contents: write
  pull-requests: write

unless we disable APPLY_FIXES

@buberdds
Copy link
Contributor Author

buberdds commented Mar 6, 2023

do we need anything specific for build-test.yaml or {} is Ok ?

@@ -6,6 +6,8 @@ on:
pull_request:
branches: [stable, master]

permissions: {}
Copy link
Member

Choose a reason for hiding this comment

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

Seems to work 👍
I'd add a comment that this disables all permissions - syntax isn't intuitive to me

@buberdds buberdds merged commit 7d73214 into master Mar 6, 2023
@buberdds buberdds deleted the mz/linterFix branch March 6, 2023 16:47
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.

3 participants