···288 kresd = 270;
289 rpc = 271;
290 geoip = 272;
291- #wireshark = 273; # unused
292293 # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
294···546 kresd = 270;
547 #rpc = 271; # unused
548 #geoip = 272; # unused
549- wireshark = 273;
550551 # When adding a gid, make sure it doesn't match an existing
552 # uid. Users and groups with the same name should have equal
···288 kresd = 270;
289 rpc = 271;
290 geoip = 272;
0291292 # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
293···545 kresd = 270;
546 #rpc = 271; # unused
547 #geoip = 272; # unused
0548549 # When adding a gid, make sure it doesn't match an existing
550 # uid. Users and groups with the same name should have equal
+5-20
nixos/modules/programs/wireshark.nix
···3with lib;
45let
6-7 cfg = config.programs.wireshark;
8 wireshark = cfg.package;
9-10-in
11-12-{
13-14 options = {
15-16 programs.wireshark = {
17-18 enable = mkOption {
19 type = types.bool;
20 default = false;
21 description = ''
22 Whether to add Wireshark to the global environment and configure a
23- setuid wrapper for 'dumpcap' for users in the 'wireshark' group.
24 '';
25 };
26-27 package = mkOption {
28 type = types.package;
29 default = pkgs.wireshark-cli;
···32 Which Wireshark package to install in the global environment.
33 '';
34 };
35-36 };
37-38 };
3940 config = mkIf cfg.enable {
41-42 environment.systemPackages = [ wireshark ];
43-044 security.wrappers.dumpcap = {
45 source = "${wireshark}/bin/dumpcap";
046 owner = "root";
47 group = "wireshark";
48- setuid = true;
49- setgid = false;
50 permissions = "u+rx,g+x";
51 };
52-53- users.extraGroups.wireshark.gid = config.ids.gids.wireshark;
54-55 };
56-57}
···3with lib;
45let
06 cfg = config.programs.wireshark;
7 wireshark = cfg.package;
8+in {
00009 options = {
010 programs.wireshark = {
011 enable = mkOption {
12 type = types.bool;
13 default = false;
14 description = ''
15 Whether to add Wireshark to the global environment and configure a
16+ setcap wrapper for 'dumpcap' for users in the 'wireshark' group.
17 '';
18 };
019 package = mkOption {
20 type = types.package;
21 default = pkgs.wireshark-cli;
···24 Which Wireshark package to install in the global environment.
25 '';
26 };
027 };
028 };
2930 config = mkIf cfg.enable {
031 environment.systemPackages = [ wireshark ];
32+ users.extraGroups.wireshark = {};
33+34 security.wrappers.dumpcap = {
35 source = "${wireshark}/bin/dumpcap";
36+ capabilities = "cap_net_raw+p";
37 owner = "root";
38 group = "wireshark";
0039 permissions = "u+rx,g+x";
40 };
00041 };
042}