]> git.openstreetmap.org Git - chef.git/commitdiff
Use default sandboxing for API statistics and rails job runners
authorTom Hughes <tom@compton.nu>
Wed, 16 Nov 2022 19:41:17 +0000 (19:41 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 16 Nov 2022 19:41:17 +0000 (19:41 +0000)
cookbooks/web/recipes/rails.rb

index 4b59eb00b5839090af746dee1650267220ad8cb8..b28e19ba7f260d2c762c20bea3ae7fa915f27540 100644 (file)
@@ -159,11 +159,9 @@ systemd_service "rails-jobs@" do
   exec_start "#{node[:ruby][:bundle]} exec rails jobs:work"
   restart "on-failure"
   nice 10
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  read_write_paths "/var/log/web"
 end
 
 package "libjson-xs-perl"
@@ -196,12 +194,11 @@ systemd_service "api-statistics" do
   group "adm"
   exec_start "/usr/local/bin/api-statistics"
   nice 10
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  read_write_paths [
+    "/srv/www.openstreetmap.org/rails/tmp",
+    "/var/lib/prometheus/node-exporter"
+  ]
   restart "on-failure"
 end