5 Commits

Author SHA1 Message Date
Valentin David
32cf925deb i/b/dm_crypt: add missing permissions
Give lock permission to /dev/dm-*. Also allow to create
/run/cryptsetup.
2023-03-28 12:42:11 +02:00
Miguel Pires
d097436c1c many: fix formatting w/ gofmt 1.19
Go 1.19 includes some changes to gofmt which intend to make lists and
heading clearer when rendered (https://go.dev/doc/go1.19). This commit
is the result of running the new gofmt and manually fixing some of it.
This was necessary because the new gofmt assumed lines beginning w/ tabs
to start lists or examples. While this is often true in our codebase,
we occasionally also use tabs to indent the lines after a TODO or FIXME
prefix or in yaml (e.g., excerpts of a snap.yaml). This meant that a lot of the
reformatted comments were broken and had to be fixed manually.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-01-16 14:23:11 +01:00
Peter Sabaini
62b21c7d5b Fix dm-crypt: add read access to /run for cryptsetup
When running `cryptsetup luksFormat` cryptsetup attempts to open /run
but fails due to a missing apparmor rule

Fixes: https://bugs.launchpad.net/snapd/+bug/1999683

Signed-off-by: Peter Sabaini <peter.sabaini@canonical.com>
2023-01-03 16:55:44 +01:00
Buğra Aydoğar
f3966b24b3 interfaces: allow access to the file locking mechanism for cryptosetup 2022-05-16 16:36:58 +03:00
Ondrej
fbb7adad0d interfaces: builtin: add dm-crypt interface to support external storage encryption
* interfaces: builtin: add dm-crypt interface

dm-crypt interface allows handling of dm-crypt devices
- setting up luks partition
- locking/unlocking of dm-crypt partition
- adding key(s) to kernel keyring
- formatting of encrypted partition(s) ( creation of fs)
- mounting of encrypted partition(s)

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* interfaces: builtin: add tests for dm-crypt interface

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* interfaces: builtin: dm-crypt: update summary

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* interfaces: builtin: dm-crypt: make udev rules more strict dm[0-9]->dm-[0-9]

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* interfaces: builtin: dm-crypt: fix typo and description

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* interfaces/tee: add dm-crypt interface

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* interfaces/builtin: update basedeclaration_test for dm-crypt interface

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* interfaces: run `go fmt` on basedeclaration_test.go

* interfaces: add XXX comment about hardcoded mount points in dm-crypt interface

Co-authored-by: Michael Vogt <mvo@ubuntu.com>
2021-06-10 17:32:13 +02:00