summary refs log tree commit diff
path: root/nixos/tests/hardened.nix
Commit message (Collapse)AuthorAge
* nixos/nix-daemon: use structural settingspolykernel2022-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `nix.*` options, apart from options for setting up the daemon itself, currently provide a lot of setting mappings for the Nix daemon configuration. The scope of the mapping yields convience, but the line where an option is considered essential is blurry. For instance, the `extra-sandbox-paths` mapping is provided without its primary consumer, and the corresponding `sandbox-paths` option is also not mapped. The current system increases the maintenance burden as maintainers have to closely follow upstream changes. In this case, there are two state versions of Nix which have to be maintained collectively, with different options avaliable. This commit aims to following the standard outlined in RFC 42[1] to implement a structural setting pattern. The Nix configuration is encoded at its core as key-value pairs which maps nicely to attribute sets, making it feasible to express in the Nix language itself. Some existing options are kept such as `buildMachines` and `registry` which present a simplified interface to managing the respective settings. The interface is exposed as `nix.settings`. Legacy configurations are mapped to their corresponding options under `nix.settings` for backwards compatibility. Various options settings in other nixos modules and relevant tests have been updated to use structural setting for consistency. The generation and validation of the configration file has been modified to use `writeTextFile` instead of `runCommand` for clarity. Note that validation is now mandatory as strict checking of options has been pushed down to the derivation level due to freeformType consuming unmatched options. Furthermore, validation can not occur when cross-compiling due to current limitations. A new option `publicHostKey` was added to the `buildMachines` submodule corresponding to the base64 encoded public host key settings exposed in the builder syntax. The build machine generation was subsequently rewritten to use `concatStringsSep` for better performance by grouping concatenations. [1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
* nixos/tests: drop latestKernel.hardenedrnhmjoj2021-09-22
| | | | | The latest kernel does not guarantee a hardened version anymore, see ga5341beb for the motivation.
* nixos/lock-kernel-modules: reorder before/afterrnhmjoj2021-09-19
| | | | | | | Moving the service before multi-user.target (so the `hardened` test continue to work the way it did before) can result in locking the kernel too early. It's better to lock it a bit later and changing the test to wait specifically for the disable-kernel-module-loading.service.
* graphene-hardened-malloc: 2 -> 8Robert Scott2021-08-14
| | | | | | significantly overhaul tests to cover build-time-linking and LD_PRELOAD use, simplifying the hardened nixos test to allow it to reuse this test setup.
* nixos/hidepid: drop the module as the hidepid mount option is brokenDominik Xaver Hörl2021-02-21
| | | | | This has been in an unusable state since the switch to cgroups-v2. See https://github.com/NixOS/nixpkgs/issues/73800 for details.
* nixosTests.*: update to use virtualisation.fileSystemsMaciej Krüger2021-02-14
|
* treewide: simplify pkgs.stdenv.lib -> pkgs.libDominik Xaver Hörl2021-01-10
| | | | | The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs.
* tests/hardened: Fix usage with 5.8Tim Steinbach2020-10-05
| | | | | Linux >= 5.8 improved /proc mount options. `hidepid=2` is now displayed as `hidepid=invisible`
* nixos/hardened: Port test to Python and fix itJanne Heß2020-08-21
| | | | | | | | Related to #72828 Replaces and closes #76708 Looks like `nix ping-store` does not output anything anymore but still fails when the connection does not work.
* nixos/tests/hardened: add latestKernel argumentEmily2020-04-17
|
* nixos/hardened: enable user namespaces for rootEmily2020-04-17
| | | | | | | | | | | | | | | | | | | | | linux-hardened sets kernel.unprivileged_userns_clone=0 by default; see anthraxx/linux-hardened@104f44058f058a395502192c4939645df6f52ecb. This allows the Nix sandbox to function while reducing the attack surface posed by user namespaces, which allow unprivileged code to exercise lots of root-only code paths and have lead to privilege escalation vulnerabilities in the past. We can safely leave user namespaces on for privileged users, as root already has root privileges, but if you're not running builds on your machine and really want to minimize the kernel attack surface then you can set security.allowUserNamespaces to false. Note that Chrome's sandbox requires either unprivileged CLONE_NEWUSER or setuid, and Firefox's silently reduces the security level if it isn't allowed (see about:support), so desktop users may want to set: boot.kernel.sysctl."kernel.unprivileged_userns_clone" = true;
* tests/hardened: fix buildJoachim Fasting2019-09-18
| | | | | | Bug introduced by 4ead3d2ec3d4fac9ee22da47bbe3bc9defb62c49 For ZHF https://github.com/NixOS/nixpkgs/issues/68361
* treewide: remove redundant recvolth2019-08-28
|
* Merge pull request #60187 from joachifm/feat/configurable-mallocJoachim F2019-05-12
|\ | | | | nixos: configurable system-wide malloc
| * nixos/tests/hardened: test hardened mallocJoachim Fasting2019-05-07
| |
* | nixos/tests/hardened: check that apparmor is properly loadedJoachim Fasting2019-05-11
|/
* nixos/tests/hardened: test loading out-of-tree-modulesJoachim Fasting2019-01-06
|
* nixos/security/misc: factor out protectKernelImageJoachim Fasting2018-12-27
| | | | | | | | | Introduces the option security.protectKernelImage that is intended to control various mitigations to protect the integrity of the running kernel image (i.e., prevent replacing it without rebooting). This makes sense as a dedicated module as it is otherwise somewhat difficult to override for hardened profile users who want e.g., hibernation to work.
* nixos/hardened: restrict access to nix daemonJoachim Fasting2018-11-24
|
* nixos/tests/hardened: fix build by disabling nix.useSandboxJoachim Fasting2018-11-24
|
* [bot] nixos/*: remove unused arguments in lambdasvolth2018-07-20
|
* nixos/tests/hardened: fix test (#40745)xeji2018-05-19
| | | | failed because `pgrep -u` segfaults when accesss to proc info is denied on a hardened system.
* nixos/hardened test: add failing test-case for deferred mountsJoachim Fasting2017-09-22
|
* nixos/tests: expand hardened testsJoachim Fasting2017-09-16
|
* nixos/hardened profile: disable user namespaces at runtimeJoachim Fasting2017-04-30
|
* nixos/tests: add tests for exercising various hardening featuresJoachim Fasting2017-04-30
This test exercises the linux_hardened kernel along with the various hardening features (enabled via the hardened profile). Move hidepid test from misc, so that misc can go back to testing a vanilla configuration.