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

[BUG] Symlinks do not carry out the set permissions #261

Open
Kreyren opened this issue May 26, 2024 · 1 comment
Open

[BUG] Symlinks do not carry out the set permissions #261

Kreyren opened this issue May 26, 2024 · 1 comment

Comments

@Kreyren
Copy link
Contributor

Kreyren commented May 26, 2024

In example configuration where you e.g. want to set an SSHD for an onion service, but don't want the people to know the onion url:

{ config, ... }:

{
    age.secrets.SYSTEM-onion = {
		file = ./SYSTEM-onion.age;
		owner = "tor";
		group = "tor";
		mode = "0400";
		path = "/var/lib/tor/SYSTEM-onion.conf";
	};
	
	# Make tor source the file
	services.tor.settings."%include" = config.age.secrets."pelagus-onion".path;
}

with secret:

MapAddress SYSTEM.TLD somewhereinthedark.onion

will generate a symlink with root:root ownership:

lrwxrwxrwx 1 root root 25 May 26 22:10 pelagus-onion.conf -> /run/agenix/pelagus-onion

that causes tor to fail:

image

Adding symlink = false; or changing the symlink's permissions to tor:tor appears to fix the problem.

Proposal

Make the symlink carry out the permissions set in age.secret.SECRET.{owner,group,mode}

Relevants

Wasted ~20 hours on this in development of https://github.com/kreyren/nixos-config for PELAGUS system on NixOS distribution.

@AidanHilt
Copy link

Did you ever find a workaround or fix for this? I'm seeing the same issue.

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