Firefox asks for the pin on my security key only when I start it from the command line. (honestly, kind of fascinating behavior)
My bank recently gave me a usb-security key for authentication. The key is secured with a pin and fingerprint reader. The flow should be: Auth attempt → firefox asks for pin → firefox asks me to touch the security key → all happy.
Here is the fascinating part: This works if I start firefox from the command line via firefox or /snap/bin/firefox. But if I start it by clicking the desktop icon, firefox gets stuck or forgets to ask for pin. I double checked and the .desktop file for firefox also uses Exec=/snap/bin/firefox %u
I am a bit stumped. Does anybody know how I could even debug something like this ?
Are you using Firefox to access the Bank web site at this time? You do not say. What instructions did the Bank supply on how to set up the USB key to the Bank web site. Does this USB key have a finger print reader?
Please confirm that the instructions from the Bank have been followed in all aspects. Eliminate the possibility of incorrect set up and use before identifying the method of launching Firefox as the source of the problem.
tldr: Hypothesis is that snap by default blocks unknown security keys. The one I need for ABN Amro should be included in version 2.78 , (release notes).
My debugging Story
Disclaimer: Debugging was heavily AI/LLM assisted.
The first thing I tried was to re-create the issue from a command line. I looked for the Exec = … line in the .desktop file for firefox. Running that exact same command from the command line did not yield the behavior I get by clicking on the icon. Then I ran it via the kioclient (kioclient exec <path/to/firefox.desktop>). This did recreate the issue of firefox not asking for the pin . But it did not really get me any extra information.
Some side tangents: I – well the llm – looked at the difference in environment variables that the processes are running in. (Process environment variables can be found under /proc/<PID>/environ). Did not get me anywhere. The llm then suggested looking at the output of systemd-cgls --user | grep -B2 -A2 firefox , which flew right over my head. Also did not get me anywhere.
The important insight came when looking at journalctl output while running firefox from command line vs clicking on the icon. journalctl -f | grep -iE ‘apparmor|DENIED|hidraw’ showed that apparmor denied a bunch of actions by firefox when using the security key. What is interesting is that the security key I am using does not show up in the u2f-devices.go file of the version of snap that I am using. I think, that apparmor simply blocks access to any security key that is not listed there. But the key will be added in version 2.81. So if I am correct, the issue will be solved, once I get the update.
Two question still on my mind:
Why does apparmor only block it when firefox is started from an icon?
Is apparmor actually blocking all security keys that are not listed in its u2f-devices.go ?