Allow command allowlists in company restricted mode
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 2.1k
- Forks
- 157
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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-allis 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Das Issue nennt keine Dateien, Tests oder konkreten Einstiegspunkte. Beginne damit, den bestehenden Autorisierungspfad für restricted-mode und allow-all, den Genehmigungsablauf, die Handhabung der Befehlsausführung, die Anzeige von UI-Entscheidungen und die Verarbeitung des Audit-Logs zu finden; abgeschlossen ist die Arbeit, wenn eine zentral verwaltete, gegen Injection resistente allowlist auf Unternehmensebene funktioniert, ohne das Verhalten zu ändern, wenn sie nicht vorhanden ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, shell
- Bereich
- authorization, devtools, security
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100