withsecurelabs / leonidas Goto Github PK
View Code? Open in Web Editor NEWAutomated Attack Simulation in the Cloud, complete with detection use cases.
License: MIT License
Automated Attack Simulation in the Cloud, complete with detection use cases.
License: MIT License
Describe the solution you'd like
Add support for Microsoft Azure
Requirements
Describe the bug
CodeBuild deployment stage failed
To Reproduce
I copy-pasted commands in the documentation. I'm running as an administrator user in a sandbox AWS account.
Expected behavior
The infrastructure is deployed
[Container] 2022/01/20 14:42:54 Waiting for agent ping
[Container] 2022/01/20 14:42:58 Waiting for DOWNLOAD_SOURCE
[Container] 2022/01/20 14:42:58 Phase is DOWNLOAD_SOURCE
[Container] 2022/01/20 14:42:58 CODEBUILD_SRC_DIR=/codebuild/output/src383416348/src
[Container] 2022/01/20 14:42:58 YAML location is /codebuild/output/src383416348/src/buildspec.yml
[Container] 2022/01/20 14:42:58 Processing environment variables
[Container] 2022/01/20 14:42:58 Selecting 'python' runtime version '3.7' based on manual selections...
[Container] 2022/01/20 14:42:58 Selecting 'nodejs' runtime version '10' based on manual selections...
[Container] 2022/01/20 14:42:58 Running command echo "Installing Node.js version 10 ..."
Installing Node.js version 10 ...
[Container] 2022/01/20 14:42:58 Running command n $NODE_10_VERSION
installed : v10.19.0 (with npm 6.13.4)
[Container] 2022/01/20 14:43:03 Running command echo "Installing Python version 3.7 ..."
Installing Python version 3.7 ...
[Container] 2022/01/20 14:43:03 Running command pyenv global $PYTHON_37_VERSION
[Container] 2022/01/20 14:43:06 Moving to directory /codebuild/output/src383416348/src
[Container] 2022/01/20 14:43:06 Configuring ssm agent with target id: codebuild:e26419f7-1e47-47ba-b343-c70de876f566
[Container] 2022/01/20 14:43:06 Successfully updated ssm agent configuration
[Container] 2022/01/20 14:43:06 Registering with agent
[Container] 2022/01/20 14:43:06 Phases found in YAML: 3
[Container] 2022/01/20 14:43:06 PRE_BUILD: 3 commands
[Container] 2022/01/20 14:43:06 BUILD: 5 commands
[Container] 2022/01/20 14:43:06 INSTALL: 4 commands
[Container] 2022/01/20 14:43:06 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
[Container] 2022/01/20 14:43:06 Phase context status code: Message:
[Container] 2022/01/20 14:43:06 Entering phase INSTALL
[Container] 2022/01/20 14:43:06 Running command npm install --global serverless
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>. Thanks to @shadowgate15, @spence-s, and @niftylettuce. Superagent is sponsored by Forward Email at <https://forwardemail.net>.
npm WARN deprecated [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
/usr/local/bin/serverless -> /usr/local/lib/node_modules/serverless/bin/serverless.js
/usr/local/bin/sls -> /usr/local/lib/node_modules/serverless/bin/serverless.js
> [email protected] install /usr/local/lib/node_modules/serverless/node_modules/snappy
> prebuild-install || node-gyp rebuild
prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/10.19.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/serverless/node_modules/snappy/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/serverless/node_modules/snappy/.node-gyp'
gyp ERR! System Linux 4.14.256-197.484.amzn2.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/serverless/node_modules/snappy
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
> [email protected] postinstall /usr/local/lib/node_modules/serverless/node_modules/protobufjs
> node scripts/postinstall
> [email protected] postinstall /usr/local/lib/node_modules/serverless
> node ./scripts/postinstall.js
┌────────────────────────────────────────────────────────────────────────────┐
│ │
│ Serverless Framework successfully installed! │
│ │
│ To start your first project run “serverless”. │
│ │
│ Turn on automatic updates by running “serverless config --autoupdate”. │
│ │
└────────────────────────────────────────────────────────────────────────────┘
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/serverless/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/serverless/node_modules/snappy):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `prebuild-install || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ [email protected]
added 597 packages from 409 contributors in 26.173s
[Container] 2022/01/20 14:43:32 Running command pip install poetry
Collecting poetry
Downloading https://files.pythonhosted.org/packages/81/66/0eb0022ca0e2cf05513527ba4a1be11db154b23b858d40bc5f9280ac239d/poetry-1.1.12-py2.py3-none-any.whl (175kB)
Collecting keyring<22.0.0,>=21.2.0; python_version >= "3.6" and python_version < "4.0"
Downloading https://files.pythonhosted.org/packages/d0/a0/20e656cd1e2313af619e382782bd47b5f77a3f33d81992554f3aac56e90d/keyring-21.8.0-py3-none-any.whl
Collecting html5lib<2.0,>=1.0
Downloading https://files.pythonhosted.org/packages/6c/dd/a834df6482147d48e225a49515aabc28974ad5a4ca3215c18a882565b028/html5lib-1.1-py2.py3-none-any.whl (112kB)
Collecting cleo<0.9.0,>=0.8.1
Downloading https://files.pythonhosted.org/packages/09/46/3577da4237675e90630e8e9ccd2c7dbcd42afd4463712a207eab148dfbc2/cleo-0.8.1-py2.py3-none-any.whl
Collecting cachecontrol[filecache]<0.13.0,>=0.12.9; python_version >= "3.6" and python_version < "4.0"
Downloading https://files.pythonhosted.org/packages/d3/39/b7cd9ef1be03ac33e71f76837a23d59842b016e5159cf5aff30c0b340907/CacheControl-0.12.10-py2.py3-none-any.whl
Collecting requests-toolbelt<0.10.0,>=0.9.1
Downloading https://files.pythonhosted.org/packages/60/ef/7681134338fc097acef8d9b2f8abe0458e4d87559c689a8c306d0957ece5/requests_toolbelt-0.9.1-py2.py3-none-any.whl (54kB)
Collecting shellingham<2.0,>=1.1
Downloading https://files.pythonhosted.org/packages/76/94/7a764d57d0f46534e0022e651da6547bc5cfe7b6372e7e0ed1dde6f5cb67/shellingham-1.4.0-py2.py3-none-any.whl
Collecting crashtest<0.4.0,>=0.3.0; python_version >= "3.6" and python_version < "4.0"
Downloading https://files.pythonhosted.org/packages/76/97/2a99f020be5e4a5a97ba10bc480e2e6a889b5087103a2c6b952b5f819d27/crashtest-0.3.1-py3-none-any.whl
Collecting clikit<0.7.0,>=0.6.2
Downloading https://files.pythonhosted.org/packages/f2/3d/4394c710b9195b83382dc67bdd1040e5ebfc3fc8df90e20fe74341298c57/clikit-0.6.2-py2.py3-none-any.whl (91kB)
Collecting tomlkit<1.0.0,>=0.7.0
Downloading https://files.pythonhosted.org/packages/2d/36/b17811aa7c17609eaa68a91e15e6b2e56bf4d5d5a3c43d53c2b46728e6b2/tomlkit-0.8.0-py3-none-any.whl
Collecting pkginfo<2.0,>=1.4
Downloading https://files.pythonhosted.org/packages/cd/00/49f59cdd2c6a52e6665fda4de671dac5614366dc827e050c55428241b929/pkginfo-1.8.2-py2.py3-none-any.whl
Requirement already satisfied: requests<3.0,>=2.18 in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from poetry) (2.23.0)
Collecting virtualenv<21.0.0,>=20.0.26
Downloading https://files.pythonhosted.org/packages/ef/a1/4e1700f25211b3851e6be6675061e0c8eae7585d80177a40e9b02d1105d8/virtualenv-20.13.0-py2.py3-none-any.whl (6.5MB)
Collecting poetry-core<1.1.0,>=1.0.7
Downloading https://files.pythonhosted.org/packages/09/79/5ab16fbf2d9354c242e9f9e784d604dd06842405f7797e71238f3c053200/poetry_core-1.0.7-py2.py3-none-any.whl (424kB)
Collecting cachy<0.4.0,>=0.3.0
Downloading https://files.pythonhosted.org/packages/82/e6/badd9af6feee43e76c3445b2621a60d3d99fe0e33fffa8df43590212ea63/cachy-0.3.0-py2.py3-none-any.whl
Requirement already satisfied: importlib-metadata<2.0.0,>=1.6.0; python_version < "3.8" in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from poetry) (1.6.0)
Collecting packaging<21.0,>=20.4
Downloading https://files.pythonhosted.org/packages/3e/89/7ea760b4daa42653ece2380531c90f64788d979110a2ab51049d92f408af/packaging-20.9-py2.py3-none-any.whl (40kB)
Collecting pexpect<5.0.0,>=4.7.0
Downloading https://files.pythonhosted.org/packages/39/7b/88dbb785881c28a102619d46423cb853b46dbccc70d3ac362d99773a78ce/pexpect-4.8.0-py2.py3-none-any.whl (59kB)
Collecting SecretStorage>=3.2; sys_platform == "linux"
Downloading https://files.pythonhosted.org/packages/d9/1e/29cd69fdac7391aa51510dfd42aa70b4e6a826c8cd019ee2a8ab9ec0777f/SecretStorage-3.3.1-py3-none-any.whl
Collecting jeepney>=0.4.2; sys_platform == "linux"
Downloading https://files.pythonhosted.org/packages/14/b8/bb3e34d71472140f9bfdf5d77cd063e2cc964b72b1bb0b70fe3c1e7db932/jeepney-0.7.1-py3-none-any.whl (54kB)
Collecting webencodings
Downloading https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl
Requirement already satisfied: six>=1.9 in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from html5lib<2.0,>=1.0->poetry) (1.14.0)
Collecting msgpack>=0.5.2
Downloading https://files.pythonhosted.org/packages/9e/db/073d1f269dc5bd46b13277fa934d13caa4fd8dee0b78c9cc5dbe3604ba4c/msgpack-1.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (299kB)
Collecting lockfile>=0.9; extra == "filecache"
Downloading https://files.pythonhosted.org/packages/c8/22/9460e311f340cb62d26a38c419b1381b8593b0bb6b5d1f056938b086d362/lockfile-0.12.2-py2.py3-none-any.whl
Collecting pastel<0.3.0,>=0.2.0
Downloading https://files.pythonhosted.org/packages/aa/18/a8444036c6dd65ba3624c63b734d3ba95ba63ace513078e1580590075d21/pastel-0.2.1-py2.py3-none-any.whl
Collecting pylev<2.0,>=1.3
Downloading https://files.pythonhosted.org/packages/04/78/95cfe72991d22994f0ec5a3b742b31c95a28344d33e06b69406b68398a29/pylev-1.4.0-py2.py3-none-any.whl
Requirement already satisfied: chardet<4,>=3.0.2 in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (2.9)
Requirement already satisfied: certifi>=2017.4.17 in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (2020.4.5.1)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from requests<3.0,>=2.18->poetry) (1.25.9)
Collecting platformdirs<3,>=2
Downloading https://files.pythonhosted.org/packages/9f/3d/4606ee54e0af98aa8f9a672b5acfd69318a5917fbb9f8e2c3aaf9c2f293f/platformdirs-2.4.1-py3-none-any.whl
Collecting filelock<4,>=3.2
Downloading https://files.pythonhosted.org/packages/ca/6c/ab2f79146ca546875e2a633d21e968acc17042ce88e4413b340541f0d4c5/filelock-3.4.2-py3-none-any.whl
Collecting distlib<1,>=0.3.1
Downloading https://files.pythonhosted.org/packages/ac/a3/8ee4f54d5f12e16eeeda6b7df3dfdbda24e6cc572c86ff959a4ce110391b/distlib-0.3.4-py2.py3-none-any.whl (461kB)
Requirement already satisfied: zipp>=0.5 in /root/.pyenv/versions/3.7.6/lib/python3.7/site-packages (from importlib-metadata<2.0.0,>=1.6.0; python_version < "3.8"->poetry) (3.1.0)
Collecting pyparsing>=2.0.2
Downloading https://files.pythonhosted.org/packages/a0/34/895006117f6fce0b4de045c87e154ee4a20c68ec0a4c9a36d900888fb6bc/pyparsing-3.0.6-py3-none-any.whl (97kB)
Collecting ptyprocess>=0.5
Downloading https://files.pythonhosted.org/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl
Collecting cryptography>=2.0
Downloading https://files.pythonhosted.org/packages/a7/9f/a725c8f434d24ae656b61539b3c3d22325e8b65331c3f8f943c4cf8858d4/cryptography-36.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8MB)
Collecting cffi>=1.12
Downloading https://files.pythonhosted.org/packages/44/6b/5edf93698ef1dc745774e47e26f5995040dd3604562dd63f5959fcd3a49e/cffi-1.15.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (427kB)
Collecting pycparser
Downloading https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl (118kB)
ERROR: aws-sam-cli 0.48.0 has requirement tomlkit==0.5.8, but you'll have tomlkit 0.8.0 which is incompatible.
ERROR: poetry-core 1.0.7 has requirement importlib-metadata<2.0.0,>=1.7.0; python_version >= "2.7" and python_version < "2.8" or python_version >= "3.5" and python_version < "3.8", but you'll have importlib-metadata 1.6.0 which is incompatible.
Installing collected packages: jeepney, pycparser, cffi, cryptography, SecretStorage, keyring, webencodings, html5lib, pastel, crashtest, pylev, clikit, cleo, msgpack, lockfile, cachecontrol, requests-toolbelt, shellingham, tomlkit, pkginfo, platformdirs, filelock, distlib, virtualenv, poetry-core, cachy, pyparsing, packaging, ptyprocess, pexpect, poetry
Found existing installation: tomlkit 0.5.8
Uninstalling tomlkit-0.5.8:
Successfully uninstalled tomlkit-0.5.8
Found existing installation: filelock 3.0.12
Uninstalling filelock-3.0.12:
Successfully uninstalled filelock-3.0.12
Found existing installation: distlib 0.3.0
Uninstalling distlib-0.3.0:
Successfully uninstalled distlib-0.3.0
Found existing installation: virtualenv 20.0.18
Uninstalling virtualenv-20.0.18:
Successfully uninstalled virtualenv-20.0.18
Successfully installed SecretStorage-3.3.1 cachecontrol-0.12.10 cachy-0.3.0 cffi-1.15.0 cleo-0.8.1 clikit-0.6.2 crashtest-0.3.1 cryptography-36.0.1 distlib-0.3.4 filelock-3.4.2 html5lib-1.1 jeepney-0.7.1 keyring-21.8.0 lockfile-0.12.2 msgpack-1.0.3 packaging-20.9 pastel-0.2.1 pexpect-4.8.0 pkginfo-1.8.2 platformdirs-2.4.1 poetry-1.1.12 poetry-core-1.0.7 ptyprocess-0.7.0 pycparser-2.21 pylev-1.4.0 pyparsing-3.0.6 requests-toolbelt-0.9.1 shellingham-1.4.0 tomlkit-0.8.0 virtualenv-20.13.0 webencodings-0.5.1
WARNING: You are using pip version 19.3.1; however, version 21.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[Container] 2022/01/20 14:43:41 Running command cd generator
[Container] 2022/01/20 14:43:41 Running command poetry install
Creating virtualenv generator-d6M9L28s-py3.7 in /root/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...
Writing lock file
Package operations: 36 installs, 0 updates, 0 removals
• Installing six (1.16.0)
• Installing typing-extensions (4.0.1)
• Installing zipp (3.7.0)
• Installing importlib-metadata (4.10.1)
• Installing markupsafe (2.0.1)
• Installing pyparsing (3.0.6)
• Installing python-dateutil (2.8.2)
• Installing pyyaml (5.4.1)
• Installing click (7.1.2)
• Installing ghp-import (2.0.2)
• Installing jinja2 (2.11.3)
• Installing lazy-object-proxy (1.7.1)
• Installing mergedeep (1.3.4)
• Installing markdown (3.3.6)
• Installing packaging (21.3)
• Installing pyyaml-env-tag (0.1)
• Installing typed-ast (1.5.1)
• Installing watchdog (2.1.6)
• Installing wrapt (1.13.3)
• Installing appdirs (1.4.4)
• Installing astroid (2.9.3)
• Installing attrs (21.4.0)
• Installing isort (5.10.1)
• Installing mccabe (0.6.1)
• Installing mkdocs (1.2.3)
• Installing mkdocs-material-extensions (1.0.3)
• Installing pathspec (0.9.0)
• Installing platformdirs (2.4.1)
• Installing pygments (2.11.2)
• Installing pymdown-extensions (9.1)
• Installing regex (2022.1.18)
• Installing toml (0.10.2)
• Installing black (19.10b0)
• Installing mkdocs-material (5.5.14)
• Installing pylint (2.12.2)
• Installing typer (0.2.1)
Installing the current project: generator (0.1.0)
[Container] 2022/01/20 14:44:32 Phase complete: INSTALL State: SUCCEEDED
[Container] 2022/01/20 14:44:32 Phase context status code: Message:
[Container] 2022/01/20 14:44:32 Entering phase PRE_BUILD
[Container] 2022/01/20 14:44:32 Running command python -m unittest discover test
/codebuild/output/src383416348/src/generator/test/test_definition_ingestion.py:24: ResourceWarning: unclosed file <_io.TextIOWrapper name='test/test_defs/basic.yml' mode='r' encoding='UTF-8'>
open(os.path.join("test", "test_defs", "basic.yml"), "r")
ResourceWarning: Enable tracemalloc to get the object allocation traceback
.
----------------------------------------------------------------------
Ran 1 test in 0.012s
OK
[Container] 2022/01/20 14:44:32 Running command poetry run python generator.py validate
validating ../definitions/credential_access/access-secrets-manager-secrets.yml
validating ../definitions/defense_evasion/add_new_guardduty_ip_set.yml
validating ../definitions/defense_evasion/cloudtrail-alter-encryption-configuration.yml
validating ../definitions/defense_evasion/cloudtrail-change-destination-bucket.yml
validating ../definitions/defense_evasion/cloudtrail-disable-global-event-logging.yml
validating ../definitions/defense_evasion/cloudtrail-disable-log-file-validation.yml
validating ../definitions/defense_evasion/cloudtrail-disable-multiregion-logging.yml
validating ../definitions/defense_evasion/cloudtrail-disable-trail.yml
validating ../definitions/defense_evasion/cloudtrail-remove-sns-topic.yml
validating ../definitions/defense_evasion/config-delete-rule.yml
validating ../definitions/defense_evasion/update_guardduty_ip_set.yml
validating ../definitions/discovery/enumerate_cloudtrail.yml
validating ../definitions/discovery/enumerate_iam_getaccountauthorizationdetails.yml
validating ../definitions/discovery/enumerate_iam_groups.yml
validating ../definitions/discovery/enumerate_iam_users.yml
validating ../definitions/discovery/enumerate_secrets_manager.yml
validating ../definitions/discovery/enumerate_vpc_flow_logs.yml
validating ../definitions/discovery/enumerate_waf_rules.yml
validating ../definitions/discovery/get_guardduty_detector.yml
validating ../definitions/discovery/get_identity.yml
validating ../definitions/discovery/list_guardduty_detectors.yml
validating ../definitions/execution/modify-lambda-function-code.yml
validating ../definitions/impact/delete-secrets-manager-secret.yml
validating ../definitions/impact/delete_iam_group.yml
validating ../definitions/impact/delete_iam_policy.yml
validating ../definitions/impact/delete_iam_role.yml
validating ../definitions/impact/delete_iam_user.yml
validating ../definitions/impact/delete_login_profile_for_iam_user.yml
validating ../definitions/persistence/add_api_key_to_iam_user.yml
validating ../definitions/persistence/add_iam_user.yml
validating ../definitions/persistence/alter_assume_role_policy_document.yml
validating ../definitions/persistence/change_current_iam_user_password.yml
validating ../definitions/persistence/create_iam_group.yml
validating ../definitions/persistence/create_login_profile_for_iam_user.yml
validating ../definitions/persistence/create_secrets_manager_secret.yml
validating ../definitions/persistence/update_login_profile_for_iam_user.yml
validating ../definitions/privilege_escalation/add_iam_user_to_group.yml
validating ../definitions/privilege_escalation/add_policy_to_iam_group.yml
validating ../definitions/privilege_escalation/add_policy_to_iam_user.yml
validating ../definitions/privilege_escalation/add_policy_to_role.yml
validating ../definitions/privilege_escalation/add_role_to_new_ec2_instance.yml
validating ../definitions/privilege_escalation/attach-malicious-lambda-layer.yml
validating ../definitions/privilege_escalation/create_iam_policy.yml
validating ../definitions/privilege_escalation/create_iam_policy_version.yml
validating ../definitions/privilege_escalation/set_default_iam_policy_version.yml
validating ../definitions/privilege_escalation/update_inline_policy_for_user.yml
Validation successful - validated 46 cases
[Container] 2022/01/20 14:44:33 Running command poetry run python generator.py generate-aws-api
Generating API
API generation complete - 41 cases generated
[Container] 2022/01/20 14:44:34 Phase complete: PRE_BUILD State: SUCCEEDED
[Container] 2022/01/20 14:44:34 Phase context status code: Message:
[Container] 2022/01/20 14:44:34 Entering phase BUILD
[Container] 2022/01/20 14:44:34 Running command cd ../output/leonidas
[Container] 2022/01/20 14:44:34 Running command serverless plugin install --name serverless-python-requirements
Serverless: Installing plugin "serverless-python-requirements@latest" (this might take a few seconds...)
Serverless: Successfully installed "serverless-python-requirements@latest"
Serverless: Deprecation warning: Support for Node.js versions below v12 will be dropped with next major release. Please upgrade at https://nodejs.org/en/
More Info: https://www.serverless.com/framework/docs/deprecations/#OUTDATED_NODEJS
[Container] 2022/01/20 14:44:38 Running command serverless plugin install --name serverless-wsgi
Serverless: Installing plugin "serverless-wsgi@latest" (this might take a few seconds...)
Serverless: Successfully installed "serverless-wsgi@latest"
Serverless: Deprecation warning: Support for Node.js versions below v12 will be dropped with next major release. Please upgrade at https://nodejs.org/en/
More Info: https://www.serverless.com/framework/docs/deprecations/#OUTDATED_NODEJS
[Container] 2022/01/20 14:44:41 Running command poetry export --without-hashes -f requirements.txt -o requirements.txt
The lock file does not exist. Locking.
Creating virtualenv leonidas-UuNGa_az-py3.7 in /root/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...
Writing lock file
[Container] 2022/01/20 14:44:50 Running command serverless deploy --conceal
Serverless: To ensure safe major version upgrades ensure "frameworkVersion" setting in service configuration (recommended setup: "frameworkVersion: ^2.72.0")
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Load command requirements:cleanCache
Serverless: Load command wsgi
Serverless: Load command wsgi:serve
Serverless: Load command wsgi:install
Serverless: Load command wsgi:clean
Serverless: Load command wsgi:command
Serverless: Load command wsgi:command:local
Serverless: Load command wsgi:exec
Serverless: Load command wsgi:exec:local
Serverless: Load command wsgi:manage
Serverless: Load command wsgi:manage:local
Serverless: Load command wsgi:flask
Serverless: Load command wsgi:flask:local
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command studio
Serverless: Skipping variables resolution with old resolver (new resolver reported no more variables to resolve)
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Generated requirements from /codebuild/output/src383416348/src/output/leonidas/requirements.txt in /codebuild/output/src383416348/src/output/leonidas/.serverless/requirements.txt...
Serverless: Installing requirements from /root/.cache/serverless-python-requirements/20d1ccb19b92bc531dde79ad665e95db8244b3b98c4824c28bd467e7c3b0bed6_x86_64_slspyc/requirements.txt ...
Serverless: Using download cache directory /root/.cache/serverless-python-requirements/downloadCacheslspyc
Serverless: [AWS sts 200 0.158s 0 retries] getCallerIdentity({})
Serverless: Running ...
Serverless: Using Python specified in "runtime": python3.7
Serverless: Packaging Python WSGI handler...
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...
Serverless: Generating custom CloudFormation resources...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.121s 0 retries] describeStacks({ StackName: 'leonidas-dev' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 200 0.33s 0 retries] createStack({ StackName: 'leonidas-dev',
OnFailure: 'DELETE',
Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
Parameters: [ [length]: 0 ],
TemplateBody:
'{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}},"ServerlessDeploymentBucketPolicy":{"Type":"AWS::S3::BucketPolicy","Properties":{"Bucket":{"Ref":"ServerlessDeploymentBucket"},"PolicyDocument":{"Statement":[{"Action":"s3:*","Effect":"Deny","Principal":"*","Resource":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Ref":"ServerlessDeploymentBucket"},"/*"]]},{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Ref":"ServerlessDeploymentBucket"}]]}],"Condition":{"Bool":{"aws:SecureTransport":false}}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
Tags: [ { Key: 'STAGE', Value: 'dev' }, [length]: 1 ] })
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 200 0.093s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
..Serverless: [AWS cloudformation 200 0.089s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
.Serverless: [AWS cloudformation 200 0.099s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
Serverless: [AWS cloudformation 200 0.115s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
Serverless: [AWS cloudformation 200 0.088s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
Serverless: [AWS cloudformation 200 0.099s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
....Serverless: [AWS cloudformation 200 0.086s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
.
Serverless: Stack create finished...
Serverless: Ensuring that deployment bucket exists
Serverless: [AWS cloudformation 200 0.096s 0 retries] describeStackResource({ StackName: 'leonidas-dev',
LogicalResourceId: 'ServerlessDeploymentBucket' })
Serverless: [AWS s3 200 0.089s 0 retries] headBucket({ Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr' })
Serverless: [AWS s3 200 0.094s 0 retries] listObjectsV2({ Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Prefix: 'serverless/leonidas/dev' })
Serverless: [AWS lambda 404 0.112s 0 retries] getFunction({ FunctionName: 'leonidas-dev-app' })
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.118s 0 retries] putObject({ Body:
<Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... >,
Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/compiled-cloudformation-template.json',
ContentType: 'application/json',
Metadata:
{ filesha256: 'RivZnre43hVQj0RrDqn1A0RpUViym0yE7GQPcD3SQGw=' } })
Serverless: Uploading artifacts...
Serverless: Uploading service leonidas.zip file to S3 (18.11 MB)...
Serverless: [AWS s3 200 0.157s 0 retries] createMultipartUpload({ Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/leonidas.zip',
ContentType: 'application/zip',
Metadata:
{ filesha256: 'TyEO3TAJlAqT5YiwZpTj5qf4Pj+QeZcbkwEZACGkNjQ=' } })
Serverless: [AWS s3 200 0.258s 0 retries] uploadPart({ Body:
<Buffer 50 4b 03 04 0a 00 00 00 08 00 00 00 21 00 c1 dc 9a bb 15 00 00 00 16 00 00 00 10 00 00 00 2e 73 65 72 76 65 72 6c 65 73 73 2d 77 73 67 69 ab 56 4a 2c ... >,
ContentLength: 5242880,
PartNumber: 1,
Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/leonidas.zip',
UploadId:
'5Sw4mfLMDUlWuaxwhe80FstRwfL6ugU69dqE.rqP8Ccwvd7.IMyYHT3fUCuZ.F7aa6dI4qFUMPzfIj3KNw.pKo3W12muG1yWoRFHBWcqIRGmnC2ZbTF7Ja2g2x22af5fv5b.aJIC3CSicdvhRASu7S2yQ1jLqT8ZL37.9KWoqH6esJHLp2uLM7tYuBHDaKfT' })
Serverless: [AWS s3 200 0.266s 0 retries] uploadPart({ Body:
<Buffer 31 d8 05 2e b5 c9 09 3f bd 03 79 a0 d5 79 c7 b2 a1 80 93 cd b6 1a 62 78 5c 4a d8 88 f3 89 6e a5 cb 1a 0b 0c 88 6a e6 62 26 91 4d 82 92 61 10 10 37 28 ... >,
ContentLength: 2378420,
PartNumber: 4,
Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/leonidas.zip',
UploadId:
'5Sw4mfLMDUlWuaxwhe80FstRwfL6ugU69dqE.rqP8Ccwvd7.IMyYHT3fUCuZ.F7aa6dI4qFUMPzfIj3KNw.pKo3W12muG1yWoRFHBWcqIRGmnC2ZbTF7Ja2g2x22af5fv5b.aJIC3CSicdvhRASu7S2yQ1jLqT8ZL37.9KWoqH6esJHLp2uLM7tYuBHDaKfT' })
Serverless: [AWS s3 200 0.33s 0 retries] uploadPart({ Body:
<Buffer c2 3b 05 af 12 96 9c 5f 0d 05 b8 3b 36 49 4f 50 33 de 4d 2f 91 a3 4d 66 05 f8 cf 0e 4c 6e 5a af e6 5d b0 b9 e0 c4 8d e0 f5 42 28 79 eb 8d c2 b5 7c 70 ... >,
ContentLength: 5242880,
PartNumber: 3,
Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/leonidas.zip',
UploadId:
'5Sw4mfLMDUlWuaxwhe80FstRwfL6ugU69dqE.rqP8Ccwvd7.IMyYHT3fUCuZ.F7aa6dI4qFUMPzfIj3KNw.pKo3W12muG1yWoRFHBWcqIRGmnC2ZbTF7Ja2g2x22af5fv5b.aJIC3CSicdvhRASu7S2yQ1jLqT8ZL37.9KWoqH6esJHLp2uLM7tYuBHDaKfT' })
Serverless: [AWS s3 200 0.367s 0 retries] uploadPart({ Body:
<Buffer cc 57 2f 7d 77 83 b7 6e 5f 28 39 78 fe a2 cd f2 de 30 fa 6a b6 9e a6 a5 ba b6 1e f3 92 af e2 32 41 cf f3 b1 88 43 47 f7 6c 3c 72 d8 a0 4a 33 d4 3b 4f ... >,
ContentLength: 5242880,
PartNumber: 2,
Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/leonidas.zip',
UploadId:
'5Sw4mfLMDUlWuaxwhe80FstRwfL6ugU69dqE.rqP8Ccwvd7.IMyYHT3fUCuZ.F7aa6dI4qFUMPzfIj3KNw.pKo3W12muG1yWoRFHBWcqIRGmnC2ZbTF7Ja2g2x22af5fv5b.aJIC3CSicdvhRASu7S2yQ1jLqT8ZL37.9KWoqH6esJHLp2uLM7tYuBHDaKfT' })
Serverless: [AWS s3 200 0.228s 0 retries] completeMultipartUpload({ MultipartUpload:
{ Parts:
[ { ETag: '"ba98d964f0ee7a0d0e8c64d7bb740277"', PartNumber: 1 },
{ ETag: '"dfffab9bc6cbea71a77f20423165db72"', PartNumber: 2 },
{ ETag: '"56276bdc2f5731427d70d51f9abdad7e"', PartNumber: 3 },
{ ETag: '"a1e398e34b78c5f62214deda55d65fee"', PartNumber: 4 },
[length]: 4 ] },
Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/leonidas.zip',
UploadId:
'5Sw4mfLMDUlWuaxwhe80FstRwfL6ugU69dqE.rqP8Ccwvd7.IMyYHT3fUCuZ.F7aa6dI4qFUMPzfIj3KNw.pKo3W12muG1yWoRFHBWcqIRGmnC2ZbTF7Ja2g2x22af5fv5b.aJIC3CSicdvhRASu7S2yQ1jLqT8ZL37.9KWoqH6esJHLp2uLM7tYuBHDaKfT' })
Serverless: Uploading custom CloudFormation resources...
Serverless: [AWS s3 200 0.101s 0 retries] putObject({ Body:
<Buffer 50 4b 03 04 14 00 08 00 08 00 a6 75 34 54 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 52 45 41 44 4d 45 2e 6d 64 8d cd c1 09 80 30 0c 46 e1 7b a7 ... >,
Bucket: 'leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr',
Key:
'serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/custom-resources.zip',
ContentType: 'application/zip',
Metadata:
{ filesha256: 'EHbUB3sa1m8i9/5gPPfQqD9Yp7ppBAIdxGya5l9ulvQ=' } })
Serverless: Validating template...
Serverless: [AWS cloudformation 200 0.205s 0 retries] validateTemplate({ TemplateURL:
'https://s3.amazonaws.com/leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr/serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/compiled-cloudformation-template.json' })
Serverless: Updating Stack...
Serverless: [AWS cloudformation 200 0.456s 0 retries] updateStack({ StackName: 'leonidas-dev',
Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
Parameters: [ [length]: 0 ],
TemplateURL:
'https://s3.amazonaws.com/leonidas-dev-serverlessdeploymentbucket-1dikss1vcwksr/serverless/leonidas/dev/1642689913475-2022-01-20T14:45:13.475Z/compiled-cloudformation-template.json',
Tags: [ { Key: 'STAGE', Value: 'dev' }, [length]: 1 ] })
Serverless: Checking Stack update progress...
Serverless: [AWS cloudformation 200 0.089s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
.Serverless: [AWS cloudformation 200 0.141s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
....................Serverless: [AWS cloudformation 200 0.12s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
..Serverless: [AWS cloudformation 200 0.115s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
......Serverless: [AWS cloudformation 200 0.162s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
.....Serverless: [AWS cloudformation 200 0.145s 0 retries] describeStackEvents({ StackName:
'arn:aws:cloudformation:us-east-1:ACCOUNT_ID:stack/leonidas-dev/93760750-79ff-11ec-8614-12d8f63593e5' })
delete_login_profile_for_iam_user.yml
is currently location within persistence folder, but actually belongs in impact as it is categorized as T1531 (Account Access Removal)
Describe the solution you'd like
Add support for Google Cloud (GCP)
Requirements
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.