Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update some documentation #33

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
unreleased
----------
- Add default implementation for `RuleSet::conditional_rules`
- impl RuleSet for `syscalls::Sysno` for easier ad-hoc rulesets
- Use generics instead of impl Trait in public functions to allow turbofish usage

0.4.0
-----
- Add landlock functionality
- Add `landlock_rules` to RuleSet trait and new `LandlockRule` type
- Add `landlock_only` method to SafetyContext
- In test code, use rustls only in musl to get wider environment coverage
- Added several ExtraSafeError variants for Landlock-related errors
- See methods in SystemIO for how to use Landlock
- Landlock is enabled with the V2 ABI, which was added in kernel 5.19

0.3.0
-----
- Switch seccomp backend to seccompiler
Expand Down
13 changes: 12 additions & 1 deletion user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,18 @@ Seccomp, the underlying functionality provided by the kernel that extrasafe uses

If you want to use syscalls that aren't included in any of the builtin rulesets, consider [filing an issue to request a new one!](https://github.com/boustrophedon/extrasafe/issues)

In the meantime, you can create your own:
`RuleSet` is implemented for the `Sysno` type directly, so if you just want to enable one or two syscalls, the simplest way to do so is:

```rust
extrasafe::SafetyContext::new()
.enable(syscalls::Sysno::reboot).unwrap()
.enable(syscalls::Sysno::sysinfo).unwrap()
.apply_to_current_thread().unwrap();
```

However, this doesn't work for conditional rules yet.

In the meantime, you can create your own RuleSet:

```rust
use extrasafe::*;
Expand Down