Skip to content
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

nixos/mysql: enable sandbox mode #87833

Merged
merged 3 commits into from Jun 16, 2020
Merged

nixos/mysql: enable sandbox mode #87833

merged 3 commits into from Jun 16, 2020

Conversation

@Izorkin
Copy link
Contributor

Izorkin commented May 14, 2020

Motivation for this change

Running mysql service in sandbox mode.
When the service startup, forced changed permissions to MySQL database folder.

cc @aanderse @flokli

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@Izorkin
Copy link
Contributor Author

Izorkin commented May 14, 2020

@GrahamcOfBorg test mariadb-galera-mariabackup
@GrahamcOfBorg test mariadb-galera-rsync
@GrahamcOfBorg test mysql
@GrahamcOfBorg test mysql-autobackup
@GrahamcOfBorg test mysql-backup
@GrahamcOfBorg test mysql-replication

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 5, 2020

@Mic92
Mic92 approved these changes Jun 5, 2020
Copy link
Contributor

Mic92 left a comment

Looks safe to me. I retired my mysql database though. Maybe someone else could test this?

Copy link
Contributor

aanderse left a comment

In a separate PR we should eliminate the need to run anything as root. I can do that.

@Izorkin Izorkin force-pushed the Izorkin:sandbox-mysql branch from 2898679 to d894cf0 Jun 5, 2020
@Izorkin Izorkin requested a review from aanderse Jun 8, 2020
Copy link
Contributor

aanderse left a comment

Just a couple minor requests, if you don't mind, and then we should merge this ASAP. Thanks for your never ending hard work @Izorkin!

nixos/modules/services/databases/mysql.nix Outdated Show resolved Hide resolved
nixos/doc/manual/release-notes/rl-2009.xml Outdated Show resolved Hide resolved
@Izorkin Izorkin force-pushed the Izorkin:sandbox-mysql branch from d894cf0 to 559af75 Jun 10, 2020
@Izorkin Izorkin force-pushed the Izorkin:sandbox-mysql branch from 559af75 to eed170d Jun 10, 2020
Copy link
Contributor

aanderse left a comment

Thanks for all the discussion. I was happy to learn a few things. @Mic92 I'll leave final approval and merging to you.

@aanderse
Copy link
Contributor

aanderse commented Jun 10, 2020

It also occurred to me that while we are doing a good job with release notes maybe we should write a section in the NixOS manual about systemd hardening in general. I have had to explain to a coworker why some of their code stopped working when they upgraded to Debian 9 - it was because of some systemd hardening that never used to exist. For people new(er) to systemd it can be fairly frustrating and confusing initially.

@Mic92 Mic92 merged commit a9a5016 into NixOS:master Jun 16, 2020
14 checks passed
14 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="eed170d"; rev="eed170d9ab643424d0771b6b4fea771e138e901b"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="eed170d"; rev="eed170d9ab643424d0771b6b4fea771e138e901b"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="eed170d"; rev="eed170d9ab643424d0771b6b4fea771e138e901b"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="eed170d"; rev="eed170d9ab643424d0771b6b4fea771e138e901b"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="eed170d"; rev="eed170d9ab643424d0771b6b4fea771e138e901b"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="eed170d"; rev="eed170d9ab643424d0771b6b4fea771e138e901b"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="eed170d"; rev="eed170d9ab643424d0771b6b4fea771e138e901b"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@Izorkin Izorkin deleted the Izorkin:sandbox-mysql branch Jun 16, 2020
@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 16, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.