238 Commits

Author SHA1 Message Date
Andreas Steffen
49769fff53 pkcs11: Support RSA-PSS signatures 2024-02-21 11:22:33 +01:00
Tobias Brunner
f3af1704d9 x509: Make length of nonces in OCSP requests configurable
Some servers might not support a length of 32 and return a malformed
request error. Lowering the value to the previous default of 16 could
help in that case.
2023-11-24 17:41:18 +01:00
Andreas Steffen
199c7083e1 openxpki: OCSP responder plugin accessing OpenXPKI
The openxpki plugin directly access the certificates table in
the OpenXPKI's MariaDB in order to retrieve the status of an
issued X.509 certificate based on its serial number.
2023-11-13 12:40:55 +01:00
Tobias Brunner
04c17ab56a credential-manager: Add option to reject trusted end-entity certificates
This allows preventing peers from authenticating with certificates
that are locally trusted, in particular, our own local certificate (which
safeguards against accidental reuse of certificates on multiple peers).

On the other hand, if this option is enabled, end-entity certificates
for peers can't be configured anymore explicitly (e.g. via remote.certs
in swanctl.conf).
2023-11-13 12:01:41 +01:00
Tobias Brunner
714c939018 kernel-netlink: Increase the default receive buffer size
Also simplify how we try to exceed the system-wide maximum.  We basically
just try to force the value and simply fall back to the regular call.
The kernel actually won't let the latter fail if the value is too big,
it just caps it at the internal maximum.
2023-07-26 15:14:50 +02:00
Tobias Brunner
e306fa5f73 kernel-libipsec: Add support to send/receive raw ESP packets
This is currently only supported on Linux and with the appropriate
permissions.

Since it's experimental, it's disabled by default.

The log messages for each sent and received ESP message are logged in NET
like the ones in the socket-default plugin for UDP-encapsulated messages.
2023-05-23 13:19:47 +02:00
Tobias Brunner
8aa13a1797 eap-peap: Initiate Phase 2 immediately for TLS 1.3
Before TLS 1.3, the server sent the last handshake message and had the
option to piggyback the EAP-Identity request directly onto the packet
with the TLS Finished message, or wait for the empty message by the
client that acknowledges the completion of the handshake.  With TLS 1.3,
the client finishes the handshake after the server.  So this option
is irrelevant there and we immediately start with Phase 2.
2023-03-02 09:31:52 +01:00
Tobias Brunner
d605584a7a NEWS: Add news for 5.9.10 2023-02-24 16:05:58 +01:00
Tobias Brunner
58f278f932 charon-nm: Use an XFRM interface if available
This allows NM more freedom in regards to how it wants to use the passed
device.  In particular, if dnsmasq is used with NM as that binds to the
interface to send requests via VPN.

Installing the VIPs on lo avoids weird address removal/addition events
that happen for IPv6 on the physical interface (which would cause the VIP
to get incorrectly detected as non-VIP address and ignored during
deletion).

