Skip to content

Commit

Permalink
Fix #2 - Adjust project structure and introduce pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeacom committed Feb 24, 2022
1 parent 7c2c6af commit ddf6b64
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 5 deletions.
126 changes: 126 additions & 0 deletions .gitignore
@@ -0,0 +1,126 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
7 changes: 3 additions & 4 deletions cloudsaga.py → cloudsaga/cloudsaga.py
@@ -1,17 +1,16 @@
#!/usr/bin/env python3
#// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#// SPDX-License-Identifier: Apache-2.0
# AWS CloudSaga - Simulate security events in AWS
# Joshua "DozerCat" McKiddy - Customer Incident Response Team (CIRT) - AWS


import logging
import boto3
import time
import datetime
import argparse
from botocore.exceptions import ClientError
from datetime import timezone
from scenarios import iam_credentials, imds_reveal, mining_bitcoin, network_changes, public_resources
from .scenarios import iam_credentials, imds_reveal, mining_bitcoin, network_changes, public_resources


current_date = datetime.datetime.now(tz=timezone.utc)
Expand Down Expand Up @@ -157,4 +156,4 @@ def main():


if __name__ == '__main__':
main()
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -21,7 +21,7 @@


sts = boto3.client('sts')
region = os.environ['AWS_REGION']
region = os.environ.get('AWS_REGION', 'us-east-1')


region_list = ['af-south-1', 'ap-east-1', 'ap-south-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-north-1', 'eu-south-1', 'me-south-1', 'sa-east-1', 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2']
Expand Down
120 changes: 120 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions pyproject.toml
@@ -0,0 +1,29 @@
[tool.poetry]
name = "cloudsaga"
version = "1.0.0"
description = "AWS CloudSaga is a tool to test security controls and alerts within their Amazon Web Services (AWS) environment"
readme = "README.md"
repository = "https://github.com/awslabs/aws-cloudsaga"

authors = ["Joshua McKiddy"]
include = [
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.md",
"LICENSE",
"NOTICE",
"README.md",
"THIRD-PARTY",
]

[tool.poetry.dependencies]
python = "^3.9"
boto3 = "^1.21.7"

[tool.poetry.dev-dependencies]

[tool.poetry.scripts]
cloudsaga = "cloudsaga.cloudsaga:main"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit ddf6b64

Please sign in to comment.