]> git.ekhem.eu.org Git - server.git/log
server.git
17 months ago[postfix] Authenticate with dovecot SASL.
Jakub Czajka [Sun, 6 Nov 2022 15:22:19 +0000 (16:22 +0100)]
[postfix] Authenticate with dovecot SASL.

`postfix` authenticates MAIL FROM and RCPT TO addresses. This commit
routes this authentication through `dovecot` SASL. It queries the
address book for credentials.

17 months ago[postfix] Deliver to addresses found in the address book.
Jakub Czajka [Mon, 1 May 2023 09:42:56 +0000 (11:42 +0200)]
[postfix] Deliver to addresses found in the address book.

`postfix` relays to local mailbox only if the RCPT TO domain can be
found in `$mydestination` and RCPT TO address can be found in
`$alias_maps`. This commit sets these variables to query the address
book.

17 months ago[postfix] Relay incoming email to `dovecot` through LMTP.
Jakub Czajka [Sun, 6 Nov 2022 15:16:41 +0000 (16:16 +0100)]
[postfix] Relay incoming email to `dovecot` through LMTP.

Local Mail Transfer Protocol (LMTP) is a protocol for transfering
local email.

17 months ago[dovecot] Document SPF and DMARC DNS records.
Jakub Czajka [Sun, 6 Nov 2022 15:00:28 +0000 (16:00 +0100)]
[dovecot] Document SPF and DMARC DNS records.

SPF DNS records specify which IP addresses may send email on behalf of
the domain. DMARC DNS records specify what happens when mail cannot be
delivered.

17 months ago[postfix] Filter messages with OpenDKIM.
Jakub Czajka [Sun, 6 Nov 2022 15:06:12 +0000 (16:06 +0100)]
[postfix] Filter messages with OpenDKIM.

17 months ago[opendkim] Listen on localhost:8891.
Jakub Czajka [Sun, 6 Nov 2022 15:04:50 +0000 (16:04 +0100)]
[opendkim] Listen on localhost:8891.

17 months ago[opendkim] Require header fields.
Jakub Czajka [Sun, 6 Nov 2022 15:02:20 +0000 (16:02 +0100)]
[opendkim] Require header fields.

17 months ago[postfix] Fill missing header fields.
Jakub Czajka [Sun, 6 Nov 2022 14:48:03 +0000 (15:48 +0100)]
[postfix] Fill missing header fields.

Gmail requires a `MessageId` header field. However, not all clients
set this field and gmail reject emails. This commit instructs
`postfix` to add missing headers fields (eg. `MessageId`).

17 months ago[opendkim] Lookup KeyTable and SigningTable with SQL.
Jakub Czajka [Sun, 6 Nov 2022 14:37:16 +0000 (15:37 +0100)]
[opendkim] Lookup KeyTable and SigningTable with SQL.

See `man opendkim.conf` for more information on KeyTable and
SigningTable. `opendkim` connects to postgres via ::1/128.

17 months ago[opendkim] Generate default configuration.
Jakub Czajka [Thu, 3 Nov 2022 22:43:33 +0000 (23:43 +0100)]
[opendkim] Generate default configuration.

17 months ago[dovecot] Structure the mailbox.
Jakub Czajka [Sat, 29 Oct 2022 22:28:21 +0000 (00:28 +0200)]
[dovecot] Structure the mailbox.

17 months ago[dovecot] Enable virtual mailboxes.
Jakub Czajka [Sat, 29 Oct 2022 22:22:28 +0000 (00:22 +0200)]
[dovecot] Enable virtual mailboxes.

Virtual mailboxes are mailboxes created for new users automatically
based on their credentials. Userdb lookups aren't necessary.
Directories for virtual mailboxes are owned by a single system
user (`vmail`). This commit enables virtual mailboxes in `dovecot`:
- Static userdb instead of SQL query.
- Username column as the primary key of the address book. It has to be
unique to prevent virtual mailboxes overlapping.

17 months ago[dovecot] Ignore domain during authentication.
Jakub Czajka [Sat, 29 Oct 2022 09:04:41 +0000 (11:04 +0200)]
[dovecot] Ignore domain during authentication.

MacOS Mail App only sends username during login. It fails to
authenticate if `dovecot` checks the domain.

17 months ago[dovecot] Authenticate users found in the address book.
Jakub Czajka [Sat, 29 Oct 2022 08:34:54 +0000 (10:34 +0200)]
[dovecot] Authenticate users found in the address book.

Table `users` is an address book. User `dovecot` queries it to
authenticate clients and redirect email to mailboxes.

17 months ago[databases] Define email address book.
Jakub Czajka [Sat, 29 Oct 2022 08:26:48 +0000 (10:26 +0200)]
[databases] Define email address book.

`dovecot` and `postfix` can lookup user addresses in a SQL
table. Adding a new address means adding a new record.

17 months ago[dovecot] Secure connections with TLS.
Jakub Czajka [Sat, 15 Oct 2022 12:43:18 +0000 (14:43 +0200)]
[dovecot] Secure connections with TLS.

TLS connections need to be secured with SSL certificates. `dovecot`
generates self-signed SSL certificates. This commit switches `dovecot`
and `postfix` to SSL certificates signed by Let's Encrypt CA.