We could let NM install routes via XFRM interface, however, that causes
problems with e.g. the bypass-lan plugin (the throw routes in table 220
wouldn't have any effect).  We could let it install regular routes in
the main table, but determining the physical interface would be tricky
as the routes installed by NM, also in the main table, would conflict.

So instead we let the kernel-netlink interface install routes via XFRM
interface and to avoid routing the IKE traffic that way, we set a mark
on the IKE socket and exclude traffic with that mark from our routing
table.
2023-02-22 13:43:17 +01:00
Tobias Brunner
04486507b2 kernel-netlink: Add an option to install routes for SAs with XFRM interfaces
Since these might conflict with IKE traffic, this requires special care.
One option is to install bypass policies for the peer, which install
appropriate (throw) routes.  However, that won't work if the traffic to
the gateway itself should be protected, in particular, for host-to-host
tunnels.  So an alternative is to set a mark for the IKE socket and then
exclude that traffic from table 220 via the kernel-netlink plugin's
fwmark option.
2023-02-22 13:37:45 +01:00
Tobias Brunner
805cc3a69f curl: Add an option to select the SSL/TLS backend (if available)
If libcurl is built with MultiSSL support (not the case for e.g.
Debian/Ubuntu, which ship separate, conflicting libraries), this allows
selecting the SSL/TLS backend libcurl uses.
2023-01-23 11:17:33 +01:00
Tobias Brunner
1c0b14baa3 conf: Add swanctl.conf and swanctl man pages to SEE ALSO 2023-01-16 11:37:27 +01:00
Tobias Brunner
7e43a5f3d2 conf: Replace hard-coded /etc where appropriate
Also document the actual value of ${sysconfdir}.
2023-01-16 11:36:58 +01:00
Tobias Brunner
cf6f56f619 Fixed some typos, courtesy of codespell 2022-12-22 19:03:37 +01:00
Tobias Brunner
17fd304e60 resolve: Don't install individual servers via resolvconf
The resolvconf implementation provided by systemd via resolvectl strips
everything after the interface name, so each additional server that's
installed replaces the previous one.  And even for other resolvconf
implementations installing them individually doesn't seem necessary as
we track and refcount them anyway.

Closes strongswan/strongswan#1353
2022-12-19 16:14:25 +01:00
Tobias Brunner
bd6014a97b resolve: Avoid dots in protocol part of interface names when using resolvconf
Newer releases of systemd contain a change that removes not the part
after the first dot but the part after the last when determining the
interface name (apparently some interface names actually contain a dot).

This changes the default prefix to only contain one dot and avoids the
dots added by IPv4 addresses to create a unique interface/protocol for
each DNS server (it also replaces the `:` in IPv6 addresses with
something that might cause less conflicts).

References strongswan/strongswan#1353
2022-12-19 16:14:01 +01:00
Tobias Brunner
dee1916e4c resolve: Make path to resolvconf(8) configurable
Prefer the configured command over finding it at the default location
over installing in the configured file.

References strongswan/strongswan#744
2022-12-19 16:12:46 +01:00
Tobias Brunner
64b10dfb28 conf: Document accepted number and time formats 2022-11-10 16:50:02 +01:00
Tobias Brunner
185b1376a3 conf: Explicitly add time unit to default value for options that accept them 2022-11-10 16:49:35 +01:00
Thomas Egerer
4ea61dcbfe kernel-interface: Make first reqid configurable
This can be helpful to reserve low reqids for manual configuration.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2022-10-05 10:28:05 +02:00
Tobias Brunner
1968615590 revocation: Enforce a (configurable) timeout when fetching OCSP/CRL
Malicious servers could otherwise block the fetching thread indefinitely
after the initial TCP handshake (which has a default timeout of 10s
in the curl and winhttp plugins, the soup plugin actually has a default
overall timeout of 10s).
2022-10-03 10:48:46 +02:00
Andreas Steffen
747e840912 libstrongswan: Encode RSA-PSS algorithmIdentifier variant
Some third party IKEv2 products expect an RSA-PSS ASN.1
algorithmIdentifier with an explicit trailerField value (CONTEXT3)
instead of the DEFAULT value if the trailerField is missing.

The setting charon.rsa_pss_trailerfield = yes enables the explicit
encoding.
2022-09-06 21:15:43 +02:00
Tobias Brunner
73f6047a77 conf: Remove config snippet for scepclient 2022-09-06 09:33:00 +02:00
Andreas Steffen
122796df27 pki: Additional pki.scep options for strongswan.conf 2022-08-24 20:46:44 +02:00
Andreas Steffen
7c7a5a0260 pki: Enroll an X.509 certificate with a SCEP server 2022-08-24 20:46:44 +02:00
Tobias Brunner
19ef2aec15 Update copyright headers after acquisition by secunet 2022-06-28 10:22:56 +02:00
Tobias Brunner
cc1d78b0a8 conf: Fix documentation for leak detective's usage thresholds
These only apply to the usage reports that are available via
`stroke memusage`, not to leak reports when executables are terminated,
which always include all non-whitelisted leaks.
2022-06-21 15:44:59 +02:00
Tobias Brunner
b866ee88bf ike: Track unprocessed initial IKE messages like half-open IKE_SAs
This should make the DoS limits (cookie_threshold[_ip] and block_threshold)
more accurate so that it won't be possible to create lots of jobs from
spoofed IP addresses before half-open IKE_SAs are actually created from
these jobs to enforce those limits.

Note that retransmits are tracked as half-open SAs until they are
processed/dismissed as the check only happens in checkout_by_message().

Increasing the count in process_message_job_create() avoids issues with
missing calls to track_init() before calling checkout_by_message() (e.g.
when processing fragmented IKEv1 messages, which are reinjected via a
process message job).
2022-04-14 15:28:07 +02:00
Tobias Brunner
d8104b7c69 receiver: Add per-IP cookie threshold
Because the global cookie threshold is higher than the per-IP block
threshold, it was previously possible for an attacker to block a legitimate
user by sending spoofed IKE_SA_INIT packets from that user's IP.

The timespan for requiring cookies is now also not extended anymore with
every IKE_SA_INIT received during the calm down period.  Because this
allowed an attacker, after initially triggering the global cookie threshold,
to force cookies for all clients by sending just a single spoofed
IKE_SA_INIT every 10 seconds.

We keep track of reaching the per-IP threshold in segments of the hashed
IP addresses, so only a (random, due to chunk_hash()'s random key) subset
of clients will receive cookies, if single IPs are targeted.

The default global threshold is increased a bit.
2022-04-14 15:28:07 +02:00
Martin Willi
9877ce6c56 sys-logger: Optionally support mapping strongSwan loglevels to syslog levels
strongSwan logs all syslog messages using LOG_INFO for historical reasons,
regardless of the strongSwan loglevel used producing the log message.

In some setups with advanced logging infrastructure, it may be feasible
to be more verbose when logging in strongSwan, but then filter messages
on the syslog server. While this may be possible by custom syslog filtering
rules matching the log level included with the log_level setting, this is
not super convenient.

So add a new map_level setting, which can map strongSwan loglevels to
syslog loglevels. By default this is disabled, keeping the existing
behavior. If enabled, it maps strongSwan loglevels to syslog loglevels
at a given syslog loglevel offset.

Closes strongswan/strongswan#859
2022-01-24 17:33:02 +01:00
Martin Willi
e3d1766aff addrblock: Allow limiting validation depth of issuer addrblock extensions
RFC3779 requires to validate the addrblocks of issuer certificates strictly,
that is, they must contain the extension and the claimed addrblock, up to
the root CA.

When working with third party root CAs that do not have the extension,
this makes using the plugin impossible. So add a depth setting that limits
the number of issuer certificates to check bottom-up towards the root CA.
A depth value of 0 disables any issuer check, the default value of -1
checks all issuers in the chain, keeping the existing behavior.

Closes strongswan/strongswan#860
2022-01-24 17:32:06 +01:00
Noel Kuntze
a20daaa336 conf: Fix typo for ha plugin's buffer size option
Fixes: ce048c30ff87 ("ha: Double receive buffer size for HA messages and make it configurable")
Closes strongswan/strongswan#832
2022-01-03 10:20:08 +01:00
Andreas Steffen
8249e6afad libtpmtss: Establish session with TPM 2.0
Using the trusted RSA or ECC Endorsement Key of the TPM 2.0 a
secure session is established via RSA public key encryption or
an ephemeral ECDH key exchange, respectively.

The session allows HMAC-based authenticated communication with
the TPM 2.0 and the exchanged parameters can be encrypted where
necessary to guarantee confidentiality.
2021-12-11 16:21:59 +01:00
Tobias Brunner
3cd2e2ccc6 openssl: Make fips_mode option work with OpenSSL 3 2021-12-08 11:34:18 +01:00
Tobias Brunner
f556fce16b openssl: Load "legacy" provider in OpenSSL 3 for algorithms like MD4, DES etc.
We still require these algorithms for e.g. EAP-MSCHAPv2, so the option is
enabled, by default.  To use other providers (e.g. fips or even custom
ones), the option can be disabled and the providers to load/activate can
be configured in openssl.cnf.  For instance, the following has the same
effect as enabling the option:

    openssl_conf = openssl_init

    [openssl_init]
    providers = providers

    [providers]
    default = activate
    legacy = activate

    [activate]
    activate = yes
2021-12-08 11:34:13 +01:00
Tobias Brunner
f4bfdec21f kernel-pfroute: Set lower MTU on TUN devices
The default MTU of 1500 is too high if kernel-libipsec is used (considering
the overhead of UDP-encapsulated ESP), but might also have an effect if
a TUN device is only used to install a virtual IP (the route points to it,
so the system might use its MTU and 1500 would still be too high).

This also works around an issue on macOS 12 where no RTM_IFINFO event
is sent for the newly created TUN device (neither for the creation,
setting it "up", nor adding the address).  Changing the MTU, however,
triggers such an event and we can detect the virtual IP.

Closes strongswan/strongswan#707
2021-11-09 09:43:01 +01:00
Tobias Brunner
e166e6913c Change shebang for Python scripts to use python3 2021-09-21 12:51:47 +02:00
René Fischer
4261fcedec botan: Use strongSwan's RNG interface in Botan plugin
This allows using rng_t implementations provided by other plugins to
serve as RNG for Botan.

Closes strongswan/strongswan#192.
2021-02-15 09:27:51 +01:00
Pascal Knecht
e3757300eb tls-crypto: Add signature scheme config file filter
And add signature scheme unit tests.
2021-02-12 14:35:23 +01:00
Pascal Knecht
e5b6565730 tls-crypto: Rename DH group/key exchange method config option
TLS key exchange methods are now configured with `ke_group`.
2021-02-12 14:35:23 +01:00
Tobias Brunner
a60e248b0d libtls: Increase default min version to 1.2
The older versions are generally considered deprecated (there is an
Internet-Draft that aims to do that formally).
2021-02-12 14:35:23 +01:00
Shmulik Ladkani
a4a128bd2f tls-server: Optionally omit CAs in CertificateRequest messages
Usually, the DNs of all loaded CA certificates are included in the
CertificateRequest messages sent by the server.

Alas, certain EAP-TLS clients fail to process this message if the
list is too long, returning the fatal TLS alert 'illegal parameter'.

This new option allows configuring whether CAs are included or an
empty list is sent (TLS 1.2), or the certificate_authorities extension
is omitted (TLS 1.3).  The list only serves as hint/constraint
for clients during certificate selection, they still have to provide
a certificate but are free to select any one they have available.

Closes strongswan/strongswan#187.
2021-02-12 14:35:23 +01:00
Tobias Brunner
92aef122c3 libtls: Reduce default max version to 1.2
Using TLS 1.3 with various EAP methods is not yet fully standardized, so we
don't enable it by default yet.
2021-02-12 14:35:23 +01:00
Tobias Brunner
663969ddf7 libtls: Make min/max TLS version configurable
Except for the tls_test tool, the versions now default to those
configured in strongswan.conf.
2021-02-12 14:35:23 +01:00
Tobias Brunner
86fb24c2c5 Remove the ecp_x_coordinate_only option
This was for compatibility with very old releases and only complicates
things unnecessarily nowadays.
2021-01-20 17:53:35 +01:00
Andreas Steffen
9b4a2322d6 libimcv: Evaluate IMA SHA-256 measurements 2021-01-08 11:00:15 +01:00
Tobias Brunner
f3f93cade9 load-tester: Also request a virtual IPv6 address
Fixes #3595.
2020-10-27 16:40:38 +01:00
Tobias Brunner
b422f16d10 sys-logger: Optionally log the level of each message
Fixes #3509.
2020-10-27 10:42:49 +01:00
Tobias Brunner
a3f5e38b7f file-logger: Optionally log the level of each message
Fixes #3509.
2020-10-27 10:42:39 +01:00
Andreas Steffen
3ef5b23903 pts: Variable size PCR banks 2020-10-07 16:54:32 +02:00