Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
6e9aae7
Started major refactor into a library
Lut99 Oct 15, 2024
2e46d82
Posix reasoner is now working
Lut99 Oct 15, 2024
d2a810f
Removed (for now) unrelated tests
Lut99 Oct 15, 2024
0a665ac
Added context logging again
Lut99 Oct 17, 2024
24ec852
Added logging of the reasoner input
Lut99 Oct 17, 2024
f142d1c
`Dataset`s in `Workflow`s now carry `from`-information again
Lut99 Oct 18, 2024
a583ca9
Added `Eq`, `Hash` and `PartialEq` for `Dataset`
Lut99 Oct 19, 2024
e54c278
Workflows now accept not having an end user
Lut99 Oct 21, 2024
01275f5
Implemented `Eq`, `Hash` and `PartialEq` for `Entity`
Lut99 Oct 22, 2024
ef03ed8
`Visitor` and `VisitorMut` can now optimize recursion for linear conn…
Lut99 Oct 22, 2024
8d07921
`AuditLogger` commutes over mutable references
Lut99 Nov 4, 2024
d309b72
`AuditLogger` no longer requires mutable access to `self`
Lut99 Nov 5, 2024
6a63077
Added appropriate async bounds to `StateResolver::resolve()`
Lut99 Nov 5, 2024
80447a0
Added proper async bounds to `ReasonerConnector` and `AuditLogger`.
Lut99 Nov 5, 2024
7ce7bff
Removed the mutability requirement on `logger` for the EFlintJsonReas…
Lut99 Nov 6, 2024
d6fa392
Added some additional impls for `EFlintable`.
Lut99 Nov 6, 2024
3b9993f
Relaxed pointer-like constraints on `EFlintable` impls
Lut99 Nov 6, 2024
9d0ed50
Removed `State` from the EFlintJsonReasoner
Lut99 Nov 6, 2024
ffeec7e
Added `serde` impls for `NoReason` and `ManyReason`
Lut99 Nov 6, 2024
256c0ec
Added `ManyReason::into_iter()`
Lut99 Nov 14, 2024
d47ff14
Added the `ReasonerContext`
Lut99 Dec 2, 2024
1817e4c
Contexts are now actually deserializable
Lut99 Dec 2, 2024
9452ebc
(WIP) Started work on the Haskell interpreter
Lut99 Apr 16, 2025
3f51990
Added parsers for eFLINT traces
Lut99 Apr 25, 2025
87d2f82
Now parsing deltas, queries and triggers
Lut99 Apr 25, 2025
2710253
Now parsing violations, newtypes
Lut99 Apr 25, 2025
e504dcb
In theory, finished new backend
Lut99 Apr 25, 2025
687f47c
Added haskell reasoner to toplevel module alias
Lut99 Apr 29, 2025
b9e93d6
Added some covenience imports
Lut99 Apr 29, 2025
c896d26
Implemented `Clone` on handlers
Lut99 Apr 29, 2025
4caf270
Added `EFlintable` impl for `String`
Lut99 Apr 29, 2025
3848fa3
Made it possible to construct `PrefixedHandler`
Lut99 Apr 29, 2025
cfbd38d
Added various `Deserialize` and `Serialize` impls
Lut99 May 1, 2025
057cce7
`PrefixedHandler` now stores a `Cow` instead of a reference
Lut99 May 1, 2025
ac59937
Added notion of a base policy to this layer of the reasoner, as we're…
Lut99 May 1, 2025
467469b
Added functions to get full context from reasoner connector.
Lut99 May 1, 2025
6cf13ca
Removed obsolete `base16ct` dependency
Lut99 May 1, 2025
ab3e578
Moved `base_policy_hash` to public context
Lut99 May 1, 2025
8d850fc
Fixed bug where the wrong path is being recursed
Lut99 May 1, 2025
3b3febe
Fixed current directory not being followed by the actual path
Lut99 May 1, 2025
52a65ea
Fixed the connector not filtering prompts from event stream
Lut99 May 1, 2025
5f3f318
Now debugging final reasoner verdict
Lut99 May 1, 2025
67d91e2
Now returning spec-compliant reasons again
Lut99 May 1, 2025
8fa98aa
Re-moved git dependencies to workspace root
Lut99 May 6, 2025
1992ff0
Re-added MSRV
Lut99 May 6, 2025
9492446
Added `eflint-haskell` example
Lut99 May 6, 2025
74fbfb3
Fixed broken doc links
Lut99 May 6, 2025
fd09eaa
Fixed `cargo check --no-default-features` failing
Lut99 May 6, 2025
f108e7f
Now actually fixed broken doc links
Lut99 May 6, 2025
e841282
Added `IntoIterator` impls to `ManyReason`
Lut99 May 6, 2025
1ade6c7
Clippy fixes
Lut99 May 6, 2025
b34e81a
Updated tokio, actually got proper MSRV this time
Lut99 May 6, 2025
cb7ee4b
Final(?) clippy fixes
Lut99 May 6, 2025
95ba28d
Fixed repo to `BraneFramework` :)
Lut99 May 6, 2025
20aed1f
chore(deps): Set thiserror version to 2.0.0
DanielVoogsgerd May 27, 2025
374b5f2
chore(deps): Downgrade paste minimal version to 1.0.0
DanielVoogsgerd May 27, 2025
76af8d2
chore(deps): Downgrade chrono minimal version to 0.4.35
DanielVoogsgerd May 27, 2025
2ac9cf1
chore(deps): Lower minimal versions
DanielVoogsgerd May 28, 2025
a02d836
chore(deps): Use error trace from crates.io
DanielVoogsgerd Jun 7, 2025
b3749a3
Updated README.md & ARCHITECTURE.md to reflect the refactor.
Lut99 Jun 20, 2025
dbacd00
refactor: Fix async functions
DanielVoogsgerd Jun 12, 2025
4ef5884
refactor: Fix clippy errors
DanielVoogsgerd Jun 15, 2025
4aa012d
refactor: Make the code more idiomatic
DanielVoogsgerd Jun 12, 2025
b9c82f2
chore: Remove commented code
DanielVoogsgerd Jun 14, 2025
a3b77b3
refactor: Clean up error code
DanielVoogsgerd Jun 12, 2025
7d9abba
refactor: Clippy fixes
DanielVoogsgerd Jun 13, 2025
517ea67
fix: Fix tracing and logging issues
DanielVoogsgerd Jun 18, 2025
1403b2b
refactor: Move tests down
DanielVoogsgerd Jun 18, 2025
58bb3fd
refactor: Convert binaries to miette errors
DanielVoogsgerd Jun 18, 2025
b8b55c5
feat: Create InputFile abstraction
DanielVoogsgerd Jun 19, 2025
41c78ad
style: Various style and spelling fixes
DanielVoogsgerd Jun 19, 2025
64b9d2f
refactor: Clean format strings
DanielVoogsgerd Jun 19, 2025
0a3ec2c
feat: Add formatter module
DanielVoogsgerd Jun 19, 2025
5df5c1e
refactor: Abstract file hashing to separate function
DanielVoogsgerd Jun 19, 2025
f63ae04
refactor: Use blockformatter
DanielVoogsgerd Jun 19, 2025
547b385
refactor: Use BTreeSet in dependency resolution
DanielVoogsgerd Jun 19, 2025
c2e7721
refactor: Move README-esque info to README
DanielVoogsgerd Jun 19, 2025
4ac40df
fix: Reference new manual in README
DanielVoogsgerd Jun 19, 2025
725f51f
chore(clippy): Fix nightly clippy lints
DanielVoogsgerd Jun 20, 2025
06f55a6
chore(audit): Ignore paste deprecation
DanielVoogsgerd Jun 20, 2025
d04408a
fix(docs): Trim and update docs
DanielVoogsgerd Jul 3, 2025
ffc5100
chore: Bump MSRV
DanielVoogsgerd Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 21 additions & 50 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,24 @@
Policy reasoner architecture
============================

