> Not really; Also I am certainly missing bits of knowledge to grasp
what is going on in your case. It must be the interaction with
certificates but my test case doesn't include that. I'll keep looking
and will ask around but feel free to share documents that might help me
understand the issue further, if you have any.

The trust issue appears to have been a result of the following policy:

        "SecurityDevices": {
            "p11-kit-trust.so for corporate certificate chain": 
"/usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so"
        }

The issue does appear to persist across restarts of Firefox even after
removing the policy (though I'd need to reconfirm this), though removing
'~/snap/firefox/common/.mozilla/' appears to fix this (and wipes the
browser configuration, so careful).  This appears to be a regression,
but it is unrelated to this issue.

Unfortunately, the above mechanism was how I was configuring trust for
our internal root CAs, so I needed a workaround.  The workaround was to
copy each certificate manually into the the following directory:
'~/snap/firefox/common/.mozilla/certificates/' and then create a Firefox
policy telling Mozilla to trust each of these Root CAs:

        "Certificates": {
            "Install": [
                
"/home/wtcline/snap/firefox/common/.mozilla/certificates/CorporateCA1.crt",
                
"/home/wtcline/snap/firefox/common/.mozilla/certificates/CorporateCA2.crt",
                
"/home/wtcline/snap/firefox/common/.mozilla/certificates/CorporateCA3.crt",
            ]
        }

> Indeed, I was expecting that workflow. I did not know that one logs in
as a normal user. But after a Kinit, your KRB5CCNAME is set-up in the
environment, correct? Then try to launch Firefox from that terminal
where you did Kinit.

Nope.  My understanding is that most programs will prioritize
'KRB5CCNAME' if and only if it's set, otherwise they will use the value
specified in the 'krb5.conf' or 'krb5.cond.d/*' file(s) (presumably
parsed by a library that said program links with).

> That is expected because Snapd relies on KRB5CCNAME to expose the ticket to a 
> place from which the snap can read the ticket.
>
> What you could try is to manually run
>
>   KRB5CCNAME=FILE:/tmp/krb5cc_{ETC} firefox
>
> where /tmp/krb5cc_{ETC} is the ticket's path as you see outside the sandbox.

I've not had any luck getting that environment variable passed to
Firefox... I think?  I say "I think" because no matter what happens I've
yet to see the environment variable listed in Firefox's 'about:support'
page.

I first tried what appeared to be the proper way, but got an error:

        wtcline@wtcline-desk20:~$ sudo snap set firefox 
env.KRB5CCNAME="FILE:/tmp/krb5cc_1000"
        error: cannot perform the following tasks:
        - Run configure hook of "firefox" snap (invalid option name: 
"KRB5CCNAME")

Yet if I set 'KRB5CCNAME=/tmp/krb5cc_1000' in '/etc/environment' and
reboot then I can get output like the following:

        wtcline@wtcline-desk20:~$ snap run --shell firefox -c 'env|grep KRB'
        2025/09/03 17:44:39.874455 cmd_run.go:1408: WARNING: will not expose 
Kerberos tickets' path: Unsupported KRB5CCNAME: /tmp/krb5cc_1000
        update.go:85: cannot change mount namespace according to change mount 
(/var/lib/snapd/hostfs/usr/local/share/doc /usr/local/share/doc none bind,ro 0 
0): cannot write to "/var/lib/snapd/hostfs/usr/local/share/doc" because it 
would affect the host in "/var/lib/snapd"
        update.go:85: cannot change mount namespace according to change mount 
(/var/lib/snapd/hostfs/usr/share/gimp/2.0/help /usr/share/gimp/2.0/help none 
bind,ro 0 0): cannot write to "/var/lib/snapd/hostfs/usr/share/gimp/2.0/help" 
because it would affect the host in "/var/lib/snapd"
        update.go:85: cannot change mount namespace according to change mount 
(/var/lib/snapd/hostfs/usr/share/gtk-doc /usr/share/gtk-doc none bind,ro 0 0): 
cannot write to "/var/lib/snapd/hostfs/usr/share/gtk-doc" because it would 
affect the host in "/var/lib/snapd"
        update.go:85: cannot change mount namespace according to change mount 
(/var/lib/snapd/hostfs/usr/share/libreoffice/help /usr/share/libreoffice/help 
none bind,ro 0 0): cannot write to 
"/var/lib/snapd/hostfs/usr/share/libreoffice/help" because it would affect the 
host in "/var/lib/snapd"
        update.go:85: cannot change mount namespace according to change mount 
(/var/lib/snapd/hostfs/usr/share/sphinx_rtd_theme /usr/share/sphinx_rtd_theme 
none bind,ro 0 0): cannot write to 
"/var/lib/snapd/hostfs/usr/share/sphinx_rtd_theme" because it would affect the 
host in "/var/lib/snapd"
        update.go:85: cannot change mount namespace according to change mount 
(/var/lib/snapd/hostfs/usr/share/xubuntu-docs /usr/share/xubuntu-docs none 
bind,ro 0 0): cannot write to "/var/lib/snapd/hostfs/usr/share/xubuntu-docs" 
because it would affect the host in "/var/lib/snapd"
        KRB5CCNAME=/tmp/krb5cc_1000

The "will not expose Kerberos ticket's path" is rather interesting, but
it's not clear what 'cmd_run.go' is expecting to see.  At some point I
also managed to get:

        wtcline@wtcline-desk20:/home/wtcline$ snap run --shell firefox -c 
'env|grep KRB'
        KRB5CCNAME=FILE:/var/lib/snapd/hostfs/tmp/krb5cc_1000
        bash: /usr/libexec/vte-urlencode-cwd: No such file or directory

...which is not a path that I ever specified and has clearly been
transformed by Snap.  Any idea what method I should be using to set the
environment variable?  Do you see the environment variable in
'about:support'?  It seems to differ from what 'snap run --shell
firefox' shows, which is surprising.

Anyways, I tried a bit of fiddling but wasn't able to get Kerberos auth
to work.  I even tried manually putting the ticket in the Snap's
sandbox, but it didn't help.  Enabling logging still shows the following
error:

        [Parent 2504: Main Thread]: D/negotiateauth   using REQ_DELEGATE
        [Parent 2504: Main Thread]: D/negotiateauth   service = 
redacted.corporate.com
        [Parent 2504: Main Thread]: D/negotiateauth   using negotiate-gss
        [Parent 2504: Main Thread]: D/negotiateauth entering 
nsAuthGSSAPI::nsAuthGSSAPI()
        [Parent 2504: Main Thread]: D/negotiateauth Attempting to load gss 
functions
        [Parent 2504: Main Thread]: D/negotiateauth entering 
nsAuthGSSAPI::Init()
        [Parent 2504: BgIOThreadPool #2]: D/negotiateauth 
nsHttpNegotiateAuth::GenerateCredentials() [challenge=Negotiate]
        [Parent 2504: BgIOThreadPool #2]: D/negotiateauth entering 
nsAuthGSSAPI::GetNextToken()
        [Parent 2504: BgIOThreadPool #2]: D/negotiateauth 
gss_init_sec_context() failed: Unspecified GSS failure.  Minor code may provide 
more information
        SPNEGO cannot find mechanisms to negotiate
        [Parent 2504: BgIOThreadPool #2]: D/negotiateauth   leaving 
nsAuthGSSAPI::GetNextToken [rv=80004005]

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1849346

Title:
  [SRU] kerberos GSSAPI no longer works after deb->snap transition

To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/1849346/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to