From 50472cce4f48e697859e625f3ac37d636fd5d2e4 Mon Sep 17 00:00:00 2001 From: Nick <49166439+nhakmiller@users.noreply.github.com> Date: Mon, 22 Mar 2021 14:52:42 -0700 Subject: [PATCH] Update profile logic (#86) * update profile logic * version bump * update requirements --- panther_analysis_tool/main.py | 8 ++++---- requirements.txt | 24 ++++++++++++------------ setup.py | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/panther_analysis_tool/main.py b/panther_analysis_tool/main.py index bb7d9d40..4d19ac7a 100644 --- a/panther_analysis_tool/main.py +++ b/panther_analysis_tool/main.py @@ -262,13 +262,13 @@ def upload_analysis(args: argparse.Namespace) -> Tuple[int, str]: if return_code == 1: return return_code, "" + client = boto3.client("lambda") # optionally set env variable for profile passed as argument # this must be called prior to setting up the client if args.aws_profile is not None: logging.info("Using AWS profile: %s", args.aws_profile) - set_env("AWS_PROFILE", args.aws_profile) - - client = boto3.client("lambda") + session = boto3.Session(profile_name=args.aws_profile) + client = session.client("lambda") with open(archive, "rb") as analysis_zip: zip_bytes = analysis_zip.read() @@ -977,7 +977,7 @@ def setup_parser() -> argparse.ArgumentParser: + "managing Panther policies and rules.", prog="panther_analysis_tool", ) - parser.add_argument("--version", action="version", version="panther_analysis_tool 0.5.0") + parser.add_argument("--version", action="version", version="panther_analysis_tool 0.5.1") parser.add_argument("--debug", action="store_true", dest="debug") subparsers = parser.add_subparsers() diff --git a/requirements.txt b/requirements.txt index 199dbb0c..add34364 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # functional dependencies -boto3==1.17.29 +boto3==1.17.34 jsonpath-ng==1.5.2 requests==2.25.1 ruamel.yaml==0.16.13 @@ -8,7 +8,7 @@ semver==2.13.0 # ci dependencies bandit==1.7.0 black==20.8b1 -isort==5.7.0 +isort==5.8.0 mypy==0.812 pylint==2.7.2 pyfakefs==4.4.0 @@ -17,34 +17,34 @@ PyYAML==5.4.1 ## The following requirements were added by pip freeze: appdirs==1.4.4 astroid==2.5.1 -botocore==1.20.29 +botocore==1.20.34 certifi==2020.12.5 chardet==4.0.0 click==7.1.2 contextlib2==0.6.0.post1 decorator==4.4.2 gitdb==4.0.5 -GitPython==3.1.14 +GitPython==3.1.11 idna==2.10 -importlib-metadata==3.7.0 +importlib-metadata==3.3.0 jmespath==0.10.0 -lazy-object-proxy==1.5.2 +lazy-object-proxy==1.4.3 mccabe==0.6.1 mypy-extensions==0.4.3 -panther-analysis-tool==0.3.5 pathspec==0.8.1 pbr==5.5.1 ply==3.11 python-dateutil==2.8.1 regex==2020.11.13 ruamel.yaml.clib==0.2.2 -s3transfer==0.3.4 +s3transfer==0.3.3 six==1.15.0 -smmap==3.0.5 +smmap==3.0.4 stevedore==3.3.0 toml==0.10.2 -typed-ast==1.4.2 +typed-ast==1.4.1 typing-extensions==3.7.4.3 -urllib3==1.26.4 +urllib3==1.26.2 wrapt==1.12.1 -zipp==3.4.1 +yapf==0.30.0 +zipp==3.4.0 diff --git a/setup.py b/setup.py index c6cbf31d..9e5ee877 100644 --- a/setup.py +++ b/setup.py @@ -2,14 +2,14 @@ setup( name='panther_analysis_tool', packages=['panther_analysis_tool'], - version='0.5.0', + version='0.5.1', license='AGPL-3.0', description= 'Panther command line interface for writing, testing, and packaging policies/rules.', author='Panther Labs Inc', author_email='pypi@runpanther.io', url='https://github.com/panther-labs/panther_analysis_tool', - download_url = 'https://github.com/panther-labs/panther_analysis_tool/archive/v0.5.0.tar.gz', + download_url = 'https://github.com/panther-labs/panther_analysis_tool/archive/v0.5.1.tar.gz', keywords=['Security', 'CLI'], scripts=['bin/panther_analysis_tool'], install_requires=[