Commit Graph

64 Commits

Author SHA1 Message Date
Marek Küthe
ab90b27509
Merge 71c2eaf727 into 38781e39fe 2024-02-25 00:31:58 +00:00
Marek Küthe
71c2eaf727
Hardening the systemd service
Closes https://github.com/zhoreeq/meshname/issues/21

`systemd-analyze security meshnamed` returns:
```
NAME                                                        DESCRIPTION                                                                                            EXPOSURE
✓ SystemCallFilter=~@swap                                     System call deny list defined for service, and @swap is included
✗ SystemCallFilter=~@resources                                System call deny list defined for service, and @resources is not included (e.g. ioprio_set is allowed)      0.2
✓ SystemCallFilter=~@reboot                                   System call deny list defined for service, and @reboot is included
✓ SystemCallFilter=~@raw-io                                   System call deny list defined for service, and @raw-io is included
✓ SystemCallFilter=~@privileged                               System call deny list defined for service, and @privileged is included
✓ SystemCallFilter=~@obsolete                                 System call deny list defined for service, and @obsolete is included
✓ SystemCallFilter=~@mount                                    System call deny list defined for service, and @mount is included
✓ SystemCallFilter=~@module                                   System call deny list defined for service, and @module is included
✓ SystemCallFilter=~@debug                                    System call deny list defined for service, and @debug is included
✓ SystemCallFilter=~@cpu-emulation                            System call deny list defined for service, and @cpu-emulation is included
✓ SystemCallFilter=~@clock                                    System call deny list defined for service, and @clock is included
✓ RemoveIPC=                                                  Service user cannot leave SysV IPC objects around
✗ RootDirectory=/RootImage=                                   Service runs within the host's root directory                                                               0.1
✓ User=/DynamicUser=                                          Service runs under a transient non-root user identity
✓ RestrictRealtime=                                           Service realtime scheduling access is restricted
✓ CapabilityBoundingSet=~CAP_SYS_TIME                         Service processes cannot change the system clock
✓ NoNewPrivileges=                                            Service processes cannot acquire new privileges
✓ AmbientCapabilities=                                        Service process does not receive ambient capabilities
✓ CapabilityBoundingSet=~CAP_BPF                              Service may load BPF programs
✓ SystemCallArchitectures=                                    Service may execute system calls only with native ABI
✗ RestrictAddressFamilies=~AF_(INET|INET6)                    Service may allocate Internet sockets                                                                       0.3
✓ ProtectSystem=                                              Service has strict read-only access to the OS file hierarchy
✓ ProtectProc=                                                Service has restricted access to process tree (/proc hidepid=)
✓ SupplementaryGroups=                                        Service has no supplementary groups
✓ CapabilityBoundingSet=~CAP_SYS_RAWIO                        Service has no raw I/O access
✓ CapabilityBoundingSet=~CAP_SYS_PTRACE                       Service has no ptrace() debugging abilities
✓ CapabilityBoundingSet=~CAP_SYS_(NICE|RESOURCE)              Service has no privileges to change resource use parameters
✓ CapabilityBoundingSet=~CAP_NET_ADMIN                        Service has no network configuration privileges
✓ CapabilityBoundingSet=~CAP_NET_(BIND_SERVICE|BROADCAST|RAW) Service has no elevated networking privileges
✓ CapabilityBoundingSet=~CAP_AUDIT_*                          Service has no audit subsystem access
✓ CapabilityBoundingSet=~CAP_SYS_ADMIN                        Service has no administrator privileges
✓ PrivateTmp=                                                 Service has no access to other software's temporary files
✓ ProcSubset=                                                 Service has no access to non-process /proc files (/proc subset=)
✓ CapabilityBoundingSet=~CAP_SYSLOG                           Service has no access to kernel logging
✓ ProtectHome=                                                Service has no access to home directories
✓ PrivateDevices=                                             Service has no access to hardware devices
✗ PrivateNetwork=                                             Service has access to the host's network                                                                    0.5
✗ DeviceAllow=                                                Service has a device ACL with some special devices: char-rtc:r                                              0.1
✓ KeyringMode=                                                Service doesn't share key material with other services
✓ Delegate=                                                   Service does not maintain its own delegated control group subtree
✓ PrivateUsers=                                               Service does not have access to other users
✗ IPAddressDeny=                                              Service does not define an IP address allow list                                                            0.2
✓ NotifyAccess=                                               Service child processes cannot alter service state
✓ ProtectClock=                                               Service cannot write to the hardware clock or system clock
✓ CapabilityBoundingSet=~CAP_SYS_PACCT                        Service cannot use acct()
✓ CapabilityBoundingSet=~CAP_KILL                             Service cannot send UNIX signals to arbitrary processes
✓ ProtectKernelLogs=                                          Service cannot read from or write to the kernel log ring buffer
✓ CapabilityBoundingSet=~CAP_WAKE_ALARM                       Service cannot program timers that wake up the system
✓ CapabilityBoundingSet=~CAP_(DAC_*|FOWNER|IPC_OWNER)         Service cannot override UNIX file/IPC permission checks
✓ ProtectControlGroups=                                       Service cannot modify the control group file system
✓ CapabilityBoundingSet=~CAP_LINUX_IMMUTABLE                  Service cannot mark files immutable
✓ CapabilityBoundingSet=~CAP_IPC_LOCK                         Service cannot lock memory into RAM
✓ ProtectKernelModules=                                       Service cannot load or read kernel modules
✓ CapabilityBoundingSet=~CAP_SYS_MODULE                       Service cannot load kernel modules
✓ CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG                   Service cannot issue vhangup()
✓ CapabilityBoundingSet=~CAP_SYS_BOOT                         Service cannot issue reboot()
✓ CapabilityBoundingSet=~CAP_SYS_CHROOT                       Service cannot issue chroot()
✓ PrivateMounts=                                              Service cannot install system mounts
✓ CapabilityBoundingSet=~CAP_BLOCK_SUSPEND                    Service cannot establish wake locks
✓ MemoryDenyWriteExecute=                                     Service cannot create writable executable memory mappings
✓ RestrictNamespaces=~user                                    Service cannot create user namespaces
✓ RestrictNamespaces=~pid                                     Service cannot create process namespaces
✓ RestrictNamespaces=~net                                     Service cannot create network namespaces
✓ RestrictNamespaces=~uts                                     Service cannot create hostname namespaces
✓ RestrictNamespaces=~mnt                                     Service cannot create file system namespaces
✓ CapabilityBoundingSet=~CAP_LEASE                            Service cannot create file leases
✓ CapabilityBoundingSet=~CAP_MKNOD                            Service cannot create device nodes
✓ RestrictNamespaces=~cgroup                                  Service cannot create cgroup namespaces
✓ RestrictNamespaces=~ipc                                     Service cannot create IPC namespaces
✓ ProtectHostname=                                            Service cannot change system host/domainname
✓ CapabilityBoundingSet=~CAP_(CHOWN|FSETID|SETFCAP)           Service cannot change file ownership/access mode/capabilities
✓ CapabilityBoundingSet=~CAP_SET(UID|GID|PCAP)                Service cannot change UID/GID identities/capabilities
✓ LockPersonality=                                            Service cannot change ABI personality
✓ ProtectKernelTunables=                                      Service cannot alter kernel tunables (/proc/sys, …)
✓ RestrictAddressFamilies=~AF_PACKET                          Service cannot allocate packet sockets
✓ RestrictAddressFamilies=~AF_NETLINK                         Service cannot allocate netlink sockets
✓ RestrictAddressFamilies=~AF_UNIX                            Service cannot allocate local sockets
✓ RestrictAddressFamilies=~…                                  Service cannot allocate exotic sockets
✓ CapabilityBoundingSet=~CAP_MAC_*                            Service cannot adjust SMACK MAC
✓ RestrictSUIDSGID=                                           SUID/SGID file creation by service is restricted
✗ UMask=                                                      Files created by service are world-readable by default                                                      0.1

→ Overall exposure level for meshnamed.service: 1.2 OK 🙂
```

