-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature : aes-cbc then hmac for tpm2 (#2)
- Loading branch information
1 parent
32520ec
commit a391ccb
Showing
1,311 changed files
with
695 additions
and
458,272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,39 @@ | ||
.idea/ | ||
# IntelliJ project files | ||
.idea | ||
*.iml | ||
out | ||
gen | ||
build/ | ||
.DS_Store | ||
generated/ | ||
deployed.json | ||
.socket | ||
.socket | ||
k8s-kms-plugin | ||
|
||
# dev | ||
pkg/crypto11 | ||
pkg/gose | ||
TODO.md | ||
k8s-kms-plugin-dlv | ||
|
||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
|
||
# Go workspace file | ||
go.work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.21.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Quick Start | ||
|
||
## SoftHsm | ||
|
||
Install the required packages : | ||
|
||
```sh | ||
# debian | ||
sudo apt install softhsm2 opensc | ||
# redhat | ||
sudo yum install epel-release softhsm opensc | ||
``` | ||
|
||
Setup for rootless usage : | ||
|
||
```sh | ||
sudo cp /etc/softhsm/softhsm2.conf $HOME | ||
sudo chown $USER: $HOME/softhsm2.conf | ||
echo 'export SOFTHSM2_CONF=$HOME/softhsm2.conf' >> $HOME/.bashrc | ||
source $HOME/.bashrc | ||
sudo usermod -aG softhsm $USER | ||
``` | ||
|
||
**Logout and login**. | ||
|
||
Create a token : | ||
|
||
```sh | ||
softhsm2-util --init-token --slot 0 --label mylabel --so-pin mysopin --pin mypin | ||
``` | ||
|
||
Create the encryption key : | ||
|
||
```sh | ||
# for debian | ||
export MODULE="/usr/lib/softhsm/libsofthsm2.so" | ||
# for redhat | ||
export MODULE="/usr/lib64/pkcs11/libsofthsm2.so" | ||
# aes kek | ||
pkcs11-tool --module $MODULE --token-label mylabel --pin mypin --keygen --key-type aes:16 --label aes0 | ||
``` | ||
|
||
Start the plugin : | ||
|
||
```sh | ||
SOCKET="/run/user/$(id -u $USER)/k8s-kms-plugin.sock" | ||
# aes-gcm mode | ||
k8s-kms-plugin serve --socket $SOCKET \ | ||
--p11-lib $MODULE --p11-label mylabel --p11-pin mypin --p11-key-label aes0 \ | ||
--enable-server | ||
``` | ||
|
||
Start a K3S cluster with the proper KMS configuration in [encryption-conf.yaml](k8s/encryption-conf.yaml) : | ||
|
||
```sh | ||
curl -sfL https://get.k3s.io | sh -s - \ | ||
--kube-apiserver-arg=encryption-provider-config=encryption-conf.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ import ( | |
"context" | ||
"fmt" | ||
"google.golang.org/grpc" | ||
"net/url" | ||
"time" | ||
) | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.