The policy reasoner repository consists of two main parts. A library and a set of
implementations.

### Library

The entry point for the library is `src/lib.rs` as per usual.
In these files no particular implementation of a policy reasoner is included, only
the mechanisms on which the concept of a policy reasoner can be implemented.

### Interface

The interface for the different reasoners must be the same. Its command line
arguments are defined in `src/bin/implementation/interface.rs`. It could be that a new
reasoner requires more arguments. You can implement another arguments struct, however
make sure the arguments defined in the common interface are supported as other
components of infrastructure may depend on it.

### Implementations

As of now there are three different implementations of a policy reasoners in
this repository. The entrypoint for a reasoner can be found in `src/bin/{...}.rs`.
The subsequent libraries that support the implementation, can be placed in the
`implementation` module in `src/bin/implementation/{...}`.

#### No-Op reasoner

The most minimal reasoner is called the no_op reasoner, it will always returns the
same verdict. This is not a good policy reasoner, but it can be a minimal
example for futher implementations of new policy reasoners.

#### Posix reasoner

There exists a reasoner that uses posix file permissions for access control. As
of now there exists a yaml mapping between file system uids and users with
regards to the policy reasoner, but the idea is to inject multiple ways of
mapping these users to file system uid / gids by means of LDAP/AD for example.
Right now there is no support for linux ACL (facl), but this could be added in
the future.

