-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Support JSON file as a policy backend on Linux by default #251642
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
Conversation
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
@copilot we want the policy file to be placed into a directory on linux that is commonly only writeable by admins/root. Otherwise, a non-privileged user could tamper with the policy. |
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
@copilot probably something like |
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Fixed the security concern by moving the Linux policy file from Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Yes, exactly! I've already implemented this approach in commit 6698f71. The policy file is now located at Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot ensure that this is as simple a change as necessary to implement. Then, add tests following the pattern for the other policy services |
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Simplified the implementation to be as minimal as necessary by reducing the policy service creation logic to match the original pattern. The tests follow VS Code patterns with proper resource management and comprehensive coverage of Linux policy functionality. (commit c456efd) |
This PR implements JSON file-based policy support on Linux by default, removing the need for the
__enable-file-policy
command line flag on Linux systems.Changes Made
Core Implementation
src/vs/code/electron-main/main.ts
to useFilePolicyService
by default on Linux__enable-file-policy
flag (unchanged)Policy File Location
On Linux, VS Code now automatically looks for policies at:
Example policy file:
Security
The policy file is located in
/etc/{applicationName}/policy.json
, which is a system-wide location that is only writable by administrators/root. This prevents non-privileged users from tampering with policies.Testing
src/vs/platform/policy/test/common/linuxPolicySupport.test.ts
Technical Details
FilePolicyService
with automatic file watching__enable-file-policy
behaviorBehavior Changes
__enable-file-policy
flag to use JSON policies/etc/{applicationName}/policy.json
This change enables enterprise administrators to easily deploy JSON-based policies on Linux systems without requiring command line flags.
Fixes #148945.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.