Skip to content

Commit

Permalink
feat: introduce cryptographic documentation
Browse files Browse the repository at this point in the history
Documents all our current key generation algorithms.
  • Loading branch information
jedel1043 committed Oct 16, 2024
1 parent 72f1ede commit ab8fe8b
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
16 changes: 16 additions & 0 deletions explanation/cryptography/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(cryptography)=
# Cryptography

This section describes the cryptographic algorithms used by the Charmed HPC project.

- {ref}`munge`
- {ref}`jwt`

```{toctree}
:titlesonly:
:maxdepth: 1
:hidden:
MUNGE <munge>
JSON Web Tokens <jwt>
```
17 changes: 17 additions & 0 deletions explanation/cryptography/jwt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(jwt)=
# JSON Web Tokens (JWT)

Some Slurm charms support [JSON Web Tokens](https://jwt.io/) as an alternative authentication method for a Slurm cluster.

This service is used by the Slurm charms:

- [`slurmctld`](https://charmhub.io/slurmctld)
- [`slurmrestd`](https://charmhub.io/slurmrestd)

A shared private encryption key is required to verify the signature of client tokens. The current method uses RSA with a length of 2048 bits, which is generated using the [`cryptography`](https://pypi.org/project/cryptography/) package for Python.

The [Slurm documentation](https://slurm.schedmd.com/jwt.html) contains more information about the topic.

## Libraries used

- [`cryptography`](https://pypi.org/project/cryptography/), from PyPi.
20 changes: 20 additions & 0 deletions explanation/cryptography/munge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(munge)=
# MUNGE

[MUNGE (MUNGE Uid 'N' Gid Emporium)](https://dun.github.io/munge/) is an authentication service for creating and validating credentials.

This service is used by all our Slurm charms, including:

- [`slurmctld`](https://charmhub.io/slurmctld)
- [`slurmd`](https://charmhub.io/slurmd)
- [`slurmdbd`](https://charmhub.io/slurmdbd)
- [`slurmrestd`](https://charmhub.io/slurmrestd)

MUNGE requires sharing a cryptographically secure key between all the Slurm nodes in a cluster. To generate this key, the charms
use the [mungectl](https://github.com/charmed-hpc/mungectl) utility, which uses Go's [`crypto/rand`](https://pkg.go.dev/crypto/rand) library to generate a cryptographically secure key of 1024 bytes of length, using either [`getrandom(2)`](https://man7.org/linux/man-pages/man2/getrandom.2.html) if available, and [`/dev/urandom`](https://en.wikipedia.org/wiki//dev/random) otherwise.

You can find more information about MUNGE on its [official wiki](https://github.com/dun/munge/wiki).

## Packages used

- [`crypto/rand`](https://pkg.go.dev/crypto/rand), from the [Go standard library](https://pkg.go.dev/std).
10 changes: 10 additions & 0 deletions explanation/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
(explanation)=
# Explanation

- {ref}`cryptography`

🚧 Under construction 🚧

```{toctree}
:titlesonly:
:maxdepth: 1
:hidden:
cryptography/index
```

0 comments on commit ab8fe8b

Please sign in to comment.