19 months ago[dovecot] Restrict number of connections from the same IP.
Jakub Czajka [Fri, 14 Oct 2022 22:33:22 +0000 (00:33 +0200)]
[dovecot] Restrict number of connections from the same IP.

19 months ago[postgres] Generate default configuration.
Jakub Czajka [Mon, 10 Oct 2022 19:15:06 +0000 (21:15 +0200)]
[postgres] Generate default configuration.

19 months ago[dovecot] Generate default configuration.
Jakub Czajka [Sun, 9 Oct 2022 13:02:48 +0000 (15:02 +0200)]
[dovecot] Generate default configuration.

19 months ago[postfix] Rewrite sender for outgoing email.
Jakub Czajka [Fri, 7 Oct 2022 17:31:10 +0000 (19:31 +0200)]
[postfix] Rewrite sender for outgoing email.

`myorigin` specifies the address of outgoing email (user@domain). It
defaults to `$myhostname = gethostname()`. This allows rewriting the
sender of outgoing email without changing configuration.

19 months ago[postfix] Generate default configuration.
Jakub Czajka [Fri, 7 Oct 2022 17:08:01 +0000 (19:08 +0200)]
[postfix] Generate default configuration.

19 months ago[fail2ban] Extend bans to 1 day.
Jakub Czajka [Sun, 25 Sep 2022 21:09:56 +0000 (23:09 +0200)]
[fail2ban] Extend bans to 1 day.

19 months ago[fail2ban] Log to `syslog`.
Jakub Czajka [Sun, 25 Sep 2022 21:04:07 +0000 (23:04 +0200)]
[fail2ban] Log to `syslog`.

19 months ago[fail2ban] Enable `sshd` jail.
Jakub Czajka [Sun, 25 Sep 2022 20:41:09 +0000 (22:41 +0200)]
[fail2ban] Enable `sshd` jail.

19 months ago[fail2ban] Generate default configuration.
Jakub Czajka [Sun, 25 Sep 2022 20:21:08 +0000 (22:21 +0200)]
[fail2ban] Generate default configuration.

19 months ago[sshd] Document public-key and certificate-based authentication.
Jakub Czajka [Sun, 29 Jan 2023 13:14:39 +0000 (14:14 +0100)]
[sshd] Document public-key and certificate-based authentication.

19 months ago[sshd] Disable reverse DNS checks.
Jakub Czajka [Sun, 25 Sep 2022 19:35:16 +0000 (21:35 +0200)]
[sshd] Disable reverse DNS checks.

By default `sshd` compares the IP address of the client with the
result of a reverse DNS query for that address. However, many clients
do not have reverse DNS records. This commit disables the check.

19 months ago[sshd] Omit additional configuration files.
Jakub Czajka [Sun, 25 Sep 2022 19:15:15 +0000 (21:15 +0200)]
[sshd] Omit additional configuration files.

19 months ago[sshd] Limit the number of alive messages.
Jakub Czajka [Sun, 25 Sep 2022 17:44:41 +0000 (19:44 +0200)]
[sshd] Limit the number of alive messages.

`sshd` keeps idle connection alive for `ClientAliveInterval` seconds
and then sends `ClientAliveCountMax` alive messages. If client does
not respond, `sshd` terminates the connection. This commit limits the
number of alive messages to 1.

Note: `ClientAliveCountMax` applies only to SSH protocol 2.

19 months ago[sshd] Require SSH protocol 2.
Jakub Czajka [Sun, 25 Sep 2022 17:38:27 +0000 (19:38 +0200)]
[sshd] Require SSH protocol 2.

SSH protocol 1 is an older version with known vulnerabilities. This
commit requires `sshd` to use only the newer SSH protocol 2.

19 months ago[sshd] Disable root login.
Jakub Czajka [Sun, 25 Sep 2022 17:19:15 +0000 (19:19 +0200)]
[sshd] Disable root login.

`PermitRootLogin` is set by default to `yes`.

19 months ago[sshd] Listen on a non-standard port.
Jakub Czajka [Sun, 25 Sep 2022 15:27:55 +0000 (17:27 +0200)]
[sshd] Listen on a non-standard port.

By default `sshd` listens on port 22. Most attack scripts are written
for this configuration. This commit changes the port to 72, which is
not used by any other popular service.

19 months ago[sshd] Disable password authentication.
Jakub Czajka [Sun, 25 Sep 2022 15:11:45 +0000 (17:11 +0200)]
[sshd] Disable password authentication.

Client can authenticate with `sshd` through one of following
authentication methods (corresponding sshd_config option in brackets):
- host-based (`HostbasedAuthentication`),
- public key (`PubkeyAuthentication`),
- challenge-response (`ChallengeResponseAuthentication`),
- password (`PasswordAuthentication`).

By default, only `PubkeyAuthentication` and `PasswordAuthentication`
are enabled. This commit disables `PasswordAuthentication`. Users
can now login only using public key authentication.

19 months ago[sshd] Generate default configuration.
Jakub Czajka [Sun, 25 Sep 2022 14:03:34 +0000 (16:03 +0200)]
[sshd] Generate default configuration.

2 years agoDescribe the repository in a README.
Jakub Czajka [Sun, 25 Sep 2022 13:49:57 +0000 (15:49 +0200)]
Describe the repository in a README.