Commit Graph
1074 Commits
Author SHA1 Message Date
Koen van HoveandGitHub 0ccc5cdff4 Add support for UNIX sockets (#1322)
This PR adds API access via a local Unix socket on Unix systems allowing to
use the username of local user accessing the API as the authentication
username.

Configuration options are provided to map user names to roles similar to the
configfile authentication provider.

This will allow using Krill without authentication tokens if it is only
accessed via krillc on the same machine.

The PR also removes the example configuration files and moves the
documentation included in those files into a krill.conf.5 manual page. By
doing this, it simplifies the creation of the configuation file in the binary
packages. Those are now very minimal and only contain the mandatory config
options.
2026-01-06 14:27:31 +01:00
LaunchPadandGitHub f75c9654b1 Fix TreeIter::more_specific to correctly handle IPv6 subprefixes (#1339) 2026-01-05 17:59:51 +01:00
Martin HoffmannandGitHub 8bd1ed3c77 Spawn sweeping of credentials cache. (#1337)
This PR spawns the sweeping of the credentials cache for the authenticator.
Somehow we missed this when rewiring authentication handling.
2025-12-02 14:13:08 +01:00
Koen van HoveandGitHub 206f308b3d Update openidconnect to v4 (#1333) 2025-11-24 12:01:16 +01:00
Martin HoffmannandGitHub dd5c7dcb1d Bring back the built-in RISwhois tree for BGP analysis. (#1329)
This PR brings back the built-in tree of downloaded RISwhois data rather
than using the Roto API. It does so using a memory-optimized tree
implementation and has a much smaller memory footprint than the previous
iteration. At the time of writing, the a full RISwhois dataset requires 55
megabytes of memory.

This PR also reverts the changes to the configuration. It removes the
bgp_api_enabled, bgp_api_uri, and bgp_api_cache_duration fields and adds
bgp_riswhois_enabled, bgp_riswhois_v4_uri, bgp_riswhois_v6_uri, and
bgp_riswhois_refresh_duration fields, all of which are optional.

Because of these config changes, the PR is a breaking change.
2025-11-17 17:54:27 +01:00
Koen van HoveandGitHub a776e79abd Fix removing children/parents/CAs with incomplete handshake (#1331)
This PR fixes an issue where removing children or parents from CAs fails
before a successful communication with the remote CA. It also fixes an error
message when CAs without parent, children, and repository are removed.
2025-10-27 16:42:13 +01:00
Koen van HoveandGitHub ce166d1757 Be more flexible on relations existing in the bgp-api JSON (#1326)
This PR resolves an issue with the new BGP API code which returns no
announcement info even though there is announcement info (but it is
available, but there is no information about its relations).
2025-10-10 16:17:31 +02:00
Martin HoffmannandGitHub 66fe52fedb Simplify storage keys. (#1325)
This PR simplifies the structure of the keys used by the key-value store.
It changes the scope portion from being a sequence of identifiers to an
optional single identifier since the sequence is actually never used. As a
consequence, namespace, scope, and key now all use the same type, the newly
introduced Ident.
2025-10-10 16:14:43 +02:00
Martin HoffmannandGitHub 01bf280229 Code improvements suggested by Clippy 1.90. (#1321) 2025-09-19 12:10:42 +02:00
Martin HoffmannandGitHub a87ced05ab Fix hidden lifetime warnings from Rust 1.89. (#1315)
This PR fixes the “hiding a lifetime that's elided elsewhere is confusing”
warning introduced in Rust 1.89.
2025-08-11 14:29:01 +02:00
Martin HoffmannandGitHub 62b9a6cd5b Initialize properties store to distinguish 0.14 from 0.15. (#1309)
This PR adds a step to the start of the Krill daemon that initializes the
property store with the current version if it hasn’t been initialized
earlier. It also assumes that an uninitialized property store with no
per-store version information indicates that the data is from version 0.14.0
and migrates the stores lock directories accordingly.
2025-08-05 09:57:58 +02:00
Koen van HoveandGitHub d174f2d7b4 Make TA messaging clearer (#1305)
This PR updates the message presented when the TA proxy creates an
empty TA signer request to better explain the reasons.
2025-07-31 15:03:16 +02:00
Martin HoffmannandGitHub af65419d16 Listing scopes will not include the global scope. (#1307)
This PR changes the function that collects all scopes for a given store to
not include the global scope. This restores the behaviour of kvx.

As a side effect, it changes the store testing code to run on both backends.
2025-07-31 14:36:32 +02:00
Martin HoffmannandGitHub c22f7665b2 Ignore .locks scope when upgrading stores. (#1306)
This PR skips any scope with .locks as its first segment when upgrading
any stores. This is an artifact of moving the lock directory from the top
level of each store to the top level of the storage space.
2025-07-28 16:48:20 +02:00
Martin HoffmannandGitHub 2210e6f84e Code improvements suggested by Clippy 1.88. (#1303) 2025-06-30 14:24:45 +02:00
Martin HoffmannandGitHub 2cae6baf26 Use a BufWriter for writing to disk store. (#1301)
This PR uses a buffered writer when writing and serialising data which
should further improve performance.
2025-06-26 12:29:33 +02:00
Martin HoffmannandGitHub 55f1bcabb8 Use a BufReader for reading from disk store. (#1300)
This PR uses a buffered reader when reading and deserialising stored data
which should improve performance quite significantly.
2025-06-25 12:43:54 +02:00
Martin HoffmannandGitHub 38eb108f33 Fix redirect from / and fix handling of /ui paths. (#1293)
This PR fixes the redirect from / to /ui and allows subpaths of /ui.
2025-06-13 15:48:26 +02:00
Martin HoffmannandGitHub 8f053968d3 Keep RefreshAnnouncementsInfo task as a dummy. (#1292)
This PR brings the RefreshAnnouncementsInfo task back which was used to
trigger download of the RIS files. While we don’t need the task any more,
it may still be in the task queue which would cause Krill to refuse to
start.
2025-06-13 15:33:47 +02:00
Martin HoffmannandGitHub 3e523cd143 Upgrade to edition 2024. (#1290)
This PR upgrades to edition 2024.

This surfaces an interesting issue as std::env::set_var is unsafe. Krill
relies on various environment variables which are read throughout operation
and set to convey them to those points. This should be replaces by reading
those variables up front and conveying information by other means.
2025-06-12 17:52:41 +02:00
Martin HoffmannandGitHub 74dfd7e0cd Upgrade dependencies for 0.15.0. (#1288)
Some dependency requires edition 2024, so we need to upgrade the minimum
Rust version to 1.85.
2025-06-12 16:20:54 +02:00
Martin HoffmannandGitHub 7b66408dc6 Mark types that are used for storing state. (#1286)
This PR sticks a warning on all types that are used when serializing
Krill’s state. This hopefully will serve as a reminder that they cannot
be changed without considering migrations.
2025-06-12 14:15:12 +02:00
6e96db1352 Improve feedback given by krillta proxy signer show-request. (#1283)
This changes the feedback provided by krillta proxy signer show-request to
include information about certificate expiration and renewal time.

---------

Co-authored-by: Koen van Hove <koen@nlnetlabs.nl>
2025-06-10 14:09:31 +02:00
Martin HoffmannandGitHub e92c119e0b Revert a field name change in the repo content store. (#1284)
This PR fixes an field name change in a struct that turned out to be used
in stored state date.
2025-06-10 12:31:07 +02:00
Koen van HoveandGitHub 4c32c73680 Add caching to BGP analyser (#1266)
This PR adds caching of responses received from the BGP API. The caching
duration can be set via the new config variable `bgp_api_cache_seconds`
which defaults to 1800, i.e., 30 minutes.
2025-06-05 15:29:11 +02:00
Martin HoffmannandGitHub 41d0d27ea0 Force re-issuance of TA-issued certificates if requested. (#1281)
This PR disables the protection against early re-issuance of certificates
for certificates that have the full resource set, typically TA certificates.
2025-06-05 15:18:52 +02:00
Martin HoffmannandGitHub 99e331b18e Remove static-openssl feature. (#1279)
This PR removes the static-openssl feature. If necessary, this features can
be invoked by selecting openssl/vendored directly.

The PR also removes building and testing with default features from the CI
workflow. The only difference between default and all features currently is
rta which is deprecated and will be removed, anyway.

This PR now also fixes a few issues in krillc config simple and the post
install scripts for Debian and RPM packages.
2025-06-04 17:58:28 +02:00
Martin HoffmannandGitHub 4a76408530 Code improvements suggested by Clippy 1.87. (#1278)
This PR implements some of the suggestions made by Clippy 1.87.

Some of the suggestions have been ignored by way of allow attributes.
In particular, we allow the large size of commons::error::Error for now,
but this will need to be fixed in another PR.
2025-06-04 14:51:40 +02:00
Martin HoffmannandGitHub 35cd5d0bb2 Redesign the HTTP service. (#1264)
Initially, this PR was intended to more clearly separate code between Krill
“business logic” – now bundled in a KrillManager –, and the HTTP server code
that serves the API. The former now lives in the server module, the latter
in the daemon module together with all the code to spin up a Krill daemon
driving the HTTP server.

However, along the way it turned into a complete redesign of how the HTTP
server code works. Request handling has been split into three stages that
forces implementers to check for permissions (or actively choose to not
check), and read the body (or check that there isn’t one). Dispatching of
the request has been restructured which should make it easier to follow what
goes on where.

This PR increases the minimum Rust version to 1.81.
2025-04-14 11:17:08 +02:00
Koen van HoveandGitHub 949aedcc79 Make Clippy happy (#1267) 2025-04-07 16:59:54 +02:00
Martin HoffmannandGitHub 9a9598ea67 Rename crate::daemon to crate::server. (#1263)
This PR renames the daemon module into the server module. This is in
preparation of separating the “business logic” from the actual daemon
driving it (which will then live in a new daemon module).
2025-03-31 12:17:41 +02:00
Koen van HoveandGitHub eeaa3748cb Make tests run in temporary folder (#1262)
Currently temporary files needed to run the tests are put in the
test-resources directory. This can make repeated tests behave differently.
This copies those files to a temporary directory first so they are always
run using a clean slate.
2025-03-31 11:55:41 +02:00
Koen van HoveandGitHub f2f94a251b Allow for the reissuance of TA certificates (including HSM support) (#1255)
This PR adds a new command to the TA signer that allows re-initializing it
with new settings.
2025-03-28 14:33:40 +01:00
Martin HoffmannandGitHub a5129e0c60 Move login cache sweep from scheduler into its own spawned task. (#1259)
This PR moves sweeping the login session cache from being driven of the
scheduler (and thus using persistent tasks) into a Tokio task that is
spawned onto the runtime at the start of the daemon.
2025-03-28 10:51:18 +01:00
Martin HoffmannandGitHub 4acdd84ab9 Refactoring and reorganizing. (#1258)
This PR refactors and reorganizes a lot of code. It attempts to organize
things in a way that allows to keep more things private. Conversely, it
made the fields of many data-only structs pub and removed the creator,
accessor, and unpack methods for those.

The PR deliberately avoid any functional code changes given that due to
its sheer size, it is essentially unreviewable.

This is also why it stopped short of re-organizing the structure of the
actual server, ie., the Krillserver and the daemon::http module which
currently have a rather blurry distinction. A follow-up PR will create a
more clear separation but this requires code changes.
2025-03-21 15:20:36 +01:00
Martin HoffmannandGitHub 2914b86d88 Import KVX with disk and memory stores. (#1253)
This PR imports the code previously in the kvx crate into Krill itself
as the commons::storage module. It also rearranges some of Krill’s
eventsourcing and queue code to better integrate with the now internal
storage module.
2025-03-21 14:07:16 +01:00
Martin HoffmannandGitHub fc104247ae Restructure authentication policies. (#1232)
This PR restructures how authentication policies are used in Krill. It
removes the use of Oso and its policy definition language and instead
switches to simple, straightforward mappings between permissions, roles,
and users.

The existing concept of roles is augmented to serve as the central
configuration option for limiting a user’s access to certain action and
resources. Roles are now user configurable via the new auth_roles
configuration directive. For each role, a set of permissions has to be
provided. Optionally, a list of resource handles (vulgo: CAs) can be given
in which case access is limited to these resources.

The authentication providers now assign one of these roles to each logged
in user.

The OpenID Connect provider now only determines claims for “id,” i.e., the
user name, and the “role.” Since we replaced the previous use of JMES
paths with custom functions with a more stringent model of matching and
substitution, the configuration had to change in a non-compatible way,
anyway, so we cleaned it up a bit and switched from a map to an array for
the claims.

For the config file provider, this was already possible by adding a “role”
attribute. This has now been changed into a “role” field of the user
details. In order to make upgrading seamless, the “role” attribute is
still accepted but a deprecation warning is logged. Since the auth_users
configuration is not used for the OpenID Connect provider any more, the
password_hash and salt fields of the user details are now mandatory.

Custom policies have been removed.

This is a breaking change.
2025-02-05 11:45:49 +01:00
Martin HoffmannandGitHub 068bd6a508 Refactor HTTP metrics. (#1249)
This PR refactors how response for the HTTP metrics endpoint is being
assembled. It uses a very thin layer on top of the bare Prometheus
protocol instead of manually writing all the content.

Ideally, this doesn’t change any of the metrics. It does, however,
slightly change the formatting.
2025-01-27 16:36:31 +01:00
Martin HoffmannandGitHub b4a750831e Update dependencies and resulting fix uuid-related errors. (#1248)
This PR update dependencies and fixes compile errors resulting from changes in the uuid crate.
2025-01-23 16:25:52 +01:00
Martin HoffmannandGitHub 5667312637 Clippy-suggested code improvements. (#1247) 2025-01-23 16:06:32 +01:00
Martin HoffmannandGitHub 9ef5e22134 Replace once_cell::OnceCell with std::sync::OnceLock. (#1246)
This PR removes the dependency on once_cell since all the relevant functionality is now in std.
2025-01-10 12:17:24 +01:00
Koen van HoveandGitHub 6da2c80d68 Integrate roto-api in Krill replacing RISwhois (#1233)
This PR replaces the downloading and parsing of RISwhois files in Krill
with the roto-api.
2024-12-20 14:28:00 +01:00
Koen van HoveandGitHub b72ad8556f Rename timing_config to ta_config and alias (#1241)
This PR renames the `timing_config` options in the Krill config to
`ta_config`. It was already required to have this name if the config
was used by the Krill TA signer. The `timing_config` name is allowed
as an alias in both cases now.
2024-12-04 10:08:54 +01:00
Martin Hoffmann 1899d5ed82 Add --version to krillup. 2024-12-02 17:15:26 +01:00
Martin HoffmannandGitHub 7b87658192 Clippy-suggested code improvements. (#1240) 2024-12-02 17:14:29 +01:00
Martin HoffmannandGitHub 6d253c22da Refactor cli to use clap’s derive. (#1228)
This PR changes how the clients -- krillc, krillta, as well as the
integration tests -- work to better fit the derive model provided by clap.
This results in basically everything in the cli module and all the
integration tests being different now.

The PR slightly changes the options for both krillc and krillta. For krillc,
the --server, --token, --format, and --api options are now before the first
subcommand (since they affect all commands). For krillta, those options are
now after krillta proxy but before the next subcommand, while --format is
now after krillta signer.

This PR also removes client support and integration tests for RTA.

This is a breaking change.
2024-08-20 14:05:06 +02:00
Koen van HoveandGitHub 7ba7e22c7f Create new Open ID client if old client is older than 60s (#1226)
This PR adds an explicit lifetime to the Open ID connection, and if the
connection has existed for more than 60 seconds, it will initialise a new
connection in order to pick up possible configuration changes at the provider.
2024-07-29 11:40:14 +02:00
Martin HoffmannandGitHub 3253d3c4b6 Reformat to 78 character lines. (#1218) 2024-06-26 10:28:34 +02:00
Martin HoffmannandGitHub 7f6ceadb7c Upgrade to edition 2021. (#1217)
This PR upgrades the codebase to Rust edition 2021.

This mostly just means removing a number of use statements for TryFrom and
TryInto. There are no actual code changes.
2024-06-25 16:20:40 +02:00
Martin HoffmannandGitHub 45eb8f857b Fix Clippy warnings and enable Clippy in CI. (#1216)
This PR fixes all warnings from nightly Clippy as of today and enables a
Clippy run in the CI workflow for the stable channel with all features
enabled.
2024-06-25 15:16:15 +02:00