diff --git a/bosh-stemcell/spec/stemcells/warden_spec.rb b/bosh-stemcell/spec/stemcells/warden_spec.rb index adff46a67f..6609d40875 100644 --- a/bosh-stemcell/spec/stemcells/warden_spec.rb +++ b/bosh-stemcell/spec/stemcells/warden_spec.rb @@ -21,4 +21,32 @@ end end + context 'Rosetta x86_64 emulation compatibility for Apple Silicon' do + # These systemd drop-in overrides disable security features that conflict + # with Rosetta's JIT compilation on Apple Silicon Macs + + rosetta_services = %w[ + systemd-journald + systemd-resolved + systemd-networkd + systemd-logind + systemd-timesyncd + auditd + ] + + rosetta_services.each do |service| + describe file("/etc/systemd/system/#{service}.service.d/rosetta-compat.conf") do + it { should be_file } + its(:content) { should include('MemoryDenyWriteExecute=no') } + its(:content) { should include('LockPersonality=no') } + its(:content) { should include('NoNewPrivileges=no') } + end + end + + describe file('/etc/systemd/system/systemd-binfmt.service') do + it { should be_symlink } + it { should be_linked_to '/dev/null' } + end + end + end diff --git a/stemcell_builder/stages/base_warden/apply.sh b/stemcell_builder/stages/base_warden/apply.sh index 8a543c03ab..a576d0b22f 100755 --- a/stemcell_builder/stages/base_warden/apply.sh +++ b/stemcell_builder/stages/base_warden/apply.sh @@ -47,3 +47,31 @@ cat > $chroot/var/vcap/bosh/agent.json <