Do I need a keyring password on a luks encrypted single user machine?

x3ro

The title says it all but let me expand a bit more:

I'm wondering how the keyring password is protecting my keys. Sure, it encrypts the container file, so no one else can access it. But it is also decrypted after I have provided my keyring password. So in fact, while I'm logged in, the keys could be stolen by some malicious app (at least an app with root permissions should be able to).

Of course, I know, the key file itself is not replaced with a decrypted version after entering the password but it must be decrypted in memory.

The question is: Can malicious apps access data in my keyring while it is decrypted? If so, do I even need a password for my keyring when my disk is already luks encrypted and I'm the only one using my computer?

And, if a password would be more secure, is it possible to have it unlocked automatically, using my account password (or so) after I login?

(I'm not using a login manager, I'm automatically starting i3wm after logging in via TTY, so would be automatic unlocking possible for this setup too?)

user1686

Can malicious apps access data in my keyring while it is decrypted?

In practice (currently), yes, they can. The current design (or lack thereof) of user sessions in Linux makes it difficult for gnome-keyring-daemon to determine what program is trying to access it; that's doable to some extent for compiled programs, but e.g. any app written in Python is indistinguishable from any other app written in Python. So although gnome-keyring did at first have an application whitelist, current versions no longer do.

Eventually this should be improved by app container projects such as Snap or Flatpak.

If so, do I even need a password for my keyring when my disk is already luks encrypted and I'm the only one using my computer?

I'd say yes.

As mentioned above, any program can just send a D-Bus message and ask gnome-keyring-daemon for any secret. (In some cases it even works as a feature.)

However, there have been quite a few security holes in which a vulnerable program (e.g. a web browser) could be used to steal your files, although still having no possibility of running commands or sending D-Bus messages. Malware has been known to steal people's unencrypted SSH keys (~/.ssh/id_rsa) or Bitcoin Core wallets.

In the same way, if it is not encrypted, you're leaving ~/.local/share/keyrings/login.keyring at risk of being stolen through web browser exploits and such.

(I'm not using a login manager, I'm automatically starting i3wm after logging in via TTY, so would be automatic unlocking possible for this setup too?)

Automatic unlocking of gnome-keyring is in all cases done through PAM. A module named pam_gnome_keyring.so receives your password as part of the login process, and starts the initial keyring daemon.

The PAM module should be added to /etc/pam.d, wherever your Linux distribution normally adds common modules, or just to the login file (which is specifically for console and telnet logins).

In the auth group (in the "Additional" block in Debian-style common-auth; as the last module otherwise) it will store the password in memory:

[...]
auth optional pam_gnome_keyring.so only_if=login

In the session group (again, "Additional" block for Debian, last module otherwise) it uses the stored password to start gnome-keyring-daemon:

[...]
session optional pam_gnome_keyring.so only_if=login auto_start

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why do I have to enter my keyring password for a WiFi password?

From Dev

How do I change a LUKS password?

From Dev

How do I move/home folder to a luks encrypted external drive?

From Dev

Do I need lvm password and passeord for my user-account

From Dev

Why do I need a strong password for my Ubuntu user account?

From Dev

Do I need lvm password and passeord for my user-account

From Dev

How do I demand a password on single user mode?

From Dev

The password for encrypted file system is not updated when I change the user password

From Dev

Delayed LUKS encrypted drive mount with password prompt not visibly asking password

From Dev

Do I maintain encryption when extending a luks encrypted lvm with a physical volume?

From Dev

How do I mount an encrypted /home directory on another Ubuntu machine?

From Dev

Enabling FIPS on a luks encrypted CentOS system breaks boot password

From Dev

Removing a Password From a LUKS+EXT4 encrypted HDD

From Dev

Provide password to udisks to unlock LUKS-encrypted device

From Dev

Do I need to specify the content type for encrypted string?

From Dev

Do I need unencrypted files underneath encrypted overmount?

From Dev

How can I install Ubuntu encrypted with LUKS with dual-boot?

From Dev

Can I encrypt the LUKS encrypted disk a second time with TrueCrypt

From Dev

why Linux server do not ask password in single user mode

From Dev

Changed the user password, but now I can't access my encrypted folder

From Dev

Changed the user password, but now I can't access my encrypted folder

From Dev

Can I put a single quote in a user's password

From Dev

Why Do I need user id attribute?

From Dev

Do I need to sanitize the user input Laravel

From Dev

Why Do I need user id attribute?

From Dev

Do I need to clear timeouts if user leaves?

From Dev

How do I integrate gpg with the GNOME keyring?

From Dev

How do I install Windows on an encrypted drive when I've forgotten the password?

From Dev

dm-crypt+luks: Can I have a separate header without storing it on the luks encrypted device?

Related Related

  1. 1

    Why do I have to enter my keyring password for a WiFi password?

  2. 2

    How do I change a LUKS password?

  3. 3

    How do I move/home folder to a luks encrypted external drive?

  4. 4

    Do I need lvm password and passeord for my user-account

  5. 5

    Why do I need a strong password for my Ubuntu user account?

  6. 6

    Do I need lvm password and passeord for my user-account

  7. 7

    How do I demand a password on single user mode?

  8. 8

    The password for encrypted file system is not updated when I change the user password

  9. 9

    Delayed LUKS encrypted drive mount with password prompt not visibly asking password

  10. 10

    Do I maintain encryption when extending a luks encrypted lvm with a physical volume?

  11. 11

    How do I mount an encrypted /home directory on another Ubuntu machine?

  12. 12

    Enabling FIPS on a luks encrypted CentOS system breaks boot password

  13. 13

    Removing a Password From a LUKS+EXT4 encrypted HDD

  14. 14

    Provide password to udisks to unlock LUKS-encrypted device

  15. 15

    Do I need to specify the content type for encrypted string?

  16. 16

    Do I need unencrypted files underneath encrypted overmount?

  17. 17

    How can I install Ubuntu encrypted with LUKS with dual-boot?

  18. 18

    Can I encrypt the LUKS encrypted disk a second time with TrueCrypt

  19. 19

    why Linux server do not ask password in single user mode

  20. 20

    Changed the user password, but now I can't access my encrypted folder

  21. 21

    Changed the user password, but now I can't access my encrypted folder

  22. 22

    Can I put a single quote in a user's password

  23. 23

    Why Do I need user id attribute?

  24. 24

    Do I need to sanitize the user input Laravel

  25. 25

    Why Do I need user id attribute?

  26. 26

    Do I need to clear timeouts if user leaves?

  27. 27

    How do I integrate gpg with the GNOME keyring?

  28. 28

    How do I install Windows on an encrypted drive when I've forgotten the password?

  29. 29

    dm-crypt+luks: Can I have a separate header without storing it on the luks encrypted device?

HotTag

Archive