-
Notifications
You must be signed in to change notification settings - Fork 20
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
Encasementlib treats all args as security layers #172
Comments
Said differently, if a security layer wants to have its own arguments, if We need this to be documented in a clear way and tested. On Wed, Jul 29, 2015 at 3:03 AM, Yanyan Zhuang [email protected]
|
Compare with this security layer that just https://github.com/aaaaalbert/benchmark_repy_v2/blob/master/mutarg-seclayer-init.r2py#L6-L7 |
This commit adds the required `CHILD_CONTEXT_DEF`s for the security layer. However, testing reveals that SeattleTestbed/seattlelib_v2#172 ("Encasementlib treats all args as security layers") is still a problem: Currently, the firewall layer assumes that you specify the subnets to be filtered as callargs; `encasementlib` does not support this correctly. (The question actually is whether `encasementlib` *could* support this correctly at all --- from what I see, there is no way telling which security layer in `encasementlib`s `callargs` should get which command-line argument(s). We are probably better off just requiring a sec layer config file for those layers that need configuration....)
OK, security layers that take a fixed number of arguments can just modify the Layers that take a variable number of arguments can perhaps steal the idea described in aaaaalbert/repy_v2@577526e: Use For the "firewall" layer mentioned in the automatic reference above, I could then use things like
(Another, less beautiful, way to solve this would be to not allow any callargs to security layers, but use config files instead.) |
When we want to specify an arg to a security layer, encasementlib mistakenly thinks the arg is another security layer.
`start dylink.r2py encasementlib.r2py sensor_layer.r2py restrict_battery.r2py -- -s 10 nanny_battery_test.r2py
......
User traceback:
"dylink.r2py", line 547, in
"dylink.r2py", line 408, in dylink_dispatch
"dylink.r2py", line 521, in evaluate
"encasementlib.r2py", line 242, in
"encasementlib.r2py", line 227, in secure_dispatch
"dylink.r2py", line 521, in evaluate
"sensor_layer.r2py", line 250, in
"encasementlib.r2py", line 177, in _secure_dispatch_closure
"encasementlib.r2py", line 227, in secure_dispatch
"dylink.r2py", line 521, in evaluate
"restrict_battery.r2py", line 37, in
"encasementlib.r2py", line 177, in _secure_dispatch_closure
"encasementlib.r2py", line 221, in secure_dispatch
"encasementlib.r2py", line 77, in _layer_code
Exception (with class 'exception_hierarchy.FileNotFoundError'): Cannot load security layer '-s'. File not found.`
Here -s is an arg to security layer restrict_battery.r2py.
The text was updated successfully, but these errors were encountered: