all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marc Coquand <marc@coquand.email>
To: help-guix@gnu.org
Subject: least-authority-wrapper - clone: permission not permitted
Date: Fri, 13 Dec 2024 12:06:16 +0200	[thread overview]
Message-ID: <874j37kicn.fsf@coquand.email> (raw)


Heya,

I'm trying to /wrap/ my head around least-authority-wrapper.

Specifically, I have a guile script that sends an email with msmtp and
fetches secrets using cat. This is a script that is run by the laminar
service when a build job is complete. Since it doesn't need to access
all secrets I make available through sops-guix, I wanted to try to
containerize it and lock it down from accessing files outside of the
ones it needs. 

This is the program that I have:

(least-authority-wrapper
    (program-file "after" notify-mail-gexp)
    #:name "after"
    #:user "laminar"
    #:group "laminar"
    #:namespaces
    '(mnt) ;; This is the namespace causing issues
    #:mappings (list
		(file-system-mapping
		 (source (file-append nss-certs "/etc/ssl/certs"))
		 (target source)
		 (writable? #t))
		(file-system-mapping
		 (source "/var/lib/laminar")
		 (target source)
		 (writable? #t))
		(file-system-mapping
		 (source "/run/secrets/after")
		 (target source)
		 (writable? #t)))
    #:preserved-environment-variables
    '( "USER" "TERM" "JOB" "RESULT" "RUN" "SSL_CERT_FILE" "SSL_CERT_DIR" "GIT_SSL_CAINFO"))

After some debugging, I found that it was the namespace 'mnt that was
causing issues, the script works when I remove it. 

The error I'm getting is

Backtrace:
           5 (primitive-load "/var/lib/laminar/cfg/after")
In ice-9/eval.scm:
   191:35  4 (_ #f)
In gnu/build/linux-container.scm:
    300:8  3 (call-with-temporary-directory #<procedure 7f7e58d71a50?>)
   397:16  2 (_ "/tmp/guix-directory.nIT1Mt")
    239:7  1 (run-container "/tmp/guix-directory.nIT1Mt" (#<<fil?> ?) ?)
In guix/build/syscalls.scm:
  1143:12  0 (_ 131089)

guix/build/syscalls.scm:1143:12: In procedure clone: 131089: Operation not permitted

When I try to invoke the script.

Any clue why I'm getting the operation not permitted error? 

-- 
Marc


                 reply	other threads:[~2024-12-13 10:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874j37kicn.fsf@coquand.email \
    --to=marc@coquand.email \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.