Commit Graph

1928 Commits

Author SHA1 Message Date
Martin Willi 46d4d2a71e vici: Document how we pronounce the vici protocol and plugin 2017-03-20 10:39:10 +01:00
Tobias Brunner 6d86d0f516 kernel: Make range of SPIs for IPsec SAs configurable 2017-03-02 08:52:56 +01:00
Martin Willi d536b94e0d addrblock: Use dynamic TS narrowing instead of rejecting the whole CHILD_SA
Previously, the client had to propose no wider selectors than the certificate
permits, otherwise the complete CHILD_SA was rejected. However, with IKEv2
we can dynamically narrow the selectors to what the certificate allows. This
makes client and gateway configurations very simple by just proposing 0.0.0.0/0,
narrowed to selectors the client is permitted to route into the network.
2017-03-02 08:24:02 +01:00
Martin Willi d1317adb9a addrblock: Support an optional non-strict mode accepting certs without addrblock
This allows a gateway to enforce the addrblock policy on certificates that
actually have the extension only. For (legacy) certificates not having the
extension, traffic selectors are validated/narrowed by other means, most
likely by the configuration.
2017-03-02 08:24:02 +01:00
Tobias Brunner 8bd8dcd522 vici: Only log messages if there actually is a listener 2017-02-16 19:24:09 +01:00
Tobias Brunner fa5f6ba26c vici: Let has_event_listeners() actually check if clients are registered
Fixes: 8d96f90a79 ("vici: Add function to test if an event should be
generated")
2017-02-16 19:24:09 +01:00
Tobias Brunner f927ba975b vici: Add support for mediation extension 2017-02-16 19:24:09 +01:00
Tobias Brunner ed96fe72cf peer-cfg: Store mediated_by as name and not peer-cfg reference
This way updates to the mediation config are respected and the order in
which configs are configured/loaded does not matter.

The SQL plugin currently maintains the strong relationship between
mediated and mediation connection (we could theoretically change that to a
string too).
2017-02-16 19:24:09 +01:00
Tobias Brunner ec5f127a45 vici: Include uniqueness policy in list-conns 2017-02-16 19:24:09 +01:00
Tobias Brunner 808472c9f9 vici: Add command to initiate SA rekeying 2017-02-16 19:24:08 +01:00
Tobias Brunner 04c0219e55 vici: Use unique names for CHILD_SAs in the list-sas command
The original name is returned in the new "name" attribute.

This fixes an issue with bindings that map VICI messages to
dictionaries.  For instance, in roadwarrior scenarios where every
CHILD_SA has the same name only the information of the last CHILD_SA
would end up in the dictionary for that name.
2017-02-16 19:24:08 +01:00
Tobias Brunner bd6ef6be7e vici: Add support to load CA certificates from tokens and paths in authority sections 2017-02-16 19:24:08 +01:00
Tobias Brunner 2f8354ca6c vici: Add support to load certificates from file paths
Probably not that useful via swanctl.conf but could be when used via VICI.
2017-02-16 19:24:08 +01:00
Tobias Brunner 00bf6a2a49 vici: Add support to load certificates from tokens 2017-02-16 19:24:08 +01:00
Tobias Brunner 2ceeb96db5 vici: Add command to load a private key from a token
PINs are stored in a "hidden" credential set, so that its shared
secrets are not exposed via VICI.  Since they are not explicitly loaded as
shared secrets via VICI a client might consider them as removed secrets and
remove them.
2017-02-16 19:24:07 +01:00
Tobias Brunner b657740e16 vici: List namespace/peer-cfg name with policies and allow filtering
The two names are also transmitted in separate keys.
2017-02-16 19:24:07 +01:00
Tobias Brunner 7627f5f9c7 vici: Explicitly use peer name when uninstalling trap and shunt policies
Also adds an `ike` parameter to the `uninstall` command.
2017-02-16 19:24:07 +01:00
Tobias Brunner 02767e4309 stroke: Use peer name as namespace for shunt policies
The same goes for the start-action-job.  When unrouting, we search for
the first policy with a matching child-cfg.
2017-02-16 19:24:07 +01:00
Tobias Brunner 7a0fdbab42 shunt-manager: Add an optional namespace for each shunt
This will allow us to reuse the names of child configs e.g. when they
are defined in different connections.
2017-02-16 19:24:07 +01:00
Tobias Brunner ed105f45af vici: Add support for NT Hash secrets
Fixes #1002.
2017-02-16 19:23:51 +01:00
Tobias Brunner 3bedf10b25 vici: Add support for IPv6 Transport Proxy Mode 2017-02-16 19:23:50 +01:00
Tobias Brunner e00bc9f6b2 vici: Add support for certificate policies 2017-02-16 19:23:50 +01:00
Tobias Brunner 44fcc83310 vici: Add missing dscp setting for IKE_SAs
Fixes #2170.
2017-02-16 19:23:31 +01:00
Tobias Brunner cf57d9a98f vici: Add possibility to remove shared keys by a unique identifier
This identifier can be set when adding/replacing a secret.  The unique
identifiers of all secrets may be enumerated.
2017-02-16 19:21:13 +01:00
Tobias Brunner 2a56acf501 vici: Add commands to enumerate and remove private keys
They are identified by their SHA-1 key identifier.
2017-02-16 19:21:12 +01:00
Tobias Brunner d20bf50e04 vici: Update get_pools() in Python and Ruby bindings 2017-02-16 19:21:12 +01:00
Tobias Brunner 71fa1224ec vici: Add option to query a specific pool 2017-02-16 19:21:12 +01:00
Tobias Brunner c2129d1cbe bypass-lan: Don't use interfaces in policies
After an interface disappeared we can't remove the policies correctly as
the name doesn't resolve to the previous index anymore.
And making the policies so specific might not provide that much benefit.

To handle the interfaces on the policies correctly would require some
changes to the child-cfg, kernel-interface etc. so they'd take interface
indices directly so we could target the policies correctly even if an
interface disappeared (or reappeared and got a new index).
2017-02-16 19:20:18 +01:00
Martin Willi 395500b8c1 kernel-netlink: Use RTA_SRC to specify route source in kernel-based lookups
For table dumps the kernel accepts RTA_PREFSRC to filter the routes, which is
what we do when doing userspace route calculations. For kernel-based route
lookups, however, the RTA_PREFSRC attribute is ignored and we must specify
RTA_SRC for policy based route lookups.
2017-02-13 15:11:20 +01:00
Martin Willi 558691b3b0 kernel-netlink: Use kernel-based route lookup if we do not install routes
For gateways with many connections, installing routes is often disabled,
as we can use a static route configuration to achieve proper routing with
a single rule. If this is the case, there is no need to dump all routes and
do userspace route lookups, as there is no need to exclude routes we installed
ourself.

Doing kernel-based route lookups is not only faster with may routes, but also
can use the full power of Linux policy based routing; something we can hardly
rebuild in userspace when calculating routes.
2017-02-13 15:11:20 +01:00
Martin Willi 0b4e539cb3 vici: Include the Netfilter marks in listed CHILD_SAs 2017-02-13 15:11:20 +01:00
Martin Willi 22f08609f1 vici: Explicitly set the Python encoding type
When using vici over RPyC and its (awesome) splitbrain, encoding and decoding
strings fails in vici, most likely because of the Monkey-Patch magic splitbrain
uses.

When specifying the implicit UTF-8 as encoding scheme explicitly, Python uses
the correct method to encode/decode the string, making vici useable in
splitbrain contexts.
2017-02-13 15:04:44 +01:00
Tobias Brunner 21df4cc1ed kernel-pfroute: Implement enumeration of local subnets 2017-02-08 10:38:28 +01:00
Tobias Brunner 0aabfe0780 bypass-lan: Allow ignoring or only considering subnets of specific interfaces
The config can also be reloaded by sending a SIGHUP to charon.
2017-02-08 10:38:28 +01:00
Tobias Brunner 62b58a40da bypass-lan: Configure interface on bypass policy
Currently, only the kernel-netlink plugin supports this, the others will
just ignore it.
2017-02-08 10:38:28 +01:00
Tobias Brunner 2406474158 kernel-netlink: Return interface name in local subnet enumerator 2017-02-08 10:38:28 +01:00
Tobias Brunner 46c21e3cc3 kernel-interface: Add interface name to local subnet enumerator 2017-02-08 10:38:28 +01:00
Tobias Brunner f8a362bfbc bypass-lan: Add plugin that installs bypass policies for locally attached subnets 2017-02-08 10:38:28 +01:00
Tobias Brunner eac584a37d kernel-netlink: Implement enumerator for local subnets 2017-02-08 10:38:28 +01:00
Tobias Brunner 3c46ce2834 kernel-pfkey: Use the same priority range for trap and regular policies
Same as the change in the kernel-netlink plugin.
2017-02-08 10:36:38 +01:00
Tobias Brunner 0e9d6c4605 kernel-netlink: Use the same priority range for trap and regular policies
While trap and regular policies now often look the same (mainly because
reqids are kept constant) trap policies still need to have a lower priority
than regular policies to handle unroute/route correctly if e.g. IPComp
is used or the mode changes.  But if we use a completely different
priority range that's lower than that of regular policies it is not possible
to install overlapping trap policies.  By differentiating trap from
regular policies via the priority's LSB this issue is avoided while
still maintaining the proper ordering of trap and regular policies.

Fixes #1243.
2017-02-08 10:36:38 +01:00
Tobias Brunner 6606393b8c kernel-netlink: Fix spacing in log message when policy is unchanged 2017-02-08 10:36:37 +01:00
James Laird-Wah 094a4d15cf forecast: Mark correct port in UDP NAT-T rule
Closes strongswan/strongswan#62.
2017-02-08 09:54:02 +01:00
Tobias Brunner 865fd804ee eap-dynamic: Publish the get_auth() method of the wrapped EAP method
Fixes #2238.
2017-02-07 10:52:24 +01:00
Tobias Brunner b062d3cc44 kernel-netlink: Set NODAD flag for virtual IPv6 addresses
The Optimistic Duplicate Address Detection (DAD) seems to fail in some
cases (`dadfailed` in `ip addr`) rendering the virtual IP address unusable.

Fixes #2183.
2017-02-06 11:10:44 +01:00
Tobias Brunner 7a40162cb7 kernel-netlink: Prefer matching label when selecting IPv6 source addresses
This implements rule 6 of RFC 6724 using the default priority table,
so that e.g. global addresses are preferred over ULAs (which also have
global scope) when the destination is a global address.

Fixes #2138.
2017-02-06 11:06:22 +01:00
Tobias Brunner 965daa1df3 kernel-netlink: Use correct 4 byte alignment for AH with IPv4
By default, the kernel incorrectly uses an 8 byte alignment, which is
mandatory for IPv6 but prohibited for IPv4.  For many algorithms this
doesn't matter but that's not the case for HMAC_SHA2_256_128.
Since 2.6.39 the kernel can be explicitly configured to use a 4 byte
alignment.
2017-01-25 17:51:35 +01:00
Thomas Egerer 8a91729dfe kernel-netlink: Allow change of Netlink socket receive buffer size
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2017-01-25 17:42:38 +01:00
Tobias Brunner 4ae2209e3d kernel-pfkey: Set state to SADB_SASTATE_MATURE when adding/updating SAs
Picky kernels might otherwise reject our messages as RFC 2367 explicitly
mandates this.

Fixes #2212.
2017-01-25 17:30:57 +01:00
Tobias Brunner da565d9832 kernel-pfroute: Don't set a gateway if it is of a different address family than the destination 2017-01-25 17:29:44 +01:00