mxc 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fccd6da3c4cef2c5422949e1a28b2c38fad41a709a33db744e95c255e32c72fa
4
- data.tar.gz: 165b13bffc2f44b45468a215647b054413acb392aed297d8f9325a8e9f38d707
3
+ metadata.gz: 3b22a8e3054e56f63421b06b11d5db03c5a4d2a78302759b069207b6f57e0881
4
+ data.tar.gz: 2425c817778256ec3bb937d9587f8d7513d8aa4106cd3727c9163806893b8d26
5
5
  SHA512:
6
- metadata.gz: c8296fcb1dacf6434405b6e821a88f69871dc3877f05c3fa04e9140017f564aa773f43276812e9954a09335022732e20b4b88159ce63d4eca6ff58d5cea9281a
7
- data.tar.gz: 9908ebc2252e66cf4d06e4d23c07fd2975943d60aa4b629c0e6b1127f0c690acbc2eab8a5955ed7bb6ec71fc803d30a82d3fb5aefe398f65a9720eb210ae897e
6
+ metadata.gz: ad1387eafb7076d2a18e954e94cc5641a4a7bb9be532ffbba8ad3e496ca0021f7693e41d3fd4301108454d2863c469e415f6f8c6b9a1045cbd1c0ce4e1305544
7
+ data.tar.gz: 200a97933411bf815af791fb136f94c53d3270ff409318e0364a78fe9a7007fcf709d7eadfcae5a59054e53a088ce9af80fc563585b07b4f58f185135b2bed23
data/Cargo.lock CHANGED
@@ -593,7 +593,7 @@ dependencies = [
593
593
 
594
594
  [[package]]
595
595
  name = "mxc"
596
- version = "0.4.0"
596
+ version = "0.4.1"
597
597
  dependencies = [
598
598
  "magnus",
599
599
  "mxc-sdk",
@@ -605,7 +605,7 @@ dependencies = [
605
605
  [[package]]
606
606
  name = "mxc-sdk"
607
607
  version = "1.0.0"
608
- source = "git+https://github.com/crmne/microsoft-mxc?rev=d57b0d1aa3a2d552001fa54ef4ac4baaa733c26d#d57b0d1aa3a2d552001fa54ef4ac4baaa733c26d"
608
+ source = "git+https://github.com/crmne/microsoft-mxc?rev=d7ba62b299fbcd7bdd4d7876cefcd68ada9a469b#d7ba62b299fbcd7bdd4d7876cefcd68ada9a469b"
609
609
  dependencies = [
610
610
  "anyhow",
611
611
  "base64",
data/README.md CHANGED
@@ -128,6 +128,8 @@ MXC.backends # => [#<MXC::Backend name=:bubblewrap ...>]
128
128
 
129
129
  On Windows, a single String runs through `cmd.exe` instead of `sh`. See [Running Commands](https://crmne.github.io/mxc/running-commands/#windows) and [Policies](https://crmne.github.io/mxc/policies/#windows) for what else differs.
130
130
 
131
+ A sandbox controls files, network, and resources. It does not always hide other processes: on some backends a command can read their command lines, and on macOS the environment your application started with. [Policies](https://crmne.github.io/mxc/policies/#what-the-command-can-see-of-other-processes) lists what each backend shows.
132
+
131
133
  Docker blocks the namespaces Bubblewrap needs by default, so a default container runs sandboxes on Landlock. [Running in Docker](https://crmne.github.io/mxc/running-in-docker/) shows what that gives up, and the smallest set of changes that makes Bubblewrap work, with a seccomp profile and a Kamal configuration for a job role.
132
134
 
133
135
  ## Documentation
data/ext/mxc/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "mxc"
3
- version = "0.4.0"
3
+ version = "0.4.1"
4
4
  edition = "2021"
5
5
  authors = ["Carmine Paolino <carmine@paolino.me>"]
6
6
  license = "MIT"
@@ -13,7 +13,7 @@ crate-type = ["cdylib"]
13
13
  magnus = "0.8.2"
14
14
  # A fork of mxc-sdk 1.0.0 that adds resource limits (microsoft/mxc#1498) and
15
15
  # a Landlock backend (microsoft/mxc#1494), until MXC releases them.
16
- mxc-sdk = { git = "https://github.com/crmne/microsoft-mxc", rev = "d57b0d1aa3a2d552001fa54ef4ac4baaa733c26d" }
16
+ mxc-sdk = { git = "https://github.com/crmne/microsoft-mxc", rev = "d7ba62b299fbcd7bdd4d7876cefcd68ada9a469b" }
17
17
  rb-sys = { version = "0.9.130", features = ["stable-api-compiled-fallback"] }
18
18
  serde_json = "1"
19
19
 
data/lib/mxc/sandbox.rb CHANGED
@@ -177,7 +177,8 @@ module MXC
177
177
  add_paths(:readable, paths)
178
178
  end
179
179
 
180
- # Adds paths the command can read and write.
180
+ # Adds paths the command can read and write. A path that is also #readable is writable,
181
+ # whichever was added first. A readable path inside a writable one stays read-only.
181
182
  def with_writable(*paths)
182
183
  add_paths(:writable, paths)
183
184
  end
@@ -470,9 +471,11 @@ module MXC
470
471
 
471
472
  def request(arguments)
472
473
  Preflight.check!(network:, denied:, resources:, backend:)
474
+ readwrite = expand(writable)
473
475
  {
474
- readonly: expand(readable) | library_files(arguments),
475
- readwrite: expand(writable),
476
+ # MXC resolves a path in both lists to read-only.
477
+ readonly: (expand(readable) | library_files(arguments)) - readwrite,
478
+ readwrite:,
476
479
  denied: expand(denied) | hidden_resolver_sockets,
477
480
  environment:,
478
481
  working_directory:,
data/lib/mxc/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module MXC
4
4
  # The gem version.
5
- VERSION = '0.4.0'
5
+ VERSION = '0.4.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mxc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carmine Paolino