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

test remount-secure script and systemd unit #203

Open
adrelanos opened this issue Feb 22, 2024 · 3 comments
Open

test remount-secure script and systemd unit #203

adrelanos opened this issue Feb 22, 2024 · 3 comments

Comments

@adrelanos
Copy link
Member

Developer discussion. Not for users since not the in the testers repository yet.

Based suggestions in #202 thanks to @monsieuremre, recently I have improved.

Enabling it should be as simple as:

sudo systemctl enable remount-secure.service

Risks: Breaking the boot.

Unbreaking the boot?

  • A) Booting into recovery mode and disalbing the systemd unit or,
  • B) kernel parameter remountsecure=0

might work.

@monsieuremre
Copy link
Contributor

monsieuremre commented Feb 26, 2024

Once again, I want to give my opinion here. I am not a big fan of bind mounting things. My suggested implementation was, how would it be done if we absolutely wanted bind units. It goes without saying that remounting anything is completely unnecessary and does nothing but add extra overhead and complexity. These can be hardened with drop in files, as I suggested previously. Api file systems can be hardened from the kernel command line, again, a drop-in file. Bind mounting stuff is where we can't use drop in files. Actually, if we wanted, we could. But I already am not a fan of bind mounts. We can create bind units under /usr/lib/systemd, but really, should we be the one to have the var.mount unit? Like someone else might want to own that file, I don't know. My suggestion is, let's do drop in's boot parameters. I don't support bind mounts. But if it is desired, it can be done with either

  • a service such as this (messy)
  • boot parameter, again, fstab lines (preferred)
  • systemd units under /usr/lib (less messy, but still is messy)

For API file systems and real partitions, a service or a hook should not be used. This is not only unnecessary, but introduces overhead.

@adrelanos
Copy link
Member Author

Seems off-topic since it does not contribute towards the testing of remount-secure script / systemd unit file. Instead replied to it here: #157 (comment)

@monsieuremre
Copy link
Contributor

Actually never mind. Systemd units for everything just works fine. Will create a pull when I find the time. No bash scripting is used, just systemd units that are triggered based on conditions. Actually I am not sure why I haven't thought of this before. This officially covers everything. It is really similar to previous suggestions too, just fills in the missing gaps.

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

No branches or pull requests

2 participants