-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bake with Tacoinfra Remote Signer using AWS KMS (#467)
* Pull flextesa image from oxheadalpha docker repo * remove false comment * indentation * Reformat signer structure + add tacoinfra signer * Pin utils Docker image Often python docker images have changes pushed using the same tag. The digest is different and hence we have to rebuild our utils image locally every time this happens. We pin the digest to enforce the use of single python version. We should be updating the base image manually when we choose to do so. * Working tezos-k8s remote signers * Put service account name in correct spot * Handle tacoinfra signer in config-generator * Functioning signer * check signer_url exists before creating url * Check for secret key before checking for remote signer * Simplify getting key type * Rename tezos-k8s signers to octez signers * Allow specifying env vars for tacoinfra signer container * Separate definition of diff signer types * Add comments * Don't allow replicas of tacoinfra signer to be configurable * Remove tacoinfra secret * Reorder functions and rename signer account * Fail if account is undefined * Rename container from tezos-signer to octez-signer * Remove secret volume * pick accounts field only * security context enhancements + use pvc for file ratchet * Add create-keys-json.py script * Use oxheadalpha docker hub tacoinfra image * Remove temp env vars * Remove extra # * Update helm chart diff test * Exit on error + cleanup octez-node.sh * Put back correct python image * Fix tests * make image pull policy configurable on other containers * update tacoinfra signer image * update tests * updates * Add namespace to metadata * WIP CI docker caching * Debug chown * WIP docker cache and temporarily turn of testing helm charts * Temp turn off check-lint-and-format and publish mkchain job * WIP * Fix adding security context capabilities not working The k8s docs here https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ say: """ Note: Linux capability constants have the form CAP_XXX. But when you list capabilities in your container manifest, you must omit the CAP_ portion of the constant. For example, to add CAP_SYS_TIME, include SYS_TIME in your list of capabilities. """ On EKS clusters we are running with version 1.22, writing "CAP_" works. It doesn't seem this rule was enforced However with my testing on 1.25 this breaks and we need to remove "CAP_". * Regen tests * Rename init container * update test
- Loading branch information
Showing
15 changed files
with
912 additions
and
210 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
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,40 @@ | ||
"""Get the public key hashes of the accounts provided via the signer's | ||
ConfigMap. Create json objects with the hashes as the keys and write them to | ||
keys.json. The signer will read the file to determine keys it is signing for.""" | ||
|
||
import json | ||
import logging | ||
import sys | ||
from os import path | ||
|
||
from pytezos import Key | ||
|
||
config_path = "./signer-config" | ||
accounts_json_path = f"{config_path}/accounts.json" | ||
|
||
if not path.isfile(accounts_json_path): | ||
logging.warning("accounts.json file not found. Exiting.") | ||
sys.exit(0) | ||
|
||
keys = {} | ||
|
||
with open(accounts_json_path, "r") as accounts_file: | ||
accounts = json.load(accounts_file) | ||
for account in accounts: | ||
key = Key.from_encoded_key(account["key"]) | ||
if key.is_secret: | ||
raise ValueError( | ||
f"'{account['account_name']}' account's key is not a public key." | ||
) | ||
keys[key.public_key_hash()] = { | ||
"account_name": account["account_name"], | ||
"public_key": account["key"], | ||
"key_id": account["key_id"], | ||
} | ||
|
||
logging.info(f"Writing keys to {config_path}/keys.json...") | ||
with open(f"{config_path}/keys.json", "w") as keys_file: | ||
keys_json = json.dumps(keys, indent=2) | ||
print(keys_json, file=keys_file) | ||
logging.info(f"Wrote keys.") | ||
logging.debug(f"Keys: {keys_json}") |
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.