Compare commits

...

34 Commits

Author SHA1 Message Date
f326e6eca2
Add copyright and licensing header 2023-07-16 02:52:56 +01:00
76d576dd29
Further detail compile-time options. 2023-06-13 12:54:27 +01:00
db2d9a87b7
Further explain scope of documentation. 2023-06-13 12:36:24 +01:00
7675d4d0a0
Further detail arenas. 2023-06-13 12:34:22 +01:00
9529ff5823
Add privilege requirements. 2023-06-13 12:31:35 +01:00
e1e946211f
Improve wording. 2023-06-13 12:27:42 +01:00
85cab6cbeb
Improve arenas explanation. 2023-06-12 17:38:34 +01:00
769724d7ff
Add extra line break to improve readability. 2023-06-12 17:36:50 +01:00
1526d6dfda
Add missing quotation marks. 2023-06-12 17:36:13 +01:00
2391a474d8
Improve wording. 2023-06-12 17:35:30 +01:00
d77517c1a8
Improve wording. 2023-06-12 17:12:17 +01:00
5cc54d19b0
Fix spelling. 2023-06-12 17:10:18 +01:00
26ad6211ca
Add missing period. 2023-06-12 17:09:54 +01:00
a2288ceb6d
Add GrapheneOS hardened_malloc documentation. 2023-06-12 17:08:21 +01:00
ce6c156d58
Improve code readability. 2023-06-08 01:14:58 +01:00
23057ea18f
Improve code readability. 2023-06-08 01:14:25 +01:00
8f068038dc
Fix AsciiDoc syntax. 2023-06-01 16:52:51 +01:00
6bec39f652
Rename OpenSSL Self-signed Certificate Chain documentation to clarify it documents self-signed certificate chains. 2023-05-30 01:03:48 +01:00
33da7194c6
Clarify documentation is for self-signed certificate chains. 2023-05-30 00:52:23 +01:00
a05ae0af27
Mention optional chain of trust verification. 2023-05-30 00:44:14 +01:00
ee41e6e573
Also verify chain of trust from intermediate certificate authority certificate to server certificate. 2023-05-30 00:42:17 +01:00
adae788a94
Also verify server certificate. 2023-05-30 00:40:31 +01:00
9f8a13c387
Also verify server key. 2023-05-30 00:39:23 +01:00
066f845d52
Fix intermediate certificate authority key filename. 2023-05-30 00:37:41 +01:00
0205b439ff
Also verify intermediate certificate authority certificate. 2023-05-30 00:36:59 +01:00
c6e9629bb1
Clarify intermediate certificate authority key verification is for intermediate certificate authority key. 2023-05-30 00:35:14 +01:00
e4ed366f64
Also verify intermediate certificate authority key. 2023-05-30 00:33:48 +01:00
cd491245f9
Correction for key encryption, not certificate encryption. 2023-05-30 00:30:55 +01:00
734333601a
Add OpenSSL Certificate Chain documentation. 2023-05-30 00:27:10 +01:00
628a3d5990
Fix Security Levels documentation AsciiDoc syntax. 2023-05-15 01:30:04 +01:00
3a2c92a457
Rewrite Security Levels documentation in AsciiDoc. 2023-05-12 17:05:11 +01:00
c1cae7a9e7
Remove non-security branch files. 2023-05-09 20:53:45 +01:00
7757843425
Remove unnecessary line break between head and body. 2023-05-09 17:40:51 +01:00
7b5459000e
Switch Security Levels documentation from plaintext to HTML formatting. 2023-05-09 17:38:12 +01:00
4 changed files with 218 additions and 33 deletions

View File