Signed-off-by: Marek Küthe <m.k@mk16.de>
2024-02-25 00:31:41 +00:00
George
38781e39fe Add alternative implementations to README 2022-01-05 04:29:04 -05:00
George
92a819e45a Remove old tests 2021-10-31 18:49:38 +00:00
George
6610db601b Remove the useless remote IP check 2021-10-31 18:46:29 +00:00
George
166705fc60 Remove DNS records storage, use dnsmasq or PopuraDNS instead 2021-10-31 18:37:11 +00:00
George
d006a19738 Update README.md 2021-10-26 17:17:18 +00:00
George
117923cdcb Add .vapordns subdomain by default 2021-07-06 19:23:10 +03:00
George
aef2ae70d5 Copy all answer sections from the upstream server 2021-06-12 13:19:50 -04:00
George
ce2342cb8f add Gentoo ebuild and openrc init file (fix #16) 2021-06-12 12:56:54 -04:00
George
015fcaf0d2 Add -getname and -getip commands 2021-04-05 10:02:57 -04:00
George
c56ec05ae7
Add .meship protocol support (#7) (#8)
* Add .meship protocol support (#7)

* Add an option to disable .meship resolver

Co-authored-by: George <zhoreeq@users.noreply.github.com>
2021-04-05 00:58:46 -04:00
George
cc15ec8496
Add logo to README 2021-04-04 08:40:11 -04:00
acetone
5b6b33139b
Предложение логотипа для проекта и протокола (#12)
* Create readme.md

* Add files via upload

* Add files via upload

* Delete logo.ai

* Delete logo.png

* Delete logo.svg
2021-04-04 08:25:20 -04:00
George
b2082295c2 Set the Recursion Desired flag 2021-03-31 09:47:00 -04:00
George
cb422b143c Fix tests 2021-03-17 09:39:28 -04:00
George
655c353c95 Merge branch 'master' into docker 2020-12-08 09:28:10 -05:00
George
a3fe08f5cb Add allowremote flag. It allows remote meshname lookups for any IP address, not just localhost 2020-12-08 09:21:39 -05:00
George
8b557c92e1 Docker updates 2020-12-08 08:05:06 -05:00
George
c0fddf65bb Add dockerfile 2020-12-08 06:05:51 -05:00
George
3cc3d2d63a
Update protocol.md
Specify explicit base32 implementation
2020-09-29 13:04:31 -04:00
George
16daa1032a Handle binding failures 2020-09-25 19:55:01 -04:00
George
042cefcc84 Updates
MeshnameServer.Start now waits for dnsServer to start listening
TLD-subnet map is configured once at constructor
2020-09-25 14:21:23 -04:00
George
bba0f200b3 Rename functions and vars to make more sense 2020-09-24 15:59:58 -04:00
George
1a83ce31c3
Update README.md 2020-09-23 19:43:45 -04:00
George
1f68d1b213 Fix linter warnings and go fmt 2020-09-23 19:03:35 -04:00
George
ae6bd725d6 Add server_test.go 2020-09-23 19:03:35 -04:00
George
a0dfd597ad Update domain.go and tests 2020-09-23 19:03:35 -04:00
George
8e37f0e0e2 Create constructor for MeshnameServer 2020-09-23 19:03:35 -04:00
George
86e3eddddf Move src to pkg 2020-09-23 19:03:35 -04:00
George
8052e6c080 Factor out LoadConfig 2020-09-23 19:03:35 -04:00
George
f7dbafe774 Factor out some code 2020-09-23 19:03:35 -04:00
George
25e46e488f Refactor flag parsing 2020-09-23 19:03:35 -04:00
George
2a06aacc33 Remove unused variable 2020-09-23 19:03:35 -04:00
George
e1b70ae46b rm cmd/meshname 2020-09-23 19:03:35 -04:00
George
cad772d305 Add IsStarted method, update SetZoneConfig for concurrency 2020-05-19 16:04:12 -04:00
George
5c5e938742 Simplify config and refactoring 2020-05-17 10:05:06 -04:00
George
00bd9a5486 refactor 2020-05-16 10:44:39 -04:00
George
f7a59668ed Update protocol.md 2020-03-24 07:37:30 -04:00
George
737f7373bd Fix README 2020-03-12 11:51:11 -04:00
George
b23b5664d5 Custom TLD configuration 2020-03-12 11:44:29 -04:00
George
0fe85623e2 TLD=subnet configuration 2020-03-12 10:32:35 -04:00
George
f1cd8b9812 Update README 2020-03-09 03:59:01 -04:00
George
ae09c9e378 Update README 2020-03-09 00:03:54 -04:00
George
fac930b55e Use pointers 2020-03-08 23:40:08 -04:00
George
897724142c Tests 2020-03-08 14:39:07 -04:00
George
3c429d5d28 Run daemon without config 2020-03-08 06:01:02 -04:00
George
2050bd9f13 Handle .ygg and .cjd domains 2020-03-08 01:01:25 -05:00
George
a2be79ddcb Update config, signal handling and refactoring 2020-03-08 00:59:44 -05:00
George
041fdff2a8 Don't build meshname util by default 2020-02-09 04:27:16 -05:00