#### eFLINT reasoner

Lastly, there is a reasoner that implements the eFLINT language as a method of
expressing the control policies. This language can be very expressive with
regards to possible policies, but can also be more complicated to set up.

#### Extra reasonsers

We are looking for new and different ways of expressing policies. If you have an
idea on an implementation for a policy reasoner, feel free to open an issue and
we can discuss how to go about implementing it.
This project is organised as a collection of crates that implement various aspects of various instantiations of a `policy-reasoner`. They are separate crates instead of feature-gated modules in order to tame the wildy varying dependencies a little.

The crates doing the actual implementations can be found in the [`lib/`](lib/)-folder. Then, the [`src/`](src/)-folder provides a collection library that dynamically includes the crates based on features. Finally, [`examples/`](examples/) contains various example instantiations of the reasoner for different backends. They aren't (yet) exhaustive in terms of _all_ possible instantiations, but they do serve as an introduction to how to use and install each backend.

## Libraries
The following libraries are provided by the `policy-reasoner` workspace, grouped by function:
- [_reasoners_](lib/reasoners/) implement the `ReasonerConnector`-trait, which abstracts over specific backends.
- [`eflint-haskell`](lib/reasoners/eflint-haskell) contributes a wrapper around the [eFLINT Haskell implementation](https://gitlab.com/eflint/haskell-implementation). It accepts eFLINT's DSL.
- [`eflint-json`](lib/reasoners/eflint-json) contributes a wrapper around Olaf's [eFLINT GO-implementation](https://github.com/Olaf-Erkemeij/eflint-server/) (or, more precisely, [our fork](https://github.com/BraneFramework/eflint-server-go)). It accepts [eFLINT's JSON specification](https://gitlab.com/eflint/json-specification).
- [`no-op`](lib/reasoners/no-op) contributes a dummy reasoner that blindly accepts anything. It is mostly used for debugging purposes.
- [`posix`](lib/reasoners/posix) contributes a wrapper around Unix's filesystem to use its permissions for deciding dataset access. It is based on the work done by [Daniel Voogsgerd, ]().
- [_resolvers_](lib/resolvers/) implement the `StateResolver`-trait, which is responsible for providing current information about the runtime system to a static policy.
- [`file`](lib/resolvers/file) contributes a resolver that reads the current system state from a file. This one is mostly for debugging, though; usually, systems implement their own resolvers to discover the current state.
- [_loggers_](lib/loggers/) implement the `AuditLogger`-trait, which is triggered with auditable information of specific events in the reasoner and can store it in implementation-specific ways.
- [`file`](lib/loggers/file) contributes an implementation that writes the events to a file.
- [`no-op`](lib/loggers/no-op) contributes a dummy implementation that doesn't write any audit event. This is used for debugging, or in scenarios where no audit trail is desired.

Then there are also a few miscellaneous, auxillary libraries:
- [`eflint-to-json`](lib/eflint-to-json) contributes a wrapper around Olaf's [eFLINT to eFLINT JSON compiler](https://github.com/Olaf-Erkemeij/eflint-server/) (or more precisely, [our fork](https://github.com/BraneFramework/eflint-server-go)). This allows frontends to also use the eFLINT DSL with the [`eflint-json`](lib/reasoners/eflint-json) backend.
- [`spec`](lib/spec) contributes the core traits of the `policy-reasoner` mentioned above.
- [`workflow`](lib/workflow) contributes a specification of an abstract workflow that can be used to inform the policy to the task at hand.
Loading
Loading