@ -1,33 +0,0 @@
# Documentation
Inferencium documentation.<br>
<br>
## Licensing
All content is licensed under <a href="https://git.inferencium.net/Inferencium/doc/src/branch/stable/license/CC-BY-4.0.txt">Creative Commons Attribution 4.0 International</a> license.<br>
<br>
## Security
All files are checked for security issues; however, it is always the user's responsibility to
audit the code before installing and/or executing it.<br>
<br>
Inferencium takes no responsibility for any security issues which may arise due to usage of this
repository.<br>
<br>
## Branches
### <a href="https://git.inferencium.net/Inferencium/doc/src/branch/main/">main</a>
Documentation root directory files pre-alpha development and alpha testing occurs in this
branch.<br>
Feature-complete modifications of this branch are merged to beta branch for beta testing.<br>
<br>
### <a href="https://git.inferencium.net/Inferencium/doc/src/branch/license/">license</a>
Documentation license files pre-alpha and alpha testing occurs in this branch.<br>
Feature-complete modifications of this branch are merged to beta branch for beta testing.<br>
<br>
### <a href="https://git.inferencium.net/Inferencium/doc/src/branch/beta/">beta</a>
Feature-complete beta testing of merged code from development branches occurs in this branch.<br>
Merges from development branches to this branch are squashed, and the updated versions of the
individual files are mentioned in the commit messages.<br>
<br>
### <a href="https://git.inferencium.net/Inferencium/doc/src/branch/stable/">stable</a>
Feature-complete and tested versions from beta branch are stored in this branch.<br>
Merges from beta branch to this branch are squashed, and the updated versions of the individual
files are mentioned in the commit messages.<br>
This branch contains code used in production.

View File

@ -0,0 +1,64 @@
= GrapheneOS hardened_malloc
// Copyright 2023 Jake Winters
// SPDX-License-Identifier: CC-BY-4.0
Version: 0.1.1.13
This documentation contains instructions to use
https://github.com/GrapheneOS/hardened_malloc[GrapheneOS hardened_malloc] memory allocator as the
system's default memory allocator. These instructions apply to both musl and glibc C libraries on
Unix-based and Unix-like systems. hardened_malloc can also be used per-application and/or per-user,
in which case root permissions are not required; this documentation focuses on system-wide usage
of hardened_malloc, assumes root privileges, and assumes the compiled library will be located in a
path readable by all users of the system.
== Increase Permitted Amount of Memory Pages
Add `vm.max_map_count = 1048576` to `/etc/sysctl.conf` to accommodate hardened_malloc's large amount
of guard pages.
== Clone hardened_malloc Source Code
`$ git clone https://github.com/GrapheneOS/hardened_malloc.git`
== Enter hardened_malloc Local Git Repository
`$ cd hardened_malloc/`
== Compile hardened_malloc
`$ make <arguments>`
`CONFIG_N_ARENA=n` can be adjusted to increase parallel performance at the expense of memory usage,
or decrease memory usage at the expense of parallel performance, where `n` is an integer. Higher
values prefer parallel performance, lower values prefer lower memory usage. The number of arenas has
no impact on the security properties of hardened_malloc.
* Minimum number of arenas: 1
* Maximum number of arenas: 256
For extra security, `CONFIG_SEAL_METADATA=true` can be used in order to control whether Memory
Protection Keys are used to disable access to all writable allocator state outside of the memory
allocator code. It's currently disabled by default due to a significant performance cost for this
use case on current generation hardware. Whether or not this feature is enabled, the metadata is all
contained within an isolated memory region with high entropy random guard regions around it.
For low-memory systems, `VARIANT=light` can be used to compile the light variant of hardened_malloc,
which sacrifices some security for much less memory usage.
For all compile-time options, see the
https://github.com/GrapheneOS/hardened_malloc#configuration[configuration section] of
hardened_malloc's extensive official documentation.
== Copy Compiled hardened_malloc Library
`# cp out/libhardened_malloc.so <target_path>`
== Set System to Preload hardened_malloc on Boot
musl-based systems: Add `export LD_PRELOAD="<hardened_malloc_path>"` to `/etc/environment` +
+
glibc-based systems: Add `<hardened_malloc_path>` to `/etc/ld.so.preload`

View File

