This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
forked from Netflix/bless
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allows username validation against IAM groups This change gives the option to validate the remote username against the IAM groups containing the user invoking the lambda function. This is an optional feature which is used in conjunction with kmsauth. For example, if there were two groups of users, you could put your admins in the ssh-admin IAM group to allow them to generate certificates with a remote_username of 'admin'. Users with fewer permissions could be in the ssh-user group to allow them to generate certificates for the 'user' account. The group name is configurable, however they must all be in a consistent format, and must all contain the relevant remote_username once. * Compressed CA private key support * Fixing Netflix#72 thanks @Immortalin and @tuxinaut . * Add support for loading ED25519 public keys * Add certificate builder and test ED25519 signed by RSA * Allowing BLESS lambda to accept ed25519 keys, completing https://gith… (Netflix#74) * Allowing BLESS lambda to accept ed25519 keys, completing Netflix#71 . Thanks @jnewbigin . * Moving BLESS to python 3.6. (Netflix#75) * Moving BLESS to python 3.6. You just need to rebuild, publish, and switch your lambda runtime from 2.7 to 3.6. * Moving TravisCI to Python3.6 as well. * bless_client.py: fix argv unpacking when using a kmsauth token (Netflix#63) * Add the FileSync flag to the zip command (Netflix#76) * Make lambda_configs dir optional for publish make target (Netflix#69) * Adding a blacklisted remote_usernames option. This would prevent particular SSH Authorized Principals from being included in a BLESS certificate. * Refactored BLESS to cache KMS decrypt results for the ca private key password. * Bumping to Release v.0.3.0 Features include: Python 3.6 Lambda support Caching of the KMS decrypted CA Private Key Password. Compressed CA Private Key support, allowing RSA 4096 keys to be set in the Lambda Environment. Issue certificates for ED25519 public keys (RSA CA). New option to validate the remote username against the IAM groups of the calling user. Updated dependencies.
- Loading branch information
Showing
38 changed files
with
840 additions
and
207 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 |
---|---|---|
|
@@ -7,3 +7,6 @@ htmlcov/ | |
libs/ | ||
publish/ | ||
venv/ | ||
aws_lambda_libs/ | ||
lambda_configs/ | ||
.pytest_cache/ |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ addons: | |
|
||
matrix: | ||
include: | ||
- python: "2.7" | ||
- python: "3.6" | ||
|
||
install: | ||
- pip install coveralls | ||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
from __future__ import absolute_import, division, print_function | ||
|
||
__all__ = [ | ||
"__title__", "__summary__", "__uri__", "__version__", "__author__", | ||
"__email__", "__license__", "__copyright__", | ||
|
@@ -11,7 +9,7 @@ | |
"sign SSH public keys.") | ||
__uri__ = "https://github.com/Netflix/bless" | ||
|
||
__version__ = "0.2.0" | ||
__version__ = "0.3.0" | ||
|
||
__author__ = "The BLESS developers" | ||
__email__ = "[email protected]" | ||
|
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
Empty file.
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,44 @@ | ||
import base64 | ||
import os | ||
|
||
import boto3 | ||
from bless.config.bless_config import BlessConfig | ||
from botocore.exceptions import ClientError | ||
|
||
|
||
class BlessLambdaCache: | ||
region = None | ||
config = None | ||
ca_private_key_password = None | ||
ca_private_key_password_error = None | ||
|
||
def __init__(self, ca_private_key_password=None, | ||
config_file=None): | ||
""" | ||
:param ca_private_key_password: For local testing, if the password is provided, skip the KMS | ||
decrypt. | ||
:param config_file: The config file to load the SSH CA private key from, and additional settings. | ||
""" | ||
# AWS Region determines configs related to KMS | ||
if 'AWS_REGION' in os.environ: | ||
self.region = os.environ['AWS_REGION'] | ||
else: | ||
self.region = 'us-west-2' | ||
|
||
# Load the deployment config values | ||
self.config = BlessConfig(self.region, config_file=config_file) | ||
|
||
password_ciphertext_b64 = self.config.getpassword() | ||
|
||
# decrypt ca private key password | ||
if ca_private_key_password is None: | ||
kms_client = boto3.client('kms', region_name=self.region) | ||
try: | ||
ca_password = kms_client.decrypt( | ||
CiphertextBlob=base64.b64decode(password_ciphertext_b64)) | ||
self.ca_private_key_password = ca_password['Plaintext'] | ||
except ClientError as e: | ||
self.ca_private_key_password_error = str(e) | ||
else: | ||
self.ca_private_key_password = ca_private_key_password |
Oops, something went wrong.