CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

GitHub Workflows security hardening

Open sashashura opened this issue 2 years ago • 1 comments

This PR adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted. It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case.

sashashura avatar Aug 29 '22 12:08 sashashura

Please let me know if you have any questions.

sashashura avatar Sep 20 '22 07:09 sashashura

@narfbg could you please review?

sashashura avatar Nov 30 '22 23:11 sashashura

An example of a workflow run with unrestricted permissions: image

sashashura avatar Nov 30 '22 23:11 sashashura

I like this PR, @sashashura why don't you send the same PR for CI4?

datamweb avatar Nov 30 '22 23:11 datamweb

What is CI4?

sashashura avatar Dec 01 '22 00:12 sashashura

What is CI4?

😄 https://github.com/codeigniter4/CodeIgniter4

datamweb avatar Dec 01 '22 00:12 datamweb

I wonder how this is not the default behavior for GA...

gxgpet avatar Dec 01 '22 01:12 gxgpet

Maybe because they have given the Repo manager the ability to adjust. However, the setting in file .yml looks better due to its public.

Screenshot_2022-12-01-05-05-04-125-edit_com android chrome

datamweb avatar Dec 01 '22 01:12 datamweb