github / github/app

Allow command allowlists in company restricted mode

Open
#3,967 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
2.1k
Forks
157
PR merge metrics
No merged PRs in 30d

Description

Summary

Add support for administrators to define a whitelist of shell commands that the agent may run when company restricted mode is enabled and allow-all is disabled.

Problem

Restricted mode blocks commands by default, but teams may still need a small set of safe, routine commands for development workflows. Currently, enabling these workflows may require relaxing the broader allow-all restriction, weakening the intended security boundary.

Proposed solution

Provide an administrator-managed command allowlist for company restricted mode:

  • Commands matching the allowlist are permitted without an additional approval prompt.
  • Non-matching commands remain blocked or follow the existing approval flow.
  • The allowlist can be managed centrally at the company, organization, repository, or user scope.
  • Matching supports exact commands and explicitly constrained arguments, rather than unrestricted substring matching.
  • The UI indicates when a command was allowed by an administrator-defined rule.
  • Audit logs record the command, matched rule, user, repository, and timestamp.

Example allowed commands could include:

git status
git diff --check
swiftlint
npm test

Security considerations

The implementation must prevent bypasses through shell operators, command substitution, pipelines, redirects, aliases, path traversal, and argument injection. Rules should be validated before activation, and administrators should be able to review, update, and disable them.

Acceptance criteria

  • Administrators can configure and manage a company-level command allowlist.
  • The allowlist works while restricted mode is enabled and allow-all is disabled.
  • Non-matching commands retain the existing restriction behavior.
  • Matching is deterministic, documented, and resistant to shell-injection bypasses.
  • Allowed-command decisions are visible to users and captured in audit logs.
  • Existing behavior is unchanged when no allowlist is configured.

Contributor guide

Open the contributing guide

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.

Research direction

The issue names no files, tests, or concrete entry points. Start by locating the existing restricted-mode and allow-all authorization path, approval flow, command execution handling, UI decision display, and audit-log handling; done means a centrally managed, injection-resistant allowlist works at company scope without changing behavior when it is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, shell
Domain
authorization, devtools, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.