Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

335 lines
18 KiB

  1. ##############################################################################
  2. #
  3. # udevil configuration file /etc/udevil/udevil.conf
  4. #
  5. # This file controls what devices, networks, and files users may mount and
  6. # unmount via udevil (set suid).
  7. #
  8. # IMPORTANT: IT IS POSSIBLE TO CREATE SERIOUS SECURITY PROBLEMS IF THIS FILE
  9. # IS MISCONFIGURED - EDIT WITH CARE
  10. #
  11. # Note: For greater control for specific users, including root, copy this
  12. # file to /etc/udevil/udevil-user-USERNAME.conf replacing USERNAME with the
  13. # desired username (eg /etc/udevil/udevil-user-jim.conf).
  14. #
  15. # Format:
  16. # OPTION = VALUE[, VALUE, ...]
  17. #
  18. # DO NOT USE QUOTES except literally
  19. # Lines beginning with # are ignored
  20. #
  21. ##############################################################################
  22. # To log all uses of udevil, set log_file to a file path:
  23. # log_file = /var/log/udevil.log
  24. # Approximate number of days to retain log entries (0=forever, max=60):
  25. log_keep_days = 10
  26. # allowed_types determines what fstypes can be passed by a user to the u/mount
  27. # program, what device filesystems may be un/mounted implicitly, and what
  28. # network filesystems may be un/mounted.
  29. # It may also include the 'file' keyword, indicating that the user is allowed
  30. # to mount files (eg an ISO file). The $KNOWN_FILESYSTEMS variable may
  31. # be included to include common local filesystems as well as those listed in
  32. # /etc/filesystems and /proc/filesystems.
  33. # allowed_types_USERNAME, if present, is used to override allowed_types for
  34. # the specific user 'USERNAME'. For example, to allow user 'jim' to mount
  35. # only vfat filesystems, add:
  36. # allowed_types_jim = vfat
  37. # Setting allowed_types = * does NOT allow all types, as this is a security
  38. # risk, but does allow all recognized types.
  39. # allowed_types = $KNOWN_FILESYSTEMS, file, cifs, smbfs, nfs, curlftpfs, ftpfs, sshfs, davfs, tmpfs, ramfs
  40. allowed_types = $KNOWN_FILESYSTEMS, file, cifs
  41. # allowed_users is a list of users permitted to mount and unmount with udevil.
  42. # Wildcards (* or ?) may be used in the usernames. To allow all users,
  43. # specify "allowed_users=*". UIDs may be included using the form UID=1000.
  44. # For example: allowed_users = carl, UID=1000, pre*
  45. # Also note that permission to execute udevil may be limited to users belonging
  46. # to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage',
  47. # depending on installation.
  48. # allowed_users_FSTYPE, if present, is used to override allowed_users when
  49. # mounting or unmounting a specific fstype (eg nfs, ext3, file).
  50. # Note that when mounting a file, fstype will always be 'file' regardless of
  51. # the internal fstype of the file.
  52. # For example, to allow only user 'bob' to mount nfs shares, add:
  53. # allowed_users_nfs = bob
  54. # The root user is NOT automatically allowed to use udevil in some cases unless
  55. # listed here (except for unmounting anything or mounting fstab devices).
  56. allowed_users = *
  57. # allowed_groups is a list of groups permitted to mount and unmount with
  58. # udevil. The user MUST belong to at least one of these groups. Wildcards
  59. # or GIDs may NOT be used in group names, but a single * may be used to allow
  60. # all groups.
  61. # Also note that permission to execute udevil may be limited to users belonging
  62. # to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage',
  63. # depending on installation.
  64. # allowed_groups_FSTYPE, if present, is used to override allowed_groups when
  65. # mounting or unmounting a specific fstype (eg nfs, ext3, file). For example,
  66. # to allow only members of the 'network' group to mount smb and nfs shares,
  67. # use both of these lines:
  68. # allowed_groups_smbfs = network
  69. # allowed_groups_nfs = network
  70. # The root user is NOT automatically allowed to use udevil in some cases unless
  71. # listed here (except for unmounting anything or mounting fstab devices).
  72. allowed_groups = *
  73. # allowed_media_dirs specifies the media directories in which user mount points
  74. # may be located. The first directory which exists and does not contain a
  75. # wildcard will be used as the default media directory (normally /media or
  76. # /media/$USER).
  77. # The $USER variable, if included, will be replaced with the username of the
  78. # user running udevil. Wildcards may also be used in any directory EXCEPT the
  79. # default. Wildcards will not match a /, except a /** suffix for recursion.
  80. # allowed_media_dirs_FSTYPE, if present, is used to override allowed_media_dirs
  81. # when mounting or unmounting a specific fstype (eg ext2, nfs). For example,
  82. # to cause /media/network to be used as the default media directory for
  83. # nfs and ftpfs mounts, use these two lines:
  84. # allowed_media_dirs_nfs = /media/network, /media, /media/$USER
  85. # allowed_media_dirs_ftpfs = /media/network, /media, /media/$USER
  86. # NOTE: If you want only the user who mounted a device to have access to it
  87. # and be allowed to unmount it, specify /media/$USER as the first
  88. # allowed media directory (only /media/$USER is created on demand).
  89. # IMPORTANT: If an allowed file is mounted to a media directory, the user may
  90. # be permitted to unmount its associated loop device even though internal.
  91. # INCLUDING /MNT HERE IS NOT RECOMMENDED. ALL ALLOWED MEDIA DIRECTORIES
  92. # SHOULD BE OWNED AND WRITABLE ONLY BY ROOT.
  93. allowed_media_dirs = /media/$USER, /run/media/$USER
  94. # allowed_devices is the first criteria for what block devices users may mount
  95. # or unmount. If a device is not listed in allowed_devices, it cannot be
  96. # un/mounted (unless in fstab). However, even if a device is listed, other
  97. # factors may prevent its use. For example, access to system internal devices
  98. # will be denied to normal users even if they are included in allowed_devices.
  99. # allowed_devices_FSTYPE, if present, is used to override allowed_devices when
  100. # mounting or unmounting a specific fstype (eg ext3, ntfs). For example, to
  101. # prevent all block devices containing an ext4 filesystem from being
  102. # un/mounted use:
  103. # allowed_devices_ext4 =
  104. # Note: Wildcards may be used, but a wildcard will never match a /, except
  105. # for "allowed_devices=*" which allows any device. The recommended setting is
  106. # allowed_devices = /dev/*
  107. # WARNING: ALLOWING USERS TO MOUNT DEVICES OUTSIDE OF /dev CAN CAUSE SERIOUS
  108. # SECURITY PROBLEMS. DO NOT ALLOW DEVICES IN /dev/shm
  109. allowed_devices = /dev/*
  110. # allowed_internal_devices causes udevil to treat any listed block devices as
  111. # removable, thus allowing normal users to un/mount them (providing they are
  112. # also listed in allowed_devices).
  113. # allowed_internal_devices_FSTYPE, if present, is used to override
  114. # allowed_internal_devices when mounting or unmounting a specific fstype
  115. # (eg ext3, ntfs). For example, to allow block devices containing a vfat
  116. # filesystem to be un/mounted even if they are system internal devices, use:
  117. # allowed_internal_devices_vfat = /dev/sdb*
  118. # Some removable esata drives look like internal drives to udevil. To avoid
  119. # this problem, they can be treated as removable with this setting.
  120. # WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS.
  121. # allowed_internal_devices =
  122. # allowed_internal_uuids and allowed_internal_uuids_FSTYPE work similarly to
  123. # allowed_internal_devices, except that UUIDs are specified instead of devices.
  124. # For example, to allow un/mounting of an internal filesystem based on UUID:
  125. # allowed_internal_uuids = cc0c4489-8def-1e5b-a304-ab87c3cb626c0
  126. # WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS.
  127. # allowed_internal_uuids =
  128. # forbidden_devices is used to prevent block devices from being un/mounted
  129. # even if other settings would allow them (except devices in fstab).
  130. # forbidden_devices_FSTYPE, if present, is used to override
  131. # forbidden_devices when mounting or unmounting a specific fstype
  132. # (eg ext3, ntfs). For example, to prevent device /dev/sdd1 from being
  133. # mounted when it contains an ntfs filesystem, use:
  134. # forbidden_devices_ntfs = /dev/sdd1
  135. # NOTE: device node paths are canonicalized before being tested, so forbidding
  136. # a link to a device will have no effect.
  137. forbidden_devices =
  138. # allowed_networks determines what hosts may be un/mounted by udevil users when
  139. # using nfs, cifs, smbfs, curlftpfs, ftpfs, or sshfs. Hosts may be specified
  140. # using a hostname (eg myserver.com) or IP address (192.168.1.100).
  141. # Wildcards may be used in hostnames and IP addresses, but CIDR notation
  142. # (192.168.1.0/16) is NOT supported. IP v6 is supported. For example:
  143. # allowed_networks = 127.0.0.1, 192.168.1.*, 10.0.0.*, localmachine, *.okay.com
  144. # Or, to prevent un/mounting of any network shares, set:
  145. # allowed_networks =
  146. # allowed_networks_FSTYPE, if present, is used to override allowed_networks
  147. # when mounting or unmounting a specific network fstype (eg nfs, cifs, sshfs,
  148. # curlftpfs). For example, to limit nfs and samba shares to only local
  149. # networks, use these two lines:
  150. # allowed_networks_nfs = 192.168.1.*, 10.0.0.*
  151. # allowed_networks_cifs = 192.168.1.*, 10.0.0.*
  152. allowed_networks = *
  153. # forbidden_networks and forbidden_networks_FSTYPE are used to specify networks
  154. # that are never allowed, even if other settings allow them (except fstab).
  155. # NO REVERSE LOOKUP IS PERFORMED, so including bad.com will only have an effect
  156. # if the user uses that hostname. IP lookup is always performed, so forbidding
  157. # an IP address will also forbid all corresponding hostnames.
  158. forbidden_networks =
  159. # allowed_files is used to determine what files in what directories may be
  160. # un/mounted. A user must also have read permission on a file to mount it.
  161. # Note: Wildcards may be used, but a wildcard will never match a /, except
  162. # for "allowed_files=*" which allows any file, and a /** suffix, which matches
  163. # all files recursively.
  164. # For example, to allow only files in the /share directory to be mounted, use:
  165. # allowed_files = /share/*
  166. # To allow all files in the /share directory AND all subdirectories use:
  167. # allowed_files = /share/**
  168. # NOTE: Specifying allowed_files_FSTYPE will NOT work because the fstype of
  169. # files is always 'file'.
  170. allowed_files = *
  171. # forbidden_files is used to specify files that are never allowed, even if
  172. # other settings allow them (except fstab). Specify a full path.
  173. # Note: Wildcards may be used, but a wildcard will never match a /, except
  174. # for "forbidden_files = *", or a /** suffix, which matches all recursively.
  175. # NOTE: file paths are canonicalized before being tested, so forbidding
  176. # a link to a file will have no effect.
  177. forbidden_files =
  178. # default_options specifies what options are always included when performing
  179. # a mount, in addition to any options the user may specify.
  180. # Note: When a device is present in /etc/fstab, and the user does not specify
  181. # a mount point, the device is mounted with normal user permissions using
  182. # the fstab entry, without these options.
  183. # default_options_FSTYPE, if present, is used to override default_options
  184. # when mounting a specific fstype (eg ext2, nfs).
  185. # The variables $USER, $UID, and $GID are changed to the user's username, UID,
  186. # and GID.
  187. # FOR GOOD SECURITY, default_options SHOULD ALWAYS INCLUDE: nosuid,noexec,nodev
  188. # WARNING: OPTIONS PRESENT OR MISSING CAN CAUSE SERIOUS SECURITY PROBLEMS.
  189. default_options = nosuid, noexec, nodev, noatime
  190. default_options_file = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro
  191. # mount iso9660 with 'ro' to prevent mount read-only warning
  192. default_options_iso9660 = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro, utf8
  193. default_options_udf = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
  194. default_options_vfat = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID, utf8
  195. default_options_exfat = nosuid, noexec, nodev, noatime, umask=0077, uid=$UID, gid=$GID, iocharset=utf8, namecase=0, nonempty
  196. default_options_msdos = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID
  197. default_options_umsdos = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID
  198. default_options_ntfs = nosuid, noexec, nodev, noatime, fmask=0133, uid=$UID, gid=$GID, utf8
  199. default_options_cifs = nosuid, noexec, nodev, uid=$UID, gid=$GID
  200. default_options_smbfs = nosuid, noexec, nodev, uid=$UID, gid=$GID
  201. default_options_sshfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other
  202. default_options_curlftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other
  203. default_options_ftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
  204. default_options_davfs = nosuid, noexec, nodev, uid=$UID, gid=$GID
  205. default_options_tmpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
  206. default_options_ramfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
  207. # allowed_options determines all options that a user may specify when mounting.
  208. # All the options used in default_options above must be included here too, or
  209. # they will be rejected. If the user attempts to use an option not included
  210. # here, an error will result. Wildcards may be used.
  211. # allowed_options_FSTYPE, if present, is used to override allowed_options
  212. # when mounting a specific fstype (eg ext2, nfs).
  213. # The variables $USER, $UID, and $GID are changed to the user's username, UID,
  214. # and GID.
  215. # If you want to forbid remounts, remove 'remount' from here.
  216. # WARNING: OPTIONS HERE CAN CAUSE SERIOUS SECURITY PROBLEMS - CHOOSE CAREFULLY
  217. allowed_options = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID, ro, rw, sync, flush, iocharset=*, utf8, remount
  218. allowed_options_nfs = nosuid, noexec, nodev, noatime, ro, rw, sync, remount, port=*, rsize=*, wsize=*, hard, proto=*, timeo=*, retrans=*
  219. allowed_options_cifs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=*
  220. allowed_options_smbfs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=*
  221. allowed_options_sshfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, idmap=user, BatchMode=yes, port=*
  222. allowed_options_curlftpfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, user=*
  223. allowed_options_ftpfs = nosuid, noexec, nodev, noatime, ro, rw, port=*, user=*, pass=*, root=*, uid=$UID, gid=$GID
  224. allowed_options_exfat = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID, umask=0077, namecase=*, ro, rw, sync, flush, iocharset=*, remount, nonempty
  225. # mount_point_mode, if present and set to a non-empty value, will cause udevil
  226. # to set the mode (permissions) on the moint point after mounting If not
  227. # specified or if left empty, the mode is not changed. Mode must be octal
  228. # starting with a zero (0755).
  229. # mount_point_mode_FSTYPE, if present, is used to override mount_point_mode
  230. # when mounting a specific fstype (eg ext2, nfs).
  231. # NOT SETTING A MODE CAN HAVE SECURITY IMPLICATIONS FOR SOME FSTYPES
  232. mount_point_mode = 0755
  233. # don't set a mode for some types:
  234. mount_point_mode_sshfs =
  235. mount_point_mode_curlftpfs =
  236. mount_point_mode_ftpfs =
  237. # Use the settings below to change the default locations of programs used by
  238. # udevil, or (advanced topic) to redirect commands to your scripts.
  239. # When substituting scripts, make sure they are root-owned and accept the
  240. # options used by udevil (for example, the mount_program must accept --fake,
  241. # -o, -v, and other options valid to mount.)
  242. # Be sure to specify the full path and include NO OPTIONS or other arguments.
  243. # These programs may also be specified as configure options when building
  244. # udevil.
  245. # THESE PROGRAMS ARE RUN AS ROOT
  246. # mount_program = /bin/mount
  247. # umount_program = /bin/umount
  248. # losetup_program = /sbin/losetup
  249. # setfacl_program = /usr/bin/setfacl
  250. # validate_exec specifies a program or script which provides additional
  251. # validation of a mount or unmount command, beyond the checks performed by
  252. # udevil. The program is run as a normal user (if root runs udevil,
  253. # validate_exec will NOT be run). The program is NOT run if the user is
  254. # mounting a device without root privileges (a device in fstab).
  255. # The program is passed the username, a printable description of what is
  256. # happening, and the entire udevil command line as the first three arguments.
  257. # The program must return an exit status of 0 to allow the mount or unmount
  258. # to proceed. If it returns non-zero, the user will be denied permission.
  259. # For example, validate_exec might specify a script which notifies you
  260. # of the command being run, or performs additional steps to authenticate the
  261. # user.
  262. # Specify a full path to the program, with NO options or arguments.
  263. # validate_exec =
  264. # validate_rootexec works similarly to validate_exec, except that the program
  265. # is run as root. validate_rootexec will also be run if the root user runs
  266. # udevil. If both validate_exec and validate_rootexec are specified,
  267. # validate_rootexec will run first, followed by validate_exec.
  268. # The program must return an exit status of 0 to allow the mount or unmount
  269. # to proceed. If it returns non-zero, the user will be denied permission.
  270. # Unless you are familiar with writing root scripts, it is recommended that
  271. # rootexec settings NOT be used, as it is easy to inadvertently open exploits.
  272. # THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not.
  273. # validate_rootexec =
  274. # success_exec is run after a successful mount, remount, or unmount. The
  275. # program is run as a normal user (if root runs udevil, success_exec
  276. # will NOT be run).
  277. # The program is passed the username, a printable description of what action
  278. # was taken, and the entire udevil command line as the first three arguments.
  279. # The program's exit status is ignored.
  280. # For example, success_exec might run a script which informs you of what action
  281. # was taken, and might perform further actions.
  282. # Specify a full path to the program, with NO options or arguments.
  283. # success_exec =
  284. # success_rootexec works similarly to success_exec, except that the program is
  285. # run as root. success_rootexec will also be run if the root user runs udevil.
  286. # If both success_exec and success_rootexec are specified, success_rootexec
  287. # will run first, followed by success_exec.
  288. # Unless you are familiar with writing root scripts, it is recommended that
  289. # rootexec settings NOT be used, as it is easy to inadvertently open exploits.
  290. # THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not.
  291. # success_rootexec =