-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for socket activation #40
base: master
Are you sure you want to change the base?
Changes from all commits
bf6d53f
a292da8
5a20793
25f230d
4113bd9
168748a
29e7db0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[Unit] | ||
Description=Endlessh SSH Tarpit | ||
Documentation=man:endlessh(1) | ||
Requires=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
Restart=always | ||
RestartSec=30sec | ||
ExecStart=/usr/local/bin/endlessh -i | ||
KillSignal=SIGTERM | ||
DynamicUser=true | ||
|
||
# Stop trying to restart the service if it restarts too many times in a row | ||
StartLimitInterval=5min | ||
StartLimitBurst=4 | ||
|
||
StandardOutput=journal | ||
StandardError=journal | ||
StandardInput=socket | ||
|
||
PrivateTmp=true | ||
PrivateDevices=true | ||
PrivateNetwork=true | ||
ProtectSystem=full | ||
ProtectHome=true | ||
InaccessiblePaths=/run /var | ||
PrivateUsers=true | ||
NoNewPrivileges=true | ||
ConfigurationDirectory=endlessh | ||
ProtectKernelLogs=true | ||
ProtectKernelTunables=true | ||
ProtectKernelModules=true | ||
ProtectControlGroups=true | ||
RestrictNamespaces=true | ||
RestrictRealtime=true | ||
|
||
LockPersonality=true | ||
MemoryDenyWriteExecute=true | ||
SystemCallArchitectures=native | ||
SystemCallFilter=@basic-io @file-system @io-event @network-io @signal | ||
SystemCallFilter=arch_prctl brk mprotect ~socket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fwiw my version of systemd (v245.4) complains about ~socket: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call, thanks for catching this; looks like I cannot combine whitelist and blacklist in this way >_>' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can, but the
(Many services shipped by systemd start with an allowlist and then add |
||
|
||
[Install] | ||
WantedBy=multi-user.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Endlessh SSH Tarpit socket | ||
Documentation=man:endlessh(1) | ||
|
||
[Socket] | ||
ListenStream=%i | ||
|
||
[Install] | ||
WantedBy=sockets.target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw the only thing you need to have
systemctl start endlessh@2222
work isRequires=endlessh@%i.socket
here -- systemd will automatically pull the socket in then.