envameleon 0.3.0-aarch64-linux-gnu → 0.5.0-aarch64-linux-gnu
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 +4 -4
- data/README.md +78 -38
- data/lib/envameleon/3.2/envameleon.so +0 -0
- data/lib/envameleon/3.3/envameleon.so +0 -0
- data/lib/envameleon/3.4/envameleon.so +0 -0
- data/lib/envameleon/4.0/envameleon.so +0 -0
- metadata +109 -97
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 020f81a9926ecd68488b847050ea9e6f7ad8edb7ee7fd81f748fc69fb99fc046
|
|
4
|
+
data.tar.gz: c674ffcb55a9afe47ace4f4d10a98404f1baeeaa0ab397b24bec8cff845bdb34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 458a0c8ec519218cbe4444f89c225ba0ed58636cfe7316a726217904eabc81ae0c3f119bdbe082e09194a5b629e2a3d32a92076486ae91203ec196e16e0c10aa
|
|
7
|
+
data.tar.gz: e32bca95490ee6541d40a3620a6e635fa94a2e08fe88345f796aed0ad557f62f034d5a2425fc0120f67d319945c525e96510cf8809ff4bebe894667860ce90a2
|
data/README.md
CHANGED
|
@@ -90,22 +90,23 @@ ENVameleon publishes precompiled native gems for its supported CRuby minors on:
|
|
|
90
90
|
The macOS and Windows gems contain the documented pure-Ruby no-ops. There is no
|
|
91
91
|
native code to compile on those systems. Linux is split into `-linux-gnu` and
|
|
92
92
|
`-linux-musl` gems so a glibc binary is never mistaken for a musl binary. These
|
|
93
|
-
|
|
93
|
+
multi-ABI gems require RubyGems 3.3.22 or newer; musl users should use Bundler
|
|
94
94
|
2.5.6 or newer.
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
RubyGems and Bundler 4.1 or newer prefer a content-addressed gem containing
|
|
97
|
+
only the binary for your Ruby minor. Older clients use the multi-ABI gem,
|
|
98
|
+
which bundles every supported Ruby minor for that platform. Neither format
|
|
99
|
+
needs a compiler. If there is no precompiled binary for your Ruby, the generic
|
|
100
|
+
source gem runs `extconf.rb` and requires a C compiler, Make, and the Ruby
|
|
101
|
+
headers. macOS and Windows continue to select their compiler-free no-op gems.
|
|
102
|
+
If neither a native nor source fallback applies on Linux, `require "envameleon"`
|
|
103
|
+
fails closed instead of silently exposing the process environment.
|
|
103
104
|
|
|
104
105
|
Every GitHub release includes the gems and `SHA256SUMS`. Release gems also have
|
|
105
106
|
GitHub build-provenance attestations, which can be checked with:
|
|
106
107
|
|
|
107
108
|
```console
|
|
108
|
-
gh attestation verify envameleon-0.
|
|
109
|
+
gh attestation verify envameleon-0.5.0-x86_64-linux-gnu.gem --repo kpumuk/envameleon
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
[Back to top](#readme-top).
|
|
@@ -119,7 +120,7 @@ ENV.mask_proc_data
|
|
|
119
120
|
# SECRET=example becomes SECRET=e*****e in /proc/self/environ
|
|
120
121
|
|
|
121
122
|
ENV.scrub_proc_data
|
|
122
|
-
# /proc/self/environ now holds
|
|
123
|
+
# /proc/self/environ now holds NUL bytes except for any LD_LIBRARY_PATH entry
|
|
123
124
|
|
|
124
125
|
ENV.drop_proc_data
|
|
125
126
|
# /proc/self/environ is now zero bytes long
|
|
@@ -127,8 +128,8 @@ ENV.drop_proc_data
|
|
|
127
128
|
|
|
128
129
|
| Method | Result in `/proc/self/environ` | File length | Permissions |
|
|
129
130
|
| --- | --- | --- | --- |
|
|
130
|
-
| `ENV.mask_proc_data` | Names plus the first and last value byte | Unchanged | None |
|
|
131
|
-
| `ENV.scrub_proc_data` | NUL bytes | Unchanged | None |
|
|
131
|
+
| `ENV.mask_proc_data` | Names plus the first and last value byte; `LD_LIBRARY_PATH` untouched | Unchanged | None |
|
|
132
|
+
| `ENV.scrub_proc_data` | NUL bytes except for `LD_LIBRARY_PATH` | Unchanged | None |
|
|
132
133
|
| `ENV.drop_proc_data` | Empty | Zero | `CAP_SYS_RESOURCE` |
|
|
133
134
|
|
|
134
135
|
Choose the least power you need.
|
|
@@ -137,8 +138,14 @@ Choose the least power you need.
|
|
|
137
138
|
> `ENV.drop_proc_data` requires `CAP_SYS_RESOURCE` on Linux. Without it, the
|
|
138
139
|
> method raises `Errno::EPERM`.
|
|
139
140
|
|
|
140
|
-
Masking works on raw bytes, not characters.
|
|
141
|
-
the first and last with `*`. Values shorter than three
|
|
141
|
+
Masking works on raw bytes, not characters. For entries it masks, it replaces
|
|
142
|
+
all value bytes except the first and last with `*`. Values shorter than three
|
|
143
|
+
bytes stay unchanged.
|
|
144
|
+
|
|
145
|
+
Masking and scrubbing leave the original `LD_LIBRARY_PATH` entry visible on all
|
|
146
|
+
Linux systems because the musl dynamic linker still uses its original bytes to
|
|
147
|
+
find libraries. Changing or deleting the variable in Ruby's `ENV` does not
|
|
148
|
+
change the original entry. Dropping hides it without rewriting the bytes.
|
|
142
149
|
|
|
143
150
|
[Back to top](#readme-top).
|
|
144
151
|
|
|
@@ -158,7 +165,8 @@ start. This makes `/proc/self/environ` truly zero-length. Linux requires the
|
|
|
158
165
|
|
|
159
166
|
## Process Inheritance
|
|
160
167
|
|
|
161
|
-
Call a method before `fork` and each child inherits the changed proc view.
|
|
168
|
+
Call a method before `fork` and each child inherits the changed proc view.
|
|
169
|
+
`fork` copies the changed bytes and does not rebuild them from Ruby `ENV`. Ruby
|
|
162
170
|
`ENV` remains available in the parent and children. The test suite checks this
|
|
163
171
|
with a second fork for all three methods.
|
|
164
172
|
|
|
@@ -167,36 +175,48 @@ proc environment. That program must load ENVameleon and call a method itself.
|
|
|
167
175
|
|
|
168
176
|
### Forking servers
|
|
169
177
|
|
|
170
|
-
|
|
171
|
-
|
|
178
|
+
Call the method in the parent before it forks so workers inherit the changed
|
|
179
|
+
view. Scrubbing leaves `LD_LIBRARY_PATH` visible in both the parent and workers.
|
|
180
|
+
|
|
181
|
+
Do not rely on a worker boot hook alone. It changes only the worker. The parent
|
|
182
|
+
runs as the same user, so anyone who can read the worker's files can also read
|
|
183
|
+
`/proc/<parent pid>/environ`.
|
|
184
|
+
|
|
185
|
+
These examples use scrubbing, which needs no extra right. In the Unicorn, Puma,
|
|
186
|
+
and Karafka examples, a failed call stops the server before it starts work.
|
|
172
187
|
|
|
173
188
|
#### Unicorn
|
|
174
189
|
|
|
190
|
+
Call the method at the top of the Unicorn config file. The master evaluates it
|
|
191
|
+
before it forks workers.
|
|
192
|
+
|
|
175
193
|
```ruby
|
|
194
|
+
# config/unicorn.rb
|
|
176
195
|
require "envameleon"
|
|
177
196
|
|
|
178
|
-
|
|
179
|
-
ENV.scrub_proc_data
|
|
180
|
-
end
|
|
197
|
+
ENV.scrub_proc_data
|
|
181
198
|
```
|
|
182
199
|
|
|
183
200
|
#### Puma
|
|
184
201
|
|
|
185
|
-
|
|
186
|
-
|
|
202
|
+
Call the method at the top of `config/puma.rb`. This works in single and
|
|
203
|
+
cluster mode.
|
|
187
204
|
|
|
188
205
|
```ruby
|
|
206
|
+
# config/puma.rb
|
|
189
207
|
require "envameleon"
|
|
190
208
|
|
|
191
|
-
|
|
192
|
-
ENV.scrub_proc_data
|
|
193
|
-
end
|
|
209
|
+
ENV.scrub_proc_data
|
|
194
210
|
```
|
|
195
211
|
|
|
212
|
+
Puma logs and ignores errors raised in `before_worker_boot`. A failed call
|
|
213
|
+
there leaves the worker running with its environment visible.
|
|
214
|
+
|
|
196
215
|
#### Sidekiq
|
|
197
216
|
|
|
198
217
|
Standard Sidekiq uses threads. Its startup hook runs before work begins. Sidekiq
|
|
199
|
-
Enterprise Swarm runs the hook in each child.
|
|
218
|
+
Enterprise Swarm runs the hook in each child. The swarm parent is a separate
|
|
219
|
+
process and keeps its own view. See [Security Limits](#security-limits).
|
|
200
220
|
|
|
201
221
|
```ruby
|
|
202
222
|
require "envameleon"
|
|
@@ -208,15 +228,15 @@ end
|
|
|
208
228
|
|
|
209
229
|
#### Karafka
|
|
210
230
|
|
|
211
|
-
|
|
212
|
-
|
|
231
|
+
Call the method at the top of `karafka.rb`. Both `karafka server` and the Swarm
|
|
232
|
+
supervisor load this file before they start work. Swarm nodes inherit the
|
|
233
|
+
changed view. The `app.running` event never runs in the Swarm supervisor.
|
|
213
234
|
|
|
214
235
|
```ruby
|
|
236
|
+
# karafka.rb
|
|
215
237
|
require "envameleon"
|
|
216
238
|
|
|
217
|
-
|
|
218
|
-
ENV.scrub_proc_data
|
|
219
|
-
end
|
|
239
|
+
ENV.scrub_proc_data
|
|
220
240
|
```
|
|
221
241
|
|
|
222
242
|
If a child calls `ENV.drop_proc_data`, it must still have the needed Linux right.
|
|
@@ -235,9 +255,22 @@ ENVameleon changes only what `/proc/self/environ` shows. It does not erase every
|
|
|
235
255
|
copy of a secret. It gives no protection from memory disclosure, debuggers, or
|
|
236
256
|
core dumps.
|
|
237
257
|
|
|
258
|
+
ENVameleon changes only the process that calls it and the children it forks
|
|
259
|
+
later. Any other process started with the secret still shows it in
|
|
260
|
+
`/proc/<pid>/environ`. That includes the parent, PID 1 in a container, wrapper
|
|
261
|
+
shells, and process managers. A process running as the same user can usually
|
|
262
|
+
read those files. Start the app with `exec` so no wrapper shell stays behind.
|
|
263
|
+
|
|
238
264
|
Dropping leaves the old bytes in memory. Masking keeps variable names and the
|
|
239
|
-
outer bytes of
|
|
240
|
-
|
|
265
|
+
outer bytes of masked values. Short values remain fully visible. Masking and
|
|
266
|
+
scrubbing both leave `LD_LIBRARY_PATH` visible in `/proc/self/environ` if it was
|
|
267
|
+
present at startup and has not already been overwritten.
|
|
268
|
+
|
|
269
|
+
Code that saved a pointer into the original environment before Ruby started,
|
|
270
|
+
such as the dynamic linker or a preloaded library, sees any bytes that masking
|
|
271
|
+
or scrubbing rewrites, even though Ruby's `ENV` stays unchanged. Neither method
|
|
272
|
+
can restore an entry that a long process title or other code has already
|
|
273
|
+
overwritten.
|
|
241
274
|
|
|
242
275
|
[Back to top](#readme-top).
|
|
243
276
|
|
|
@@ -262,15 +295,22 @@ Build the macOS and Windows no-op gems and the Linux source fallback with:
|
|
|
262
295
|
bundle exec rake gem
|
|
263
296
|
```
|
|
264
297
|
|
|
265
|
-
Native builds run
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
298
|
+
Native builds run in a container image pinned by digest for each platform.
|
|
299
|
+
The build checks the SHA-256 checksums of RubyGems 4.1.1 and the Bundler version
|
|
300
|
+
in `Gemfile.lock` before installing them. Bundler then checks the locked
|
|
301
|
+
dependencies and installs them from the local cache. If a `rake-compiler-dock`
|
|
302
|
+
update changes its image version, update the version and digests in
|
|
303
|
+
[`.github/scripts/native_platforms.rb`](.github/scripts/native_platforms.rb)
|
|
304
|
+
in the same change; native build tasks reject an image version mismatch.
|
|
305
|
+
|
|
306
|
+
Each native build produces the platform's multi-ABI gem and one
|
|
307
|
+
hash-named gem per supported Ruby ABI. Start with an empty `pkg` directory and
|
|
308
|
+
run the verifier with RubyGems 4.1 or newer on the host:
|
|
269
309
|
|
|
270
310
|
```console
|
|
271
311
|
bundle cache --all-platforms
|
|
272
312
|
bundle exec rake gem:x86_64-linux-gnu
|
|
273
|
-
ruby .github/scripts/verify_native_gem.rb pkg
|
|
313
|
+
ruby .github/scripts/verify_native_gem.rb pkg x86_64-linux-gnu
|
|
274
314
|
```
|
|
275
315
|
|
|
276
316
|
## License
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,122 +1,134 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: envameleon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: aarch64-linux-gnu
|
|
6
6
|
authors:
|
|
7
|
-
- Dmytro Shteflyuk
|
|
7
|
+
- Dmytro Shteflyuk
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- !ruby/object:Gem::
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: rake
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
-
|
|
17
|
+
- ~>
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: "13.2"
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
-
|
|
25
|
+
- ~>
|
|
26
|
+
- !ruby/object:Gem::Version
|
|
27
|
+
version: "13.2"
|
|
28
|
+
- !ruby/object:Gem::Dependency
|
|
29
|
+
name: rake-compiler
|
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
|
31
|
+
requirements:
|
|
32
|
+
-
|
|
33
|
+
- ~>
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: 1.3.2
|
|
36
|
+
type: :development
|
|
37
|
+
prerelease: false
|
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
-
|
|
41
|
+
- ~>
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: 1.3.2
|
|
44
|
+
- !ruby/object:Gem::Dependency
|
|
45
|
+
name: rake-compiler-dock
|
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
|
47
|
+
requirements:
|
|
48
|
+
-
|
|
49
|
+
- ~>
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: "1.12"
|
|
52
|
+
type: :development
|
|
53
|
+
prerelease: false
|
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
55
|
+
requirements:
|
|
56
|
+
-
|
|
57
|
+
- ~>
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: "1.12"
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: standard
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
-
|
|
65
|
+
- ~>
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: "1.56"
|
|
68
|
+
type: :development
|
|
69
|
+
prerelease: false
|
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
-
|
|
73
|
+
- ~>
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: "1.56"
|
|
76
|
+
- !ruby/object:Gem::Dependency
|
|
77
|
+
name: test-unit
|
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
-
|
|
81
|
+
- ~>
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: "3.7"
|
|
84
|
+
type: :development
|
|
85
|
+
prerelease: false
|
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
-
|
|
89
|
+
- ~>
|
|
90
|
+
- !ruby/object:Gem::Version
|
|
91
|
+
version: "3.7"
|
|
92
|
+
description: "Scrub, mask, or drop Linux's /proc/self/environ view without changing Ruby's ENV."
|
|
84
93
|
executables: []
|
|
85
94
|
extensions: []
|
|
86
95
|
extra_rdoc_files: []
|
|
87
96
|
files:
|
|
88
|
-
- LICENSE.txt
|
|
89
|
-
- README.md
|
|
90
|
-
- lib/envameleon.rb
|
|
91
|
-
- lib/envameleon/3.2/envameleon.so
|
|
92
|
-
- lib/envameleon/3.3/envameleon.so
|
|
93
|
-
- lib/envameleon/3.4/envameleon.so
|
|
94
|
-
- lib/envameleon/4.0/envameleon.so
|
|
95
|
-
homepage: https://github.com/kpumuk/envameleon
|
|
97
|
+
- LICENSE.txt
|
|
98
|
+
- README.md
|
|
99
|
+
- lib/envameleon.rb
|
|
100
|
+
- lib/envameleon/3.2/envameleon.so
|
|
101
|
+
- lib/envameleon/3.3/envameleon.so
|
|
102
|
+
- lib/envameleon/3.4/envameleon.so
|
|
103
|
+
- lib/envameleon/4.0/envameleon.so
|
|
104
|
+
homepage: "https://github.com/kpumuk/envameleon"
|
|
96
105
|
licenses:
|
|
97
|
-
- MIT
|
|
106
|
+
- MIT
|
|
98
107
|
metadata:
|
|
99
|
-
bug_tracker_uri: https://github.com/kpumuk/envameleon/issues
|
|
100
|
-
rubygems_mfa_required:
|
|
101
|
-
source_code_uri: https://github.com/kpumuk/envameleon
|
|
108
|
+
bug_tracker_uri: "https://github.com/kpumuk/envameleon/issues"
|
|
109
|
+
rubygems_mfa_required: "true"
|
|
110
|
+
source_code_uri: "https://github.com/kpumuk/envameleon"
|
|
102
111
|
rdoc_options: []
|
|
103
112
|
require_paths:
|
|
104
|
-
- lib
|
|
113
|
+
- lib
|
|
105
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
115
|
requirements:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
|
|
116
|
+
-
|
|
117
|
+
- ">="
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: 3.2.0
|
|
120
|
+
-
|
|
121
|
+
- "<"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: 4.1.0.dev
|
|
113
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
125
|
requirements:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
126
|
+
-
|
|
127
|
+
- ">="
|
|
128
|
+
- !ruby/object:Gem::Version
|
|
129
|
+
version: 3.3.22
|
|
118
130
|
requirements: []
|
|
119
|
-
rubygems_version: 4.
|
|
131
|
+
rubygems_version: 4.1.1
|
|
120
132
|
specification_version: 4
|
|
121
133
|
summary: Leave no ENVidence.
|
|
122
134
|
test_files: []
|