Skip to content

Repository service account for Gitea Actions #26754

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

Open
merlleu opened this issue Aug 27, 2023 · 1 comment
Open

Repository service account for Gitea Actions #26754

merlleu opened this issue Aug 27, 2023 · 1 comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@merlleu
Copy link
Contributor

merlleu commented Aug 27, 2023

Feature Description

The issue:
Currently to allow the build of select repositories using actions, we create a token giving read-only to all repos and set it as action secret.
This is not ideal because in case of an infected repository: if a compromised (developer got gitea account hacked), the attacker could easily use actions to escalate privileges and access all the repos accessible by the access token.

One possible solution: Repository service accounts.
I was thinking a way of managing this would be to have the ability to create a service account linked to a specific repo:
The repository's actions jobs would inherit from a token with the service account permissions.

There would be an option to create the service account of a repo, adding a new tab to the settings page of the repo, listing permissions of the service account.

Permissions of the service account itself should be managed the same way as real accounts.
Service accounts should be have for username gitea_svc_{repo_id} and for full name {owner_name}/{repo_name}, and updating repo/owner name should update the service account full name.
Best thing would be to have a badge next to the name indicating it's a repo/service account.
They should be "login disabled".

I don't know if this feature might interest people out here but I think it might greatly reduces risks for CI/CD in my organization.

Screenshots

No response

@merlleu merlleu added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Aug 27, 2023
@Crown0815
Copy link

I think #25900 would resolve this issue very well. It would avoid the overhead of creating full blown service accounts and rather provide a very slim access layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants