CI workflows default to write-all permissions, and a couple of compose files are worth a second look

Open
#8,523 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
docker-compose, github-actions
Domain
ci-cd, devops, security

Research direction

Start with .github/workflows/github-labeler.yml and platform-docker-build-test-publish.yml, then review the other workflows for their required permissions. Check docker-compose.yml:9 and docker-compose.pgpool.yml:25 to confirm the flagged credentials are only local defaults. Done means workflows use least-privilege permissions with necessary job-specific exceptions and no real credentials are committed.

Written by the indexing model from the issue text.

Description

Issue Where Why it matters
No explicit least-privilege permissions: block .github/workflows/github-labeler.yml, platform-docker-build-test-publish.yml, and about a dozen other workflows Workflows default to broad write access to the repo instead of only what each job needs
Basic Auth credential pattern flagged docker-compose.yml:9, docker-compose.pgpool.yml:25 Probably local dev defaults, worth a quick look to confirm nothing real is committed here

Suggested fix for the workflows, add a scoped block near the top:

permissions:
  contents: read

Then widen only the specific jobs that need more, like pull-requests: write for the labeler.

Found this with InfraScan (https://github.com/SolDevelo/InfraScan), an open-source cost/security scanner covering Terraform, Kubernetes, Helm, CloudFormation, Ansible, and containers (Apache-2.0). If it's useful, it's a few lines to add as a GitHub Action (https://github.com/marketplace/actions/infrascan-iac-cost-security-scanner). Happy to open a PR wiring it up if you want.

Dominant language
Python
Stars
9.9k
Forks
658
Avg merge
1d 15h
Merged PRs (30d)
168

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Flagsmith/flagsmith

All issues in Flagsmith/flagsmith

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.