@ -0,0 +1,83 @@
= OpenSSL Self-signed Certificate Chain
// Copyright 2023 Jake Winters
// SPDX-License-Identifier: CC-BY-4.0
Version: 0.0.5.14
This documentation contains the complete set of commands to create a new OpenSSL self-signed
certificate chain with V3 subjectAltName (SAN) extensions enabled.
Multiple SANs can be included in a certificate by adding each domain as a comma-delimited string.
Each key can be encrypted or unencrypted, with multiple encryption options; AES is recommended.
Optional verification can also be performed between multiple levels of certificates to ensure the
chain of trust is valid.
== Create Certificate Authority Key
`openssl genrsa -aes256 -out ca-key.pem 4096`
== Verify Certificate Authority Key
`openssl rsa -noout -text -in ca-key.pem`
== Create Certificate Authority Certificate
`openssl req -new -x509 -days 3653 -extensions v3_ca -key ca-key.pem -out ca-crt.pem`
== Convert Certificate to PEM Format
`openssl x509 -in ca-crt.pem -out ca-crt.pem -outform PEM`
== Verify Certificate Authority Certificate
`openssl x509 -noout -text -in ca-crt.pem`
== Create Intermediate Certificate Authority Key
`openssl genrsa -aes256 -out intermediate-key.pem 4096`
== Verify Intermediate Certificate Authority Key
`openssl rsa -noout -text -in intermediate-key.pem`
== Create Intermediate Certificate Signing Request
`openssl req -new -sha256 -key intermediate-key.pem -out intermediate-csr.pem`
== Create Intermediate Certificate Authority Certificate
`openssl ca -config intermediate.conf -extensions v3_intermediate_ca -days 1096 -notext -md sha256 -in intermediate-csr.pem -out intermediate-crt.pem`
== Verify Intermediate Certificate Authority Certificate
`openssl x509 -noout -text -in intermediate-crt.pem`
== Verify Chain of Trust (CA to Intermediate)
`openssl verify -CAfile ca-crt.pem intermediate-crt.pem`
== Create Server Key
`openssl genrsa -aes256 -out server-key.pem 2048`
== Verify Server Key
`openssl rsa -noout -text -in server-key.pem`
== Create Server Cerificate Signing Request
`openssl req -new -sha256 -subj "/C=/ST=/L=/O=/CN=" -addext "subjectAltName = DNS.1:" -key server-key.pem -out server-csr.pem`
== Create Server Certificate
`openssl x509 -sha256 -req -days 365 -in server-csr.pem -CA intermediate-crt.pem -CAkey intermediate-key.pem -extensions SAN -extfile <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=DNS.1:")) -out server-crt.pem`
== Verify Server Certificate
`openssl x509 -noout -text -in server-crt.pem`
== Verify Chain of Trust (Intermediate to Server)
`openssl verify -CAfile intermediate-crt.pem server-crt.pem`

View File

@ -0,0 +1,71 @@
= Security Levels
// Copyright 2023 Jake Winters
// SPDX-License-Identifier: CC-BY-4.0
Version: 1.0.2.7
== S0
Intended access: Public
Encryption: None
Signing: Optional
== S1
Intended access: Authorised users of S1 or lower security levels
Encryption: Enforced
Signing: Enforced
Permitted symmetrical encryption ciphers (order of preference):
* AES
* ChaCha20*
* Twofish
== S2
Intended access: Authorised users of S2 or lower security levels
Encryption: Enforced
Signing: Enforced
Permitted symmetrical encryption ciphers (order of preference):
* AES
* ChaCha20*
* Twofish
== S3
Intended access: Authorised users of s3 or lower security levels
Encryption: Enforced
Signing: Enforced
Permitted symmetrical encryption ciphers (order of preference):
* AES
* ChaCha20*
== S4
Intended access: Authorised users of s4 or lower security levels
Encryption: Enforced
Signing: Enforced
Permitted symmetrical encryption ciphers (order of preference):
* AES
* ChaCha20*
*Preferred when hardware-accelerated AES is unavailable.