Skip to content

Commit b6033b7

Browse files
committed
tmpfiles: automatically create /etc/credstore/ and friends
This adds a tmpfiles.d/ snippet for LoadCredential= style credentials directories in /etc/ and /run/. This is done primarily to ensure that the access modes for the dirs are set up properly, in the most restrictive ways. Specifically these are set to 0000, so that CAP_DAC_OVERRIDE is necessary to enumerate and read the credentials, and being UID=0 is not sufficient to do so. This creates /etc/credstore/, but leaves /run/credstore/ absent if missing, for now. Thinking is: the latter being non-persistent is created by software usually, not manually by users, and hence more likely right. But dunno, we might want to revisit this sooner or later. This is ultimately an exercise to advertise the LoadCredential= concept a bit, and do so in a reasonably secure way, underlining the safety of the concept.
1 parent 745de35 commit b6033b7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tmpfiles.d/credstore.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file is part of systemd.
2+
#
3+
# systemd is free software; you can redistribute it and/or modify it
4+
# under the terms of the GNU Lesser General Public License as published by
5+
# the Free Software Foundation; either version 2.1 of the License, or
6+
# (at your option) any later version.
7+
8+
# See tmpfiles.d(5) for details
9+
10+
d /etc/credstore 0000 root root
11+
d /etc/credstore.encrypted 0000 root root
12+
z /run/credstore 0000 root root
13+
z /run/credstore.encrypted 0000 root root

tmpfiles.d/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ files = [['README', ''],
1515
['tmp.conf', ''],
1616
['x11.conf', ''],
1717
['provision.conf', ''],
18+
['credstore.conf', ''],
1819
]
1920

2021
foreach pair : files

0 commit comments

Comments
 (0)