Returns true when TSK is running inside a TSK container with proxy env vars pointing to `tsk-proxy`. In this case, proxy and network isolation are handled by the outer container's Docker environment, so we skip them for nested containers. We require proxy env vars to reference `tsk-proxy` to avoid silently granting unrestricted internet access when `TSK_CONTAINER=1` is set without a properly conf
(&self)
| 205 | /// granting unrestricted internet access when `TSK_CONTAINER=1` is set |
| 206 | /// without a properly configured proxy. |
| 207 | fn is_nested(&self) -> bool { |
| 208 | // In tests, always use the normal proxy/network path so mocks work correctly |
| 209 | if cfg!(test) { |
| 210 | return false; |
| 211 | } |
| 212 | std::env::var("TSK_CONTAINER").is_ok() && Self::has_tsk_proxy_env() |
| 213 | } |
| 214 | |
| 215 | /// Returns true if at least one proxy env var references the `tsk-proxy` host. |
| 216 | fn has_tsk_proxy_env() -> bool { |
no outgoing calls
no test coverage detected