├── .gitignore ├── LICENSE.md ├── README.md ├── jenganizer ├── __init__.py └── jenganizer.py ├── requirements.txt ├── setup.cfg └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pdm 86 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 87 | #pdm.lock 88 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 89 | # in version control. 90 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 91 | .pdm.toml 92 | .pdm-python 93 | .pdm-build/ 94 | 95 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 96 | __pypackages__/ 97 | 98 | # Celery stuff 99 | celerybeat-schedule 100 | celerybeat.pid 101 | 102 | # SageMath parsed files 103 | *.sage.py 104 | 105 | # Environments 106 | .env 107 | .venv 108 | env/ 109 | venv/ 110 | ENV/ 111 | env.bak/ 112 | venv.bak/ 113 | 114 | # Spyder project settings 115 | .spyderproject 116 | .spyproject 117 | 118 | # Rope project settings 119 | .ropeproject 120 | 121 | # mkdocs documentation 122 | /site 123 | 124 | # mypy 125 | .mypy_cache/ 126 | .dmypy.json 127 | dmypy.json 128 | 129 | # Pyre type checker 130 | .pyre/ 131 | 132 | # pytype static type analyzer 133 | .pytype/ 134 | 135 | # Cython debug symbols 136 | cython_debug/ 137 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2021 Ermetic.com Inc. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jenganizer - Hidden Service Revealer for AWS 2 | Jenganizer is a tool to map hidden services in AWS. It does this by following the triggered events of a user's actions. 3 | When a user performs an action in AWS, it can trigger other events in other services. By following these events, users 4 | can identify services that are indirectly deployed by their actions. This can be important, as these resources can 5 | present security risks which should be managed and controlled. 6 | 7 | ## Installation 8 | ### Install 9 | You can install the package from pypi.org 10 | ```bash 11 | pip install jenganizer 12 | ``` 13 | 14 | ## Usage 15 | 16 | ```bash 17 | jenganizer --help 18 | ``` 19 | 20 | ``` 21 | Usage: jenganizer [OPTIONS] 22 | 23 | Options: 24 | --username TEXT The username to filter events by [required] 25 | --profile-name TEXT The AWS profile name to use 26 | --region-name TEXT The AWS region name to use 27 | --time-start TEXT The start time for the event filter, format: YYYY-MM-DD 28 | HH:MM:SS+00:00 29 | --time-end TEXT The end time for the event filter, format: YYYY-MM-DD 30 | HH:MM:SS+00:00 31 | --time-span TEXT The time span, in minutes, to filter, going back from 32 | now (use this instead of time_start and time_end) 33 | -d, --depth INTEGER The depth of triggered events to follow. Depth=0: only 34 | initial calls by the user, Depth=1: initial calls and 35 | calls triggered by the initial calls, etc. 36 | -o, --output TEXT The output file to write the triggered events to 37 | -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG 38 | --help Show this message and exit. 39 | 40 | 41 | ``` 42 | 43 | The way to map hidden services is to perform the initial call to the service with a specific user for the action you 44 | want to map, `jenganizer` will then follow the triggered events to find the resource indirectly deployed to other services. 45 | 46 | In order to zoom in on the right events, you can use the `--time-start` and `--time-end`, or `--time-span`. 47 | 48 | ### The depth parameter 49 | The `--depth` parameter is used to specify how many levels of triggered events to follow. Level 0 only looks at events 50 | called directly from the user, level 1 looks at events called by the user and events called by the services used 51 | by those events. Such an examination naturally highlights some false positive, so it is important to verify the results. 52 | 53 | ### Results 54 | The results are printed to the console as a list of events, and a file 55 | (default name: `triggered_events.json`) is written with the full events. 56 | These events can be used to identify hidden services in AWS. 57 | 58 | 59 | -------------------------------------------------------------------------------- /jenganizer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tenable/hidden-services-revealer/44aa952d69eedc16c3eb148c37992f994fe3d9de/jenganizer/__init__.py -------------------------------------------------------------------------------- /jenganizer/jenganizer.py: -------------------------------------------------------------------------------- 1 | # 3 Layers 3 filters 2 | from itertools import tee 3 | from pprint import * 4 | from typing import List, Generator 5 | 6 | import boto3 7 | from datetime import datetime, timedelta 8 | import json 9 | import click 10 | import click_log 11 | import logging 12 | import colorlog 13 | 14 | logger = logging.getLogger("jengnizer") 15 | 16 | 17 | def _initialize_logger() -> None: 18 | click_log.basic_config(logger) 19 | root_handler = logger.handlers[0] 20 | formatter = colorlog.ColoredFormatter( 21 | "%(log_color)s[%(asctime)s,%(msecs)d %(levelname)-8s" 22 | " %(filename)s:%(lineno)d - %(funcName)20s()]%(reset)s" 23 | " %(white)s%(message)s", 24 | datefmt="%H:%M:%S", 25 | reset=True, 26 | log_colors={ 27 | "DEBUG": "blue", 28 | "INFO": "green", 29 | "WARNING": "yellow", 30 | "ERROR": "red", 31 | "CRITICAL": "red", 32 | }, 33 | ) 34 | root_handler.setFormatter(formatter) 35 | 36 | 37 | _initialize_logger() 38 | 39 | 40 | def is_read_only_event(cloudtrail_event: dict) -> bool: 41 | event_name = cloudtrail_event.get("eventName") 42 | # filter out verbs get, list, describe 43 | if ( 44 | event_name.startswith("Get") 45 | or event_name.startswith("List") 46 | or event_name.startswith("Describe") 47 | ): 48 | return True 49 | return False 50 | 51 | 52 | def paginate_cloudtrail_events( 53 | cloudtrail_client: boto3.client, 54 | start_time: datetime, 55 | end_time: datetime, 56 | lookup_attributes: List[dict] = None, 57 | ) -> Generator[dict, None, None]: 58 | """ 59 | This function paginates through CloudTrail events for a given time range 60 | and filters by provided lookup attributes (optional). 61 | 62 | Args: 63 | cloudtrail_client (CloudTrailClient): A boto3 client for CloudTrail. 64 | start_time (datetime): The start time for the event lookup. 65 | end_time (datetime): The end time for the event lookup. 66 | lookup_attributes (List[dict], optional): A list of dictionaries representing 67 | lookup attributes for filtering events. 68 | Defaults to None (no filters). 69 | 70 | Yields: 71 | Generator[dict, None, None]: A generator yielding CloudTrail events for each page. 72 | """ 73 | 74 | paginator = cloudtrail_client.get_paginator("lookup_events") 75 | starting_token = None 76 | 77 | # Handle potential absence of lookup attributes 78 | if not lookup_attributes: 79 | lookup_attributes = [] 80 | 81 | for page in paginator.paginate( 82 | StartTime=start_time, 83 | EndTime=end_time, 84 | LookupAttributes=lookup_attributes, 85 | PaginationConfig={"StartingToken": starting_token}, 86 | ): 87 | for event in page["Events"]: 88 | yield event 89 | starting_token = page.get("NextToken") 90 | if not starting_token: 91 | break 92 | 93 | 94 | def is_triggered_event(event: dict, event_sources: list) -> bool: 95 | return ( 96 | event.get("sourceIPAddress") in event_sources 97 | or event.get("userIdentity", {}).get("invokedBy") in event_sources 98 | ) 99 | 100 | 101 | def get_event_name(cloudtrail_event): 102 | return f"{cloudtrail_event.get('eventSource').split('.')[0]}:{cloudtrail_event.get('eventName')}" 103 | 104 | 105 | def filter_triggered_events( 106 | username: str, 107 | profile_name: str, 108 | region_name: str, 109 | time_start: datetime, 110 | time_end: datetime, 111 | depth: int = 0, 112 | output_file: str = "triggered_events.json", 113 | event_sources: list = [], 114 | ): 115 | # Create a session using your AWS credentials 116 | session = boto3.Session(profile_name=profile_name, region_name=region_name) 117 | 118 | # Create CloudTrail client 119 | cloudtrail = session.client("cloudtrail") 120 | fd = open(output_file, "w") 121 | # Get event history 122 | cloudtrail_paginated_events = paginate_cloudtrail_events( 123 | cloudtrail, 124 | time_start, 125 | time_end, 126 | lookup_attributes=[{"AttributeKey": "ReadOnly", "AttributeValue": "false"}], 127 | ) 128 | username_filtered_events = [] 129 | filtered_event_names = [] 130 | 131 | for event in cloudtrail_paginated_events: 132 | # filter by username 133 | cloudtrail_event = json.loads(event["CloudTrailEvent"]) 134 | event_username = ( 135 | cloudtrail_event["userIdentity"].get("principalId", "").split(":")[-1] 136 | ) 137 | logger.debug(f"Event username: {event_username}") 138 | if event_username is not None and event_username == username: 139 | username_filtered_events.append(cloudtrail_event) 140 | event_sources.append(cloudtrail_event.get("eventSource")) 141 | logger.debug( 142 | f"Service: {cloudtrail_event.get('eventSource')}, Event: {cloudtrail_event.get('eventName')}" 143 | ) 144 | filtered_event_names.append(get_event_name(cloudtrail_event)) 145 | json.dump(cloudtrail_event, fd) 146 | fd.write("\n") 147 | for i in range(depth): 148 | cloudtrail_paginated_events = paginate_cloudtrail_events( 149 | cloudtrail, 150 | time_start, 151 | time_end, 152 | lookup_attributes=[{"AttributeKey": "ReadOnly", "AttributeValue": "false"}], 153 | ) 154 | for event in cloudtrail_paginated_events: 155 | cloudtrail_event = json.loads(event["CloudTrailEvent"]) 156 | if is_triggered_event(cloudtrail_event, event_sources): 157 | # if the event source is not in the list of event sources triggered by the user, add it 158 | if cloudtrail_event.get("eventSource") not in event_sources: 159 | event_sources.append(cloudtrail_event.get("eventSource")) 160 | logger.debug( 161 | f"Service: {cloudtrail_event.get('eventSource')}, Event: {cloudtrail_event.get('eventName')}" 162 | ) 163 | filtered_event_names.append(get_event_name(cloudtrail_event)) 164 | json.dump(cloudtrail_event, fd) 165 | fd.write("\n") 166 | pprint(set(filtered_event_names)) 167 | fd.close() 168 | 169 | 170 | @click.command() 171 | @click.option("--username", help="The username to filter events by", required=True) 172 | @click.option("--profile-name", help="The AWS profile name to use", default=None) 173 | @click.option("--region-name", help="The AWS region name to use", default="us-east-1") 174 | @click.option( 175 | "--time-start", 176 | help="The start time for the event filter, format: YYYY-MM-DD HH:MM:SS+00:00", 177 | ) 178 | @click.option( 179 | "--time-end", 180 | help="The end time for the event filter, format: YYYY-MM-DD HH:MM:SS+00:00", 181 | ) 182 | @click.option( 183 | "--time-span", 184 | help="The time span, in minutes, to filter, going back from now " 185 | "(use this instead of time_start and time_end)", 186 | ) 187 | @click.option( 188 | "--depth", '-d', 189 | help="The depth of triggered events to follow. " 190 | "Depth=0: only initial calls by the user, " 191 | "Depth=1: initial calls and calls triggered by the initial calls, etc.", 192 | default=0, 193 | ) 194 | @click.option( 195 | "--output", '-o', 196 | help="The output file to write the triggered events to", 197 | default="triggered_events.json", 198 | ) 199 | @click_log.simple_verbosity_option(logger) 200 | def cli( 201 | username: str, 202 | profile_name: str, 203 | region_name: str = "us-east-1", 204 | time_start: str = "", 205 | time_end: str = "", 206 | time_span: str = "", 207 | depth: int = 0, 208 | output: str = "triggered_events.json" 209 | ) -> None: 210 | # if the command is run without any arguments, print the help message 211 | if not any([username, profile_name, region_name, time_start, time_end, time_span]): 212 | click.echo(click.get_current_context().get_help()) 213 | return 214 | 215 | time_start_datetime = None 216 | time_end_datetime = None 217 | 218 | if time_span: 219 | if time_start or time_end: 220 | logger.error( 221 | "You must not provide time_span and time_start/time_end together" 222 | ) 223 | return 224 | 225 | time_start_datetime = datetime.now() - timedelta(minutes=float(time_span)) 226 | time_end_datetime = datetime.now() 227 | logger.info(f"Time start: {time_start_datetime}, Time end: {time_end}") 228 | 229 | elif time_end and not time_start: 230 | logger.error("You must provide time_start if you provide time_end") 231 | return 232 | 233 | elif time_start: 234 | if not time_end: 235 | time_end = datetime.now() 236 | time_start_datetime = datetime.fromisoformat(time_start) 237 | time_end_datetime = datetime.fromisoformat(time_end) 238 | logger.info(f"Time start: {time_start}, Time end: {time_end}") 239 | 240 | filter_triggered_events( 241 | username, 242 | profile_name, 243 | region_name, 244 | time_start_datetime, 245 | time_end_datetime, 246 | depth, 247 | output 248 | ) 249 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | setuptools~=68.2.0 2 | boto3~=1.34.86 3 | click~=8.1.7 4 | colorlog~=6.8.2 5 | jenganizer~=0.1 -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = jenganizer 3 | version = 0.1.1 4 | author = Tenable Inc. 5 | author_email = cs.research+opensource@tenable.com 6 | description = Jenganizer is a tool to map hidden services in AWS. It does this by following the triggered events of a user's actions. When a user performs an action in AWS, it can trigger other events in other services. By following these events, users can identify services that are indirectly deployed by their actions. This can be important, as these resources can present security risks which should be managed and controlled. 7 | long_description = file: README.md 8 | long_description_content_type = text/markdown 9 | url = https://github.com/tenable/hidden-services-revealer 10 | project_urls = 11 | Bug Tracker = https://github.com/tenable/hidden-services-revealer/issues 12 | classifiers = 13 | Programming Language :: Python :: 3 14 | License :: OSI Approved :: Apache Software License 15 | Operating System :: OS Independent 16 | 17 | [options] 18 | packages = find: 19 | python_requires = >=3.8 20 | include_package_data = True 21 | install_requires = 22 | setuptools~=68.2.0 23 | boto3~=1.34.86 24 | click~=8.1.7 25 | click-log~=0.3.2 26 | colorlog~=6.8.2 27 | jenganizer~=0.1 28 | 29 | [options.entry_points] 30 | console_scripts= 31 | jenganizer=jenganizer.jenganizer:cli -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | name="jenganizer", 5 | version="0.1.1", 6 | packages=find_packages(), 7 | install_requires=[ 8 | "boto3", 9 | "click", 10 | "click-log", 11 | "colorlog" 12 | ], 13 | entry_points={ 14 | "console_scripts": [ 15 | "jenganizer = jenganizer.jenganizer:cli", 16 | ], 17 | }, 18 | ) 19 | --------------------------------------------------------------------------------