From f2b70ce6186e9cc2a740cfcfefddebc9a64ecc9a Mon Sep 17 00:00:00 2001 From: blsaccess Date: Sun, 20 Oct 2024 00:24:52 +0000 Subject: [PATCH 01/46] Update nuclei --- bbot/modules/deadly/nuclei.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbot/modules/deadly/nuclei.py b/bbot/modules/deadly/nuclei.py index 506db6f0e..1eb10cb23 100644 --- a/bbot/modules/deadly/nuclei.py +++ b/bbot/modules/deadly/nuclei.py @@ -15,7 +15,7 @@ class nuclei(BaseModule): } options = { - "version": "3.3.4", + "version": "3.3.5", "tags": "", "templates": "", "severity": "", From 2c0ebb61d656aa0873688a13670f3f9341f1842e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 04:27:03 +0000 Subject: [PATCH 02/46] Bump pytest-asyncio from 0.23.8 to 0.24.0 Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.23.8 to 0.24.0. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.23.8...v0.24.0) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6e6dd87f1..9eb40d969 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1967,17 +1967,17 @@ dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments [[package]] name = "pytest-asyncio" -version = "0.23.8" +version = "0.24.0" description = "Pytest support for asyncio" optional = false python-versions = ">=3.8" files = [ - {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, - {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, + {file = "pytest_asyncio-0.24.0-py3-none-any.whl", hash = "sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b"}, + {file = "pytest_asyncio-0.24.0.tar.gz", hash = "sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276"}, ] [package.dependencies] -pytest = ">=7.0.0,<9" +pytest = ">=8.2,<9" [package.extras] docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] @@ -3077,4 +3077,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "056fa05ead5abab1767c7c410539a4536659d1b6420bd13375aab965f98e326e" +content-hash = "675128279862686c6c3e85d2ee2889772250bb7896458e15cbf5005bcf7f0578" diff --git a/pyproject.toml b/pyproject.toml index 9158de2cc..bc7aea30d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ pytest-timeout = "^2.3.1" pytest-httpx = "^0.30.0" pytest-httpserver = "^1.0.11" pytest = "^8.3.1" -pytest-asyncio = "0.23.8" +pytest-asyncio = "0.24.0" [tool.poetry.group.docs.dependencies] mkdocs = "^1.5.2" From f76e688ef18e0fe00a7a5ce0fe2fc545b62a1139 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 04:27:58 +0000 Subject: [PATCH 03/46] Bump mkdocs-material from 9.5.41 to 9.5.42 Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.41 to 9.5.42. - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.41...9.5.42) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6e6dd87f1..736174438 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1278,13 +1278,13 @@ pyyaml = ">=5.1" [[package]] name = "mkdocs-material" -version = "9.5.41" +version = "9.5.42" description = "Documentation that simply works" optional = false python-versions = ">=3.8" files = [ - {file = "mkdocs_material-9.5.41-py3-none-any.whl", hash = "sha256:990bc138c33342b5b73e7545915ebc0136e501bfbd8e365735144f5120891d83"}, - {file = "mkdocs_material-9.5.41.tar.gz", hash = "sha256:30fa5d459b4b8130848ecd8e1c908878345d9d8268f7ddbc31eebe88d462d97b"}, + {file = "mkdocs_material-9.5.42-py3-none-any.whl", hash = "sha256:452a7c5d21284b373f36b981a2cbebfff59263feebeede1bc28652e9c5bbe316"}, + {file = "mkdocs_material-9.5.42.tar.gz", hash = "sha256:92779b5e9b5934540c574c11647131d217dc540dce72b05feeda088c8eb1b8f2"}, ] [package.dependencies] From ec67fa40328815bc6a614e8ebfae431c5d3ad64a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 04:28:28 +0000 Subject: [PATCH 04/46] Bump xmltojson from 2.0.2 to 2.0.3 Bumps [xmltojson](https://github.com/shanahanjrs/xmltojson) from 2.0.2 to 2.0.3. - [Commits](https://github.com/shanahanjrs/xmltojson/commits) --- updated-dependencies: - dependency-name: xmltojson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6e6dd87f1..da82e2380 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2943,28 +2943,28 @@ files = [ [[package]] name = "xmltodict" -version = "0.12.0" +version = "0.14.2" description = "Makes working with XML feel like you are working with JSON" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.6" files = [ - {file = "xmltodict-0.12.0-py2.py3-none-any.whl", hash = "sha256:8bbcb45cc982f48b2ca8fe7e7827c5d792f217ecf1792626f808bf41c3b86051"}, - {file = "xmltodict-0.12.0.tar.gz", hash = "sha256:50d8c638ed7ecb88d90561beedbf720c9b4e851a9fa6c47ebd64e99d166d8a21"}, + {file = "xmltodict-0.14.2-py2.py3-none-any.whl", hash = "sha256:20cc7d723ed729276e808f26fb6b3599f786cbc37e06c65e192ba77c40f20aac"}, + {file = "xmltodict-0.14.2.tar.gz", hash = "sha256:201e7c28bb210e374999d1dde6382923ab0ed1a8a5faeece48ab525b7810a553"}, ] [[package]] name = "xmltojson" -version = "2.0.2" +version = "2.0.3" description = "A Python module and cli tool to quickly convert xml text or files into json" optional = false -python-versions = ">=3.7,<4.0" +python-versions = "<4.0,>=3.7" files = [ - {file = "xmltojson-2.0.2-py3-none-any.whl", hash = "sha256:8ba5c8b33a5a0f824ad754ed62367d841ce91f7deaf82e118c28e42a0e24454c"}, - {file = "xmltojson-2.0.2.tar.gz", hash = "sha256:10719660409bd1825507e04d2fa4848c10591a092613bcd66651c7e0774f5405"}, + {file = "xmltojson-2.0.3-py3-none-any.whl", hash = "sha256:1b68519bd14fbf3e28baa630b8c9116b5d3aa8976648f277a78ae3448498889a"}, + {file = "xmltojson-2.0.3.tar.gz", hash = "sha256:68a0022272adf70b8f2639186172c808e9502cd03c0b851a65e0760561c7801d"}, ] [package.dependencies] -xmltodict = ">=0.12.0,<0.13.0" +xmltodict = "0.14.2" [[package]] name = "yara-python" From 6a5303dd1085aa7e3e13d712c9b5472b6f51b4b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 04:28:46 +0000 Subject: [PATCH 05/46] Bump mkdocstrings-python from 1.12.1 to 1.12.2 Bumps [mkdocstrings-python](https://github.com/mkdocstrings/python) from 1.12.1 to 1.12.2. - [Release notes](https://github.com/mkdocstrings/python/releases) - [Changelog](https://github.com/mkdocstrings/python/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/python/compare/1.12.1...1.12.2) --- updated-dependencies: - dependency-name: mkdocstrings-python dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6e6dd87f1..6cb8b0eb6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1346,13 +1346,13 @@ python-legacy = ["mkdocstrings-python-legacy (>=0.2.1)"] [[package]] name = "mkdocstrings-python" -version = "1.12.1" +version = "1.12.2" description = "A Python handler for mkdocstrings." optional = false python-versions = ">=3.9" files = [ - {file = "mkdocstrings_python-1.12.1-py3-none-any.whl", hash = "sha256:205244488199c9aa2a39787ad6a0c862d39b74078ea9aa2be817bc972399563f"}, - {file = "mkdocstrings_python-1.12.1.tar.gz", hash = "sha256:60d6a5ca912c9af4ad431db6d0111ce9f79c6c48d33377dde6a05a8f5f48d792"}, + {file = "mkdocstrings_python-1.12.2-py3-none-any.whl", hash = "sha256:7f7d40d6db3cb1f5d19dbcd80e3efe4d0ba32b073272c0c0de9de2e604eda62a"}, + {file = "mkdocstrings_python-1.12.2.tar.gz", hash = "sha256:7a1760941c0b52a2cd87b960a9e21112ffe52e7df9d0b9583d04d47ed2e186f3"}, ] [package.dependencies] From 9dc05bb2558e3763da7adcbd4968ab55e0567c71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:53:33 +0000 Subject: [PATCH 06/46] Bump psutil from 5.9.8 to 6.1.0 Bumps [psutil](https://github.com/giampaolo/psutil) from 5.9.8 to 6.1.0. - [Changelog](https://github.com/giampaolo/psutil/blob/master/HISTORY.rst) - [Commits](https://github.com/giampaolo/psutil/compare/release-5.9.8...release-6.1.0) --- updated-dependencies: - dependency-name: psutil dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 44 +++++++++++++++++++++++--------------------- pyproject.toml | 2 +- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/poetry.lock b/poetry.lock index dd25a45a4..8da0a4305 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1645,31 +1645,33 @@ virtualenv = ">=20.10.0" [[package]] name = "psutil" -version = "5.9.8" +version = "6.1.0" description = "Cross-platform lib for process and system monitoring in Python." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" -files = [ - {file = "psutil-5.9.8-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:26bd09967ae00920df88e0352a91cff1a78f8d69b3ecabbfe733610c0af486c8"}, - {file = "psutil-5.9.8-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:05806de88103b25903dff19bb6692bd2e714ccf9e668d050d144012055cbca73"}, - {file = "psutil-5.9.8-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:611052c4bc70432ec770d5d54f64206aa7203a101ec273a0cd82418c86503bb7"}, - {file = "psutil-5.9.8-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:50187900d73c1381ba1454cf40308c2bf6f34268518b3f36a9b663ca87e65e36"}, - {file = "psutil-5.9.8-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:02615ed8c5ea222323408ceba16c60e99c3f91639b07da6373fb7e6539abc56d"}, - {file = "psutil-5.9.8-cp27-none-win32.whl", hash = "sha256:36f435891adb138ed3c9e58c6af3e2e6ca9ac2f365efe1f9cfef2794e6c93b4e"}, - {file = "psutil-5.9.8-cp27-none-win_amd64.whl", hash = "sha256:bd1184ceb3f87651a67b2708d4c3338e9b10c5df903f2e3776b62303b26cb631"}, - {file = "psutil-5.9.8-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:aee678c8720623dc456fa20659af736241f575d79429a0e5e9cf88ae0605cc81"}, - {file = "psutil-5.9.8-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cb6403ce6d8e047495a701dc7c5bd788add903f8986d523e3e20b98b733e421"}, - {file = "psutil-5.9.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d06016f7f8625a1825ba3732081d77c94589dca78b7a3fc072194851e88461a4"}, - {file = "psutil-5.9.8-cp36-cp36m-win32.whl", hash = "sha256:7d79560ad97af658a0f6adfef8b834b53f64746d45b403f225b85c5c2c140eee"}, - {file = "psutil-5.9.8-cp36-cp36m-win_amd64.whl", hash = "sha256:27cc40c3493bb10de1be4b3f07cae4c010ce715290a5be22b98493509c6299e2"}, - {file = "psutil-5.9.8-cp37-abi3-win32.whl", hash = "sha256:bc56c2a1b0d15aa3eaa5a60c9f3f8e3e565303b465dbf57a1b730e7a2b9844e0"}, - {file = "psutil-5.9.8-cp37-abi3-win_amd64.whl", hash = "sha256:8db4c1b57507eef143a15a6884ca10f7c73876cdf5d51e713151c1236a0e68cf"}, - {file = "psutil-5.9.8-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:d16bbddf0693323b8c6123dd804100241da461e41d6e332fb0ba6058f630f8c8"}, - {file = "psutil-5.9.8.tar.gz", hash = "sha256:6be126e3225486dff286a8fb9a06246a5253f4c7c53b475ea5f5ac934e64194c"}, +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "psutil-6.1.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ff34df86226c0227c52f38b919213157588a678d049688eded74c76c8ba4a5d0"}, + {file = "psutil-6.1.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:c0e0c00aa18ca2d3b2b991643b799a15fc8f0563d2ebb6040f64ce8dc027b942"}, + {file = "psutil-6.1.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:000d1d1ebd634b4efb383f4034437384e44a6d455260aaee2eca1e9c1b55f047"}, + {file = "psutil-6.1.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:5cd2bcdc75b452ba2e10f0e8ecc0b57b827dd5d7aaffbc6821b2a9a242823a76"}, + {file = "psutil-6.1.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:045f00a43c737f960d273a83973b2511430d61f283a44c96bf13a6e829ba8fdc"}, + {file = "psutil-6.1.0-cp27-none-win32.whl", hash = "sha256:9118f27452b70bb1d9ab3198c1f626c2499384935aaf55388211ad982611407e"}, + {file = "psutil-6.1.0-cp27-none-win_amd64.whl", hash = "sha256:a8506f6119cff7015678e2bce904a4da21025cc70ad283a53b099e7620061d85"}, + {file = "psutil-6.1.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:6e2dcd475ce8b80522e51d923d10c7871e45f20918e027ab682f94f1c6351688"}, + {file = "psutil-6.1.0-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:0895b8414afafc526712c498bd9de2b063deaac4021a3b3c34566283464aff8e"}, + {file = "psutil-6.1.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9dcbfce5d89f1d1f2546a2090f4fcf87c7f669d1d90aacb7d7582addece9fb38"}, + {file = "psutil-6.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:498c6979f9c6637ebc3a73b3f87f9eb1ec24e1ce53a7c5173b8508981614a90b"}, + {file = "psutil-6.1.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d905186d647b16755a800e7263d43df08b790d709d575105d419f8b6ef65423a"}, + {file = "psutil-6.1.0-cp36-cp36m-win32.whl", hash = "sha256:6d3fbbc8d23fcdcb500d2c9f94e07b1342df8ed71b948a2649b5cb060a7c94ca"}, + {file = "psutil-6.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:1209036fbd0421afde505a4879dee3b2fd7b1e14fee81c0069807adcbbcca747"}, + {file = "psutil-6.1.0-cp37-abi3-win32.whl", hash = "sha256:1ad45a1f5d0b608253b11508f80940985d1d0c8f6111b5cb637533a0e6ddc13e"}, + {file = "psutil-6.1.0-cp37-abi3-win_amd64.whl", hash = "sha256:a8fb3752b491d246034fa4d279ff076501588ce8cbcdbb62c32fd7a377d996be"}, + {file = "psutil-6.1.0.tar.gz", hash = "sha256:353815f59a7f64cdaca1c0307ee13558a0512f6db064e92fe833784f08539c7a"}, ] [package.extras] -test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] +dev = ["black", "check-manifest", "coverage", "packaging", "pylint", "pyperf", "pypinfo", "pytest-cov", "requests", "rstcheck", "ruff", "sphinx", "sphinx_rtd_theme", "toml-sort", "twine", "virtualenv", "wheel"] +test = ["pytest", "pytest-xdist", "setuptools"] [[package]] name = "ptyprocess" @@ -3077,4 +3079,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "675128279862686c6c3e85d2ee2889772250bb7896458e15cbf5005bcf7f0578" +content-hash = "b87b1a5bccf2a50f548ae9470eabff8a8a9e870387562308a7b217b0fa2d84f0" diff --git a/pyproject.toml b/pyproject.toml index bc7aea30d..9181d2290 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ bbot = 'bbot.cli:main' [tool.poetry.dependencies] python = "^3.9" omegaconf = "^2.3.0" -psutil = "^5.9.4" +psutil = ">=5.9.4,<7.0.0" wordninja = "^2.0.0" ansible-runner = "^2.3.2" deepdiff = ">=6.2.3,<8.0.0" From 20aaf6820bb77bb63a392fdae39b6f9bad4f24a9 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 18 Oct 2024 15:47:40 -0400 Subject: [PATCH 07/46] resolve conflicts --- .github/workflows/tests.yml | 90 ++++++++----------------------------- 1 file changed, 19 insertions(+), 71 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 799c0101e..0d7599a41 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,12 +14,12 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: psf/black@stable with: options: "--check" - name: Install Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install dependencies @@ -27,7 +27,7 @@ jobs: pip install flake8 - name: flake8 run: | - flake8 --select F,E722 --ignore F403,F405,F541 --per-file-ignores="*/__init__.py:F401,F403" + flake8 test: needs: lint runs-on: ubuntu-latest @@ -37,9 +37,9 @@ jobs: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -55,88 +55,36 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./cov.xml verbose: true - update_docs: - needs: test - runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/stable') + test-distros: + needs: lint + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, debian, archlinux, fedora-latest, gentoo, alpine] steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }} + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install poetry poetry install - - name: Generate docs - run: | - poetry run bbot/scripts/docs.py - - name: Commit docs - uses: EndBug/add-and-commit@v9 - continue-on-error: true - with: - add: '["*.md", "docs/data/chord_graph/*.json"]' - author_name: "BBOT Docs Autopublish" - author_email: info@blacklanternsecurity.com - message: "Refresh module docs" - publish_docs: - needs: test - runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/dev') - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }} - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v3 - with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - name: Install dependencies - run: | - pip install poetry - poetry install --only=docs - - name: Configure Git - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git fetch origin gh-pages:refs/remotes/origin/gh-pages - if git show-ref --verify --quiet refs/heads/gh-pages; then - git branch -f gh-pages origin/gh-pages - else - git branch --track gh-pages origin/gh-pages - fi - - name: Generate docs (stable branch) - if: github.ref == 'refs/heads/stable' - run: | - poetry run mike deploy Stable - - name: Generate docs (dev branch) - if: github.ref == 'refs/heads/dev' - run: | - poetry run mike deploy Dev - - name: Publish docs + - name: Run tests run: | - git switch gh-pages - git push + poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG --cov-config=bbot/test/coverage.cfg --cov-report xml:cov.xml --cov=bbot . publish_code: needs: test runs-on: ubuntu-latest if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/stable') continue-on-error: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install dependencies @@ -185,7 +133,7 @@ jobs: # runs-on: ubuntu-latest # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' # steps: - # - uses: actions/checkout@v3 + # - uses: actions/checkout@v4 # with: # ref: ${{ github.head_ref }} # fetch-depth: 0 # Fetch all history for all tags and branches From f55c00441ac972dfb98acef07852c4f97cf18f3d Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 18 Oct 2024 15:48:06 -0400 Subject: [PATCH 08/46] resolve conflicts --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index bbe8b7581..a6f057338 100644 --- a/.flake8 +++ b/.flake8 @@ -2,4 +2,4 @@ select = F,E722 ignore = F403,F405,F541 per-file-ignores = - */__init__.py:F401,F403 \ No newline at end of file + */__init__.py:F401,F403 From 6be3f2395432508273eae260edee11b4a3fcc122 Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Tue, 18 Jun 2024 12:58:16 -0400 Subject: [PATCH 09/46] simplified run_tests.sh --- bbot/test/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbot/test/run_tests.sh b/bbot/test/run_tests.sh index 3490f5b65..39458dbf9 100755 --- a/bbot/test/run_tests.sh +++ b/bbot/test/run_tests.sh @@ -10,7 +10,7 @@ echo echo "[+] Linting with flake8" echo "=======================" -flake8 --select F,E722 --ignore F403,F405,F541 --per-file-ignores="*/__init__.py:F401,F403" "$bbot_dir" || exit 1 +flake8 "$bbot_dir" || exit 1 echo if [ "${1}x" != "x" ] ; then From c08648e0d6ca255a409f0b4f517fae987fb531cf Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 18 Oct 2024 15:48:39 -0400 Subject: [PATCH 10/46] resolve conflicts --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d7599a41..bf65e13c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,7 +48,7 @@ jobs: poetry install - name: Run tests run: | - poetry run pytest --exitfirst --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG --cov-config=bbot/test/coverage.cfg --cov-report xml:cov.xml --cov=bbot . + poetry run pytest --exitfirst --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=INFO --cov-config=bbot/test/coverage.cfg --cov-report xml:cov.xml --cov=bbot . - name: Upload Code Coverage uses: codecov/codecov-action@v3 with: @@ -66,7 +66,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.x" - name: Install dependencies run: | pip install poetry From c2e69e8fbbf2a00c2cda5be20a209d22b65ccca6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 18 Oct 2024 16:43:15 -0400 Subject: [PATCH 11/46] runs-on --> container: image --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf65e13c8..80a6df8eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,7 +57,9 @@ jobs: verbose: true test-distros: needs: lint - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest + container: + image: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, debian, archlinux, fedora-latest, gentoo, alpine] From 6875793bc646f56ead7388542a54ca928e7cac72 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 18 Oct 2024 17:34:35 -0400 Subject: [PATCH 12/46] fix python setup --- .github/workflows/tests.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 80a6df8eb..7f00ed835 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -65,17 +65,27 @@ jobs: os: [ubuntu-latest, debian, archlinux, fedora-latest, gentoo, alpine] steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" + - name: Install Python + run: | + if [ -f /etc/debian_version ]; then + sudo apt-get update + sudo apt-get install -y python3 python3-pip + elif [ -f /etc/arch-release ]; then + sudo pacman -Syu --noconfirm python python-pip + elif [ -f /etc/fedora-release ]; then + sudo dnf install -y python3 python3-pip + elif [ -f /etc/gentoo-release ]; then + sudo emerge dev-lang/python + elif [ -f /etc/alpine-release ]; then + sudo apk add --no-cache python3 py3-pip + fi - name: Install dependencies run: | pip install poetry poetry install - name: Run tests run: | - poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG --cov-config=bbot/test/coverage.cfg --cov-report xml:cov.xml --cov=bbot . + poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG . publish_code: needs: test runs-on: ubuntu-latest From 047b9ffd1609373812704878e15e909e8d82075e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 09:22:12 -0400 Subject: [PATCH 13/46] no sudo --- .github/workflows/tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f00ed835..3d334eaba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,16 +68,16 @@ jobs: - name: Install Python run: | if [ -f /etc/debian_version ]; then - sudo apt-get update - sudo apt-get install -y python3 python3-pip + apt-get update + apt-get install -y python3 python3-pip elif [ -f /etc/arch-release ]; then - sudo pacman -Syu --noconfirm python python-pip + pacman -Syu --noconfirm python python-pip elif [ -f /etc/fedora-release ]; then - sudo dnf install -y python3 python3-pip + dnf install -y python3 python3-pip elif [ -f /etc/gentoo-release ]; then - sudo emerge dev-lang/python + emerge dev-lang/python elif [ -f /etc/alpine-release ]; then - sudo apk add --no-cache python3 py3-pip + apk add --no-cache python3 py3-pip fi - name: Install dependencies run: | From 3c6728c290f593aa57460f61420138ed349c244a Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 10:02:48 -0400 Subject: [PATCH 14/46] python things --- .github/workflows/tests.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3d334eaba..147fdba5f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,8 +61,9 @@ jobs: container: image: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest, debian, archlinux, fedora-latest, gentoo, alpine] + os: [ubuntu-latest, debian, archlinux, fedora-latest, gentoo/python, python:3.10-alpine] steps: - uses: actions/checkout@v4 - name: Install Python @@ -74,10 +75,6 @@ jobs: pacman -Syu --noconfirm python python-pip elif [ -f /etc/fedora-release ]; then dnf install -y python3 python3-pip - elif [ -f /etc/gentoo-release ]; then - emerge dev-lang/python - elif [ -f /etc/alpine-release ]; then - apk add --no-cache python3 py3-pip fi - name: Install dependencies run: | From 0572ce6afb5a59ed8b1d1d15938215db3e96b5b3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 10:10:15 -0400 Subject: [PATCH 15/46] quotes --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 147fdba5f..709e11902 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,7 +63,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, debian, archlinux, fedora-latest, gentoo/python, python:3.10-alpine] + os: ["ubuntu-latest", "debian", "archlinux", "fedora-latest", "gentoo/python", "python:3.10-alpine"] steps: - uses: actions/checkout@v4 - name: Install Python From 5a6e68eea9368f3975b8c2055febcf656bba7124 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 10:29:53 -0400 Subject: [PATCH 16/46] testing stuff --- .github/workflows/tests.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 709e11902..83067d9ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,22 +63,25 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "debian", "archlinux", "fedora-latest", "gentoo/python", "python:3.10-alpine"] + os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine"] steps: - uses: actions/checkout@v4 - - name: Install Python + - name: Install Python and Poetry run: | if [ -f /etc/debian_version ]; then apt-get update - apt-get install -y python3 python3-pip + apt-get install -y python3 python3-pip python3-poetry elif [ -f /etc/arch-release ]; then - pacman -Syu --noconfirm python python-pip + pacman -Syu --noconfirm python python-pip poetry elif [ -f /etc/fedora-release ]; then - dnf install -y python3 python3-pip + dnf install -y python3 python3-pip poetry + elif [ -f /etc/gentoo-release ]; then + emerge --update --newuse dev-python/poetry + elif [ -f /etc/alpine-release ]; then + apk add --no-cache python3 py3-pip py3-poetry fi - name: Install dependencies run: | - pip install poetry poetry install - name: Run tests run: | From ffe8ae1cc149d129e4c4989280e0330bd202bd65 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 10:39:48 -0400 Subject: [PATCH 17/46] pipx --- .github/workflows/tests.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83067d9ca..65fb21e82 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,16 +70,18 @@ jobs: run: | if [ -f /etc/debian_version ]; then apt-get update - apt-get install -y python3 python3-pip python3-poetry + apt-get install -y python3 python3-pip pipx elif [ -f /etc/arch-release ]; then - pacman -Syu --noconfirm python python-pip poetry + pacman -Syu --noconfirm python python-pip pipx elif [ -f /etc/fedora-release ]; then - dnf install -y python3 python3-pip poetry + dnf install -y python3 python3-pip pipx elif [ -f /etc/gentoo-release ]; then - emerge --update --newuse dev-python/poetry + emerge --update --newuse dev-lang/python dev-python/pipx elif [ -f /etc/alpine-release ]; then - apk add --no-cache python3 py3-pip py3-poetry + apk add --no-cache python3 py3-pip py3-pipx fi + python3 -m pipx ensurepath + pipx install poetry - name: Install dependencies run: | poetry install From 46f65a4c9694b68e061295b490dcdc0f7c48654f Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 10:59:22 -0400 Subject: [PATCH 18/46] onwards --- .github/workflows/tests.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 65fb21e82..80f94851a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,18 +68,40 @@ jobs: - uses: actions/checkout@v4 - name: Install Python and Poetry run: | - if [ -f /etc/debian_version ]; then - apt-get update - apt-get install -y python3 python3-pip pipx + if [ -f /etc/os-release ]; then + . /etc/os-release + if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ]; then + # Add deadsnakes PPA for Python 3.12 + apt-get update + apt-get install -y software-properties-common + add-apt-repository ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip + # Update alternatives to use python3.12 + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 + update-alternatives --set python3 /usr/bin/python3.12 + python3 -m pip install --upgrade pip + python3 -m pip install pipx + else + apt-get update + apt-get install -y python3 python3-pip pipx + fi elif [ -f /etc/arch-release ]; then pacman -Syu --noconfirm python python-pip pipx elif [ -f /etc/fedora-release ]; then dnf install -y python3 python3-pip pipx elif [ -f /etc/gentoo-release ]; then + # Initialize and sync Gentoo repository + emerge-webrsync + emerge --sync emerge --update --newuse dev-lang/python dev-python/pipx elif [ -f /etc/alpine-release ]; then - apk add --no-cache python3 py3-pip py3-pipx + apk add --no-cache python3 py3-pip + python3 -m pip install --upgrade pip + python3 -m pip install pipx fi + # Add $HOME/.local/bin to PATH + export PATH="$HOME/.local/bin:$PATH" python3 -m pipx ensurepath pipx install poetry - name: Install dependencies From 50969ebb1b1f91710b5e22ec5c34fd84d58ef6f6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 11:04:33 -0400 Subject: [PATCH 19/46] distro stuff --- .github/workflows/distro_tests.yml | 67 ++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 55 ------------------------ 2 files changed, 67 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/distro_tests.yml diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml new file mode 100644 index 000000000..fd0c88efb --- /dev/null +++ b/.github/workflows/distro_tests.yml @@ -0,0 +1,67 @@ +name: Linux Distro Tests +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test-distros: + needs: lint + runs-on: ubuntu-latest + container: + image: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine"] + steps: + - uses: actions/checkout@v4 + - name: Install Python and Poetry + run: | + if [ -f /etc/os-release ]; then + . /etc/os-release + if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ]; then + # Add deadsnakes PPA for Python 3.12 + apt-get update + apt-get install -y software-properties-common + add-apt-repository ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip + # Update alternatives to use python3.12 + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 + update-alternatives --set python3 /usr/bin/python3.12 + python3 -m pip install --upgrade pip + python3 -m pip install pipx + elif [ "$ID" = "alpine" ]; then + apk add --no-cache python3 py3-pip + python3 -m pip install --upgrade pip + python3 -m pip install pipx + elif [ "$ID" = "arch" ]; then + pacman -Syu --noconfirm python python-pip pipx + elif [ "$ID" = "fedora" ]; then + dnf install -y python3 python3-pip pipx + elif [ "$ID" = "gentoo" ]; then + # Initialize and sync Gentoo repository + emerge-webrsync + emerge --sync + emerge --update --newuse dev-lang/python dev-python/pipx + else + echo "Unsupported Linux distribution" + exit 1 + fi + else + echo "Operating system not recognized" + exit 1 + fi + # Add $HOME/.local/bin to PATH + export PATH="$HOME/.local/bin:$PATH" + python3 -m pipx ensurepath + pipx install poetry + - name: Install dependencies + run: | + poetry install + - name: Run tests + run: | + poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG . diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 80f94851a..3a9aecd52 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,61 +55,6 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./cov.xml verbose: true - test-distros: - needs: lint - runs-on: ubuntu-latest - container: - image: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine"] - steps: - - uses: actions/checkout@v4 - - name: Install Python and Poetry - run: | - if [ -f /etc/os-release ]; then - . /etc/os-release - if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ]; then - # Add deadsnakes PPA for Python 3.12 - apt-get update - apt-get install -y software-properties-common - add-apt-repository ppa:deadsnakes/ppa - apt-get update - apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip - # Update alternatives to use python3.12 - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 - update-alternatives --set python3 /usr/bin/python3.12 - python3 -m pip install --upgrade pip - python3 -m pip install pipx - else - apt-get update - apt-get install -y python3 python3-pip pipx - fi - elif [ -f /etc/arch-release ]; then - pacman -Syu --noconfirm python python-pip pipx - elif [ -f /etc/fedora-release ]; then - dnf install -y python3 python3-pip pipx - elif [ -f /etc/gentoo-release ]; then - # Initialize and sync Gentoo repository - emerge-webrsync - emerge --sync - emerge --update --newuse dev-lang/python dev-python/pipx - elif [ -f /etc/alpine-release ]; then - apk add --no-cache python3 py3-pip - python3 -m pip install --upgrade pip - python3 -m pip install pipx - fi - # Add $HOME/.local/bin to PATH - export PATH="$HOME/.local/bin:$PATH" - python3 -m pipx ensurepath - pipx install poetry - - name: Install dependencies - run: | - poetry install - - name: Run tests - run: | - poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG . publish_code: needs: test runs-on: ubuntu-latest From b30cbaff378974f54b7e424d90dcabd87fd8773f Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 11:09:07 -0400 Subject: [PATCH 20/46] more --- .github/workflows/distro_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index fd0c88efb..2906a4771 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -8,7 +8,6 @@ concurrency: jobs: test-distros: - needs: lint runs-on: ubuntu-latest container: image: ${{ matrix.os }} From 262d5d7807ecae725ff7a0b6a88b86faddb64e30 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 11:11:37 -0400 Subject: [PATCH 21/46] just ubuntu things --- .github/workflows/distro_tests.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 2906a4771..e221a7d35 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -21,16 +21,21 @@ jobs: run: | if [ -f /etc/os-release ]; then . /etc/os-release - if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ]; then - # Add deadsnakes PPA for Python 3.12 - apt-get update - apt-get install -y software-properties-common - add-apt-repository ppa:deadsnakes/ppa - apt-get update - apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip - # Update alternatives to use python3.12 - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 - update-alternatives --set python3 /usr/bin/python3.12 + if [ "$ID" = "ubuntu" ]; then + if [ "$VERSION_ID" = "20.04" ]; then + # Add deadsnakes PPA for Python 3.12 + apt-get update + apt-get install -y software-properties-common + add-apt-repository ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip + # Update alternatives to use python3.12 + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 + update-alternatives --set python3 /usr/bin/python3.12 + else + apt-get update + apt-get install -y python3 python3-pip + fi python3 -m pip install --upgrade pip python3 -m pip install pipx elif [ "$ID" = "alpine" ]; then From cc296b7b8f012bd8c2fb27af42a6b9410c0eb602 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 11:46:15 -0400 Subject: [PATCH 22/46] tests --- .github/workflows/distro_tests.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index e221a7d35..8dc284c23 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -34,18 +34,23 @@ jobs: update-alternatives --set python3 /usr/bin/python3.12 else apt-get update - apt-get install -y python3 python3-pip + apt-get install -y python3 python3-pip python3-venv fi python3 -m pip install --upgrade pip python3 -m pip install pipx + elif [ "$ID" = "debian" ]; then + apt-get update + apt-get install -y python3 python3-pip python3-venv + python3 -m pip install --upgrade pip + python3 -m pip install pipx elif [ "$ID" = "alpine" ]; then apk add --no-cache python3 py3-pip python3 -m pip install --upgrade pip python3 -m pip install pipx elif [ "$ID" = "arch" ]; then - pacman -Syu --noconfirm python python-pip pipx + pacman -Syu --noconfirm python python-pip python-pipx elif [ "$ID" = "fedora" ]; then - dnf install -y python3 python3-pip pipx + dnf install -y python3 python3-pip pipx poetry elif [ "$ID" = "gentoo" ]; then # Initialize and sync Gentoo repository emerge-webrsync @@ -59,13 +64,13 @@ jobs: echo "Operating system not recognized" exit 1 fi - # Add $HOME/.local/bin to PATH - export PATH="$HOME/.local/bin:$PATH" python3 -m pipx ensurepath pipx install poetry - name: Install dependencies run: | + export PATH="$HOME/.local/bin:$PATH" poetry install - name: Run tests run: | + export PATH="$HOME/.local/bin:$PATH" poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG . From 97ce06b29c3780c6301645b65a59baf67a3133e6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 12:04:02 -0400 Subject: [PATCH 23/46] iterating --- .github/workflows/distro_tests.yml | 32 +++++++++++------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 8dc284c23..37b26ef0b 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -21,30 +21,22 @@ jobs: run: | if [ -f /etc/os-release ]; then . /etc/os-release - if [ "$ID" = "ubuntu" ]; then - if [ "$VERSION_ID" = "20.04" ]; then - # Add deadsnakes PPA for Python 3.12 - apt-get update - apt-get install -y software-properties-common - add-apt-repository ppa:deadsnakes/ppa - apt-get update - apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip - # Update alternatives to use python3.12 - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 - update-alternatives --set python3 /usr/bin/python3.12 - else - apt-get update - apt-get install -y python3 python3-pip python3-venv - fi - python3 -m pip install --upgrade pip - python3 -m pip install pipx - elif [ "$ID" = "debian" ]; then + if [ "$ID" = "ubuntu" || "$ID" = "debian" ]; then + # Add deadsnakes PPA for Python 3.12 + apt-get update + apt-get install -y software-properties-common + add-apt-repository ppa:deadsnakes/ppa apt-get update - apt-get install -y python3 python3-pip python3-venv + apt-get install -y python3.12 python3.12-venv python3.12-distutils + # Install pip for Python 3.12 + curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 + # Update alternatives to use python3.12 + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 + update-alternatives --set python3 /usr/bin/python3.12 python3 -m pip install --upgrade pip python3 -m pip install pipx elif [ "$ID" = "alpine" ]; then - apk add --no-cache python3 py3-pip + apk add --no-cache bash python3 py3-pip python3 -m pip install --upgrade pip python3 -m pip install pipx elif [ "$ID" = "arch" ]; then From 3036629933ed1d812bf08b00d6f10c8860d94046 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 12:05:22 -0400 Subject: [PATCH 24/46] bash oopsie --- .github/workflows/distro_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 37b26ef0b..e504b8586 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -21,7 +21,7 @@ jobs: run: | if [ -f /etc/os-release ]; then . /etc/os-release - if [ "$ID" = "ubuntu" || "$ID" = "debian" ]; then + if [ "$ID" = "ubuntu" -o "$ID" = "debian" ]; then # Add deadsnakes PPA for Python 3.12 apt-get update apt-get install -y software-properties-common From 687d247f6220e219c451299dcac2760a33c3309f Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 12:22:14 -0400 Subject: [PATCH 25/46] distrosgit diff --- .github/workflows/distro_tests.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index e504b8586..9c2c744c6 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -14,17 +14,17 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine"] + os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine", "kalilinux/kali-rolling", "parrotsec/parrot", "archlinux/archlinux"] steps: - uses: actions/checkout@v4 - name: Install Python and Poetry run: | if [ -f /etc/os-release ]; then . /etc/os-release - if [ "$ID" = "ubuntu" -o "$ID" = "debian" ]; then + if [ "$ID" = "ubuntu" ]; then # Add deadsnakes PPA for Python 3.12 apt-get update - apt-get install -y software-properties-common + apt-get install -y software-properties-common curl add-apt-repository ppa:deadsnakes/ppa apt-get update apt-get install -y python3.12 python3.12-venv python3.12-distutils @@ -36,10 +36,10 @@ jobs: python3 -m pip install --upgrade pip python3 -m pip install pipx elif [ "$ID" = "alpine" ]; then - apk add --no-cache bash python3 py3-pip + apk add --no-cache bash python3 py3-pip gcc musl-dev libffi-dev python3 -m pip install --upgrade pip python3 -m pip install pipx - elif [ "$ID" = "arch" ]; then + elif [ "$ID" = "arch" -o "$ID" = "archlinux" ]; then pacman -Syu --noconfirm python python-pip python-pipx elif [ "$ID" = "fedora" ]; then dnf install -y python3 python3-pip pipx poetry @@ -47,7 +47,10 @@ jobs: # Initialize and sync Gentoo repository emerge-webrsync emerge --sync - emerge --update --newuse dev-lang/python dev-python/pipx + emerge --update --newuse dev-lang/python dev-python/pipx poetry + elif [ "$ID" = "kali" -o "$ID" = "parrot" -o "$ID" = "debian" ]; then + apt-get update + apt-get install -y python3 python3-pip pipx else echo "Unsupported Linux distribution" exit 1 From c763c1eea262ee177c66ae56b4a774ace1eb1af5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 12:24:43 -0400 Subject: [PATCH 26/46] alpine --- .github/workflows/distro_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 9c2c744c6..bbe32406f 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine", "kalilinux/kali-rolling", "parrotsec/parrot", "archlinux/archlinux"] + os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine", "kalilinux/kali-rolling", "parrotsec/security", "archlinux/archlinux"] steps: - uses: actions/checkout@v4 - name: Install Python and Poetry @@ -36,7 +36,7 @@ jobs: python3 -m pip install --upgrade pip python3 -m pip install pipx elif [ "$ID" = "alpine" ]; then - apk add --no-cache bash python3 py3-pip gcc musl-dev libffi-dev + apk add --no-cache bash python3 py3-pip gcc g++ musl-dev libffi-dev python3 -m pip install --upgrade pip python3 -m pip install pipx elif [ "$ID" = "arch" -o "$ID" = "archlinux" ]; then From 16f204c19f24d53674abfa6066614481caefedbf Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 12:26:03 -0400 Subject: [PATCH 27/46] ubuntu things --- .github/workflows/distro_tests.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index bbe32406f..a6bf7dad1 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -22,12 +22,17 @@ jobs: if [ -f /etc/os-release ]; then . /etc/os-release if [ "$ID" = "ubuntu" ]; then - # Add deadsnakes PPA for Python 3.12 apt-get update apt-get install -y software-properties-common curl - add-apt-repository ppa:deadsnakes/ppa - apt-get update - apt-get install -y python3.12 python3.12-venv python3.12-distutils + if [ "$VERSION_ID" = "24.04" ]; then + # Install Python 3.12 and its components directly from Ubuntu repositories + apt-get install -y python3.12 python3.12-venv python3.12-distutils + else + # Add deadsnakes PPA for Python 3.12 + add-apt-repository ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.12 python3.12-venv python3.12-distutils + fi # Install pip for Python 3.12 curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 # Update alternatives to use python3.12 From 10627df2d6525a801d4e27fd3295c0d92f5fa607 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 12:41:22 -0400 Subject: [PATCH 28/46] more ubuntu things --- .github/workflows/distro_tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index a6bf7dad1..61bd352d0 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -24,9 +24,14 @@ jobs: if [ "$ID" = "ubuntu" ]; then apt-get update apt-get install -y software-properties-common curl + # Install necessary Perl modules for debconf + apt-get install -y libterm-readline-gnu-perl libterm-readline-perl-perl if [ "$VERSION_ID" = "24.04" ]; then # Install Python 3.12 and its components directly from Ubuntu repositories - apt-get install -y python3.12 python3.12-venv python3.12-distutils + apt-get install -y python3.12 python3.12-venv + # Handle missing python3.12-distutils + curl -O https://bootstrap.pypa.io/pip/3.12/get-pip.py + python3.12 get-pip.py else # Add deadsnakes PPA for Python 3.12 add-apt-repository ppa:deadsnakes/ppa From f3b90e5396f94195677a1711ffc5727a076849b8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 14:36:58 -0400 Subject: [PATCH 29/46] better debian --- .github/workflows/distro_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 61bd352d0..2dbae5a5d 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -14,13 +14,14 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine", "kalilinux/kali-rolling", "parrotsec/security", "archlinux/archlinux"] + os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine", "kalilinux/kali-rolling", "parrotsec/security"] steps: - uses: actions/checkout@v4 - name: Install Python and Poetry run: | if [ -f /etc/os-release ]; then . /etc/os-release + export DEBIAN_FRONTEND=noninteractive # Set debconf to noninteractive mode if [ "$ID" = "ubuntu" ]; then apt-get update apt-get install -y software-properties-common curl From 0a6e78bf73371634f29ef8e85f20b1d0b65ee7a2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 14:40:04 -0400 Subject: [PATCH 30/46] ubuntu why? --- .github/workflows/distro_tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 2dbae5a5d..8690a0fe1 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -30,9 +30,6 @@ jobs: if [ "$VERSION_ID" = "24.04" ]; then # Install Python 3.12 and its components directly from Ubuntu repositories apt-get install -y python3.12 python3.12-venv - # Handle missing python3.12-distutils - curl -O https://bootstrap.pypa.io/pip/3.12/get-pip.py - python3.12 get-pip.py else # Add deadsnakes PPA for Python 3.12 add-apt-repository ppa:deadsnakes/ppa From 838c7811a7e077fa834cccb2813ca1c36a8f60e3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 14:43:48 -0400 Subject: [PATCH 31/46] ubuntu why? --- .github/workflows/distro_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 8690a0fe1..3c8117ffe 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -30,6 +30,7 @@ jobs: if [ "$VERSION_ID" = "24.04" ]; then # Install Python 3.12 and its components directly from Ubuntu repositories apt-get install -y python3.12 python3.12-venv + else # Add deadsnakes PPA for Python 3.12 add-apt-repository ppa:deadsnakes/ppa @@ -42,7 +43,7 @@ jobs: update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 update-alternatives --set python3 /usr/bin/python3.12 python3 -m pip install --upgrade pip - python3 -m pip install pipx + python3 -m pip install pipx --break-system-packages elif [ "$ID" = "alpine" ]; then apk add --no-cache bash python3 py3-pip gcc g++ musl-dev libffi-dev python3 -m pip install --upgrade pip From 782a68d78cbbbfd2a996e8ec4b00fd868091d3a4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 14:55:51 -0400 Subject: [PATCH 32/46] ubuntu why? --- .github/workflows/distro_tests.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 3c8117ffe..90302cc75 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -28,21 +28,15 @@ jobs: # Install necessary Perl modules for debconf apt-get install -y libterm-readline-gnu-perl libterm-readline-perl-perl if [ "$VERSION_ID" = "24.04" ]; then - # Install Python 3.12 and its components directly from Ubuntu repositories - apt-get install -y python3.12 python3.12-venv - + apt-get install -y python3.11 python3.11-venv else - # Add deadsnakes PPA for Python 3.12 add-apt-repository ppa:deadsnakes/ppa apt-get update - apt-get install -y python3.12 python3.12-venv python3.12-distutils + apt-get install -y python3.11 python3.11-venv python3.11-distutils fi - # Install pip for Python 3.12 - curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 - # Update alternatives to use python3.12 - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 - update-alternatives --set python3 /usr/bin/python3.12 - python3 -m pip install --upgrade pip + curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 + update-alternatives --set python3 /usr/bin/python3.11 python3 -m pip install pipx --break-system-packages elif [ "$ID" = "alpine" ]; then apk add --no-cache bash python3 py3-pip gcc g++ musl-dev libffi-dev From 8f3ba6108fb6d912f2aa3ddb32b2c7fe38934f8e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 15:09:38 -0400 Subject: [PATCH 33/46] ubuntu why? --- .github/workflows/distro_tests.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 90302cc75..916e60007 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -27,13 +27,9 @@ jobs: apt-get install -y software-properties-common curl # Install necessary Perl modules for debconf apt-get install -y libterm-readline-gnu-perl libterm-readline-perl-perl - if [ "$VERSION_ID" = "24.04" ]; then - apt-get install -y python3.11 python3.11-venv - else - add-apt-repository ppa:deadsnakes/ppa - apt-get update - apt-get install -y python3.11 python3.11-venv python3.11-distutils - fi + add-apt-repository ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.11 python3.11-venv python3.11-distutils curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 update-alternatives --set python3 /usr/bin/python3.11 From cdfbe7e77d2ef139a07d1aa999f5312c282efcad Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 16:29:08 -0400 Subject: [PATCH 34/46] skip dastardly --- .github/workflows/distro_tests.yml | 1 + bbot/test/test_step_2/module_tests/base.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 916e60007..879b1ea04 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -67,4 +67,5 @@ jobs: - name: Run tests run: | export PATH="$HOME/.local/bin:$PATH" + export BBOT_DISTRO_TESTS=true poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG . diff --git a/bbot/test/test_step_2/module_tests/base.py b/bbot/test/test_step_2/module_tests/base.py index f5d4255f6..bb63b57e5 100644 --- a/bbot/test/test_step_2/module_tests/base.py +++ b/bbot/test/test_step_2/module_tests/base.py @@ -89,6 +89,10 @@ def module(self): async def module_test( self, httpx_mock, bbot_httpserver, bbot_httpserver_ssl, monkeypatch, request, caplog, capsys ): + # Skip dastardly test if we're in the distro tests (because dastardly uses docker) + if os.getenv("BBOT_DISTRO_TESTS") and self.name == "dastardly": + pytest.skip("Skipping module_test for dastardly module due to BBOT_DISTRO_TESTS environment variable") + self.log.info(f"Starting {self.name} module test") module_test = self.ModuleTest( self, httpx_mock, bbot_httpserver, bbot_httpserver_ssl, monkeypatch, request, caplog, capsys From ce31264ff53d8c05e50cfbfa89187f8a3e0a130e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 16:46:27 -0400 Subject: [PATCH 35/46] pyenv --- .github/workflows/distro_tests.yml | 54 ++++++++---------------------- 1 file changed, 14 insertions(+), 40 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 879b1ea04..5e9e5441b 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -21,51 +21,25 @@ jobs: run: | if [ -f /etc/os-release ]; then . /etc/os-release - export DEBIAN_FRONTEND=noninteractive # Set debconf to noninteractive mode - if [ "$ID" = "ubuntu" ]; then - apt-get update - apt-get install -y software-properties-common curl - # Install necessary Perl modules for debconf - apt-get install -y libterm-readline-gnu-perl libterm-readline-perl-perl - add-apt-repository ppa:deadsnakes/ppa - apt-get update - apt-get install -y python3.11 python3.11-venv python3.11-distutils - curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 - update-alternatives --set python3 /usr/bin/python3.11 - python3 -m pip install pipx --break-system-packages - elif [ "$ID" = "alpine" ]; then - apk add --no-cache bash python3 py3-pip gcc g++ musl-dev libffi-dev - python3 -m pip install --upgrade pip - python3 -m pip install pipx - elif [ "$ID" = "arch" -o "$ID" = "archlinux" ]; then - pacman -Syu --noconfirm python python-pip python-pipx - elif [ "$ID" = "fedora" ]; then - dnf install -y python3 python3-pip pipx poetry - elif [ "$ID" = "gentoo" ]; then - # Initialize and sync Gentoo repository - emerge-webrsync - emerge --sync - emerge --update --newuse dev-lang/python dev-python/pipx poetry - elif [ "$ID" = "kali" -o "$ID" = "parrot" -o "$ID" = "debian" ]; then - apt-get update - apt-get install -y python3 python3-pip pipx - else - echo "Unsupported Linux distribution" - exit 1 + if [ "$ID" = "alpine" ]; then + apk add --no-cache bash gcc g++ musl-dev libffi-dev fi - else - echo "Operating system not recognized" - exit 1 fi - python3 -m pipx ensurepath + + curl https://pyenv.run | bash + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" + pyenv install 3.11 + pyenv global 3.11 + python3.11 -m pip install --user spipx + python3.11 -m pipx ensurepath pipx install poetry - - name: Install dependencies - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry install - name: Run tests run: | export PATH="$HOME/.local/bin:$PATH" export BBOT_DISTRO_TESTS=true + poetry env use python3.11 + poetry install poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG . From 1eedaf57108aa1aedc7bee1778769569045a3d8e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 16:47:15 -0400 Subject: [PATCH 36/46] pyenv --- .github/workflows/distro_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 5e9e5441b..f8a20e6b4 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -39,6 +39,7 @@ jobs: - name: Run tests run: | export PATH="$HOME/.local/bin:$PATH" + export PATH="$HOME/.pyenv/bin:$PATH" export BBOT_DISTRO_TESTS=true poetry env use python3.11 poetry install From bb451fd5bd42da2367c2212d55c167d939f9f813 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 16:49:52 -0400 Subject: [PATCH 37/46] curl --- .github/workflows/distro_tests.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index f8a20e6b4..e18e71031 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -21,8 +21,17 @@ jobs: run: | if [ -f /etc/os-release ]; then . /etc/os-release - if [ "$ID" = "alpine" ]; then + if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ] || [ "$ID" = "kalilinux" ] || [ "$ID" = "parrotsec" ]; then + apt-get update + apt-get -y install curl + elif [ "$ID" = "alpine" ]; then apk add --no-cache bash gcc g++ musl-dev libffi-dev + elif [ "$ID" = "archlinux" ]; then + pacman -Syu --noconfirm curl + elif [ "$ID" = "fedora" ]; then + dnf install -y curl + elif [ "$ID" = "gentoo" ]; then + emerge --update --newuse curl fi fi From 60a418e60c8f51934d7114dbceacb8f69b0237a6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 16:51:42 -0400 Subject: [PATCH 38/46] git --- .github/workflows/distro_tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index e18e71031..87ae591b0 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -22,16 +22,17 @@ jobs: if [ -f /etc/os-release ]; then . /etc/os-release if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ] || [ "$ID" = "kalilinux" ] || [ "$ID" = "parrotsec" ]; then + export DEBIAN_FRONTEND=noninteractive apt-get update - apt-get -y install curl + apt-get -y install curl git elif [ "$ID" = "alpine" ]; then - apk add --no-cache bash gcc g++ musl-dev libffi-dev + apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git elif [ "$ID" = "archlinux" ]; then - pacman -Syu --noconfirm curl + pacman -Syu --noconfirm curl git elif [ "$ID" = "fedora" ]; then - dnf install -y curl + dnf install -y curl git elif [ "$ID" = "gentoo" ]; then - emerge --update --newuse curl + emerge --update --newuse curl git fi fi From 32abe3b4bba627e884fb805243eac1ab15df41e4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 16:55:05 -0400 Subject: [PATCH 39/46] bash --- .github/workflows/distro_tests.yml | 31 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 87ae591b0..7abf5aae7 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -24,28 +24,31 @@ jobs: if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ] || [ "$ID" = "kalilinux" ] || [ "$ID" = "parrotsec" ]; then export DEBIAN_FRONTEND=noninteractive apt-get update - apt-get -y install curl git + apt-get -y install curl git bash elif [ "$ID" = "alpine" ]; then apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git elif [ "$ID" = "archlinux" ]; then - pacman -Syu --noconfirm curl git + pacman -Syu --noconfirm curl git bash elif [ "$ID" = "fedora" ]; then - dnf install -y curl git + dnf install -y curl git bash elif [ "$ID" = "gentoo" ]; then - emerge --update --newuse curl git + emerge --update --newuse curl git bash fi fi - curl https://pyenv.run | bash - export PATH="$HOME/.pyenv/bin:$PATH" - eval "$(pyenv init --path)" - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" - pyenv install 3.11 - pyenv global 3.11 - python3.11 -m pip install --user spipx - python3.11 -m pipx ensurepath - pipx install poetry + # Re-run the script with bash + exec bash -c " + curl https://pyenv.run | bash + export PATH=\"$HOME/.pyenv/bin:\$PATH\" + eval \"\$(pyenv init --path)\" + eval \"\$(pyenv init -)\" + eval \"\$(pyenv virtualenv-init -)\" + pyenv install 3.11 + pyenv global 3.11 + python3.11 -m pip install --user spipx + python3.11 -m pipx ensurepath + pipx install poetry + " - name: Run tests run: | export PATH="$HOME/.local/bin:$PATH" From b9d40bf6d6b7555c5429ce4db3d329a57f21c614 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 16:57:34 -0400 Subject: [PATCH 40/46] dev --- .github/workflows/distro_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 7abf5aae7..b602012e6 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -24,13 +24,13 @@ jobs: if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ] || [ "$ID" = "kalilinux" ] || [ "$ID" = "parrotsec" ]; then export DEBIAN_FRONTEND=noninteractive apt-get update - apt-get -y install curl git bash + apt-get -y install curl git bash build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev elif [ "$ID" = "alpine" ]; then apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git elif [ "$ID" = "archlinux" ]; then - pacman -Syu --noconfirm curl git bash + pacman -Syu --noconfirm curl git bash base-devel elif [ "$ID" = "fedora" ]; then - dnf install -y curl git bash + dnf install -y curl git bash gcc make openssl-devel bzip2-devel libffi-devel elif [ "$ID" = "gentoo" ]; then emerge --update --newuse curl git bash fi @@ -45,7 +45,7 @@ jobs: eval \"\$(pyenv virtualenv-init -)\" pyenv install 3.11 pyenv global 3.11 - python3.11 -m pip install --user spipx + python3.11 -m pip install --user pipx python3.11 -m pipx ensurepath pipx install poetry " From 51fd792285a6746ac0744ab7915a955ae13f4d65 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 17:03:00 -0400 Subject: [PATCH 41/46] path --- .github/workflows/distro_tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index b602012e6..62b3fc088 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -26,12 +26,13 @@ jobs: apt-get update apt-get -y install curl git bash build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev elif [ "$ID" = "alpine" ]; then - apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git + apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git make openssl-dev bzip2-dev zlib-dev xz-dev elif [ "$ID" = "archlinux" ]; then pacman -Syu --noconfirm curl git bash base-devel elif [ "$ID" = "fedora" ]; then - dnf install -y curl git bash gcc make openssl-devel bzip2-devel libffi-devel + dnf install -y curl git bash gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel tk-devel gdbm-devel readline-devel sqlite-devel elif [ "$ID" = "gentoo" ]; then + emerge-webrsync emerge --update --newuse curl git bash fi fi @@ -40,6 +41,7 @@ jobs: exec bash -c " curl https://pyenv.run | bash export PATH=\"$HOME/.pyenv/bin:\$PATH\" + export PATH=\"$HOME/.local/bin:\$PATH\" eval \"\$(pyenv init --path)\" eval \"\$(pyenv init -)\" eval \"\$(pyenv virtualenv-init -)\" From f788dad306b9c5873ef57a2c0ad3a7d56d13f095 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 17:09:05 -0400 Subject: [PATCH 42/46] pyenv things --- .github/workflows/distro_tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index 62b3fc088..b29752ed0 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -21,19 +21,19 @@ jobs: run: | if [ -f /etc/os-release ]; then . /etc/os-release - if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ] || [ "$ID" = "kalilinux" ] || [ "$ID" = "parrotsec" ]; then + if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ] || [ "$ID" = "kali" ] || [ "$ID" = "parrotsec" ]; then export DEBIAN_FRONTEND=noninteractive apt-get update apt-get -y install curl git bash build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev elif [ "$ID" = "alpine" ]; then apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git make openssl-dev bzip2-dev zlib-dev xz-dev - elif [ "$ID" = "archlinux" ]; then + elif [ "$ID" = "arch" ]; then pacman -Syu --noconfirm curl git bash base-devel elif [ "$ID" = "fedora" ]; then dnf install -y curl git bash gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel tk-devel gdbm-devel readline-devel sqlite-devel elif [ "$ID" = "gentoo" ]; then emerge-webrsync - emerge --update --newuse curl git bash + emerge --update --newuse dev-vcs/git curl bash fi fi @@ -47,6 +47,7 @@ jobs: eval \"\$(pyenv virtualenv-init -)\" pyenv install 3.11 pyenv global 3.11 + pyenv rehash python3.11 -m pip install --user pipx python3.11 -m pipx ensurepath pipx install poetry @@ -55,6 +56,7 @@ jobs: run: | export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.pyenv/bin:$PATH" + export PATH="$HOME/.pyenv/shims:$PATH" export BBOT_DISTRO_TESTS=true poetry env use python3.11 poetry install From 73b00f452cb164e640d2405c74c22b511298d2cb Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Oct 2024 17:18:05 -0400 Subject: [PATCH 43/46] alpine --- .github/workflows/distro_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/distro_tests.yml b/.github/workflows/distro_tests.yml index b29752ed0..e9eac869a 100644 --- a/.github/workflows/distro_tests.yml +++ b/.github/workflows/distro_tests.yml @@ -26,7 +26,7 @@ jobs: apt-get update apt-get -y install curl git bash build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev elif [ "$ID" = "alpine" ]; then - apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git make openssl-dev bzip2-dev zlib-dev xz-dev + apk add --no-cache bash gcc g++ musl-dev libffi-dev curl git make openssl-dev bzip2-dev zlib-dev xz-dev sqlite-dev elif [ "$ID" = "arch" ]; then pacman -Syu --noconfirm curl git bash base-devel elif [ "$ID" = "fedora" ]; then From 51e745af456e8f37ec57fee6ec39e22ebeebe0fe Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 23 Oct 2024 14:19:20 -0400 Subject: [PATCH 44/46] bufferover.run module --- bbot/modules/bufferoverrun.py | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 bbot/modules/bufferoverrun.py diff --git a/bbot/modules/bufferoverrun.py b/bbot/modules/bufferoverrun.py new file mode 100644 index 000000000..224239636 --- /dev/null +++ b/bbot/modules/bufferoverrun.py @@ -0,0 +1,46 @@ +from bbot.modules.templates.subdomain_enum import subdomain_enum_apikey + + +class BufferOverrun(subdomain_enum_apikey): + watched_events = ["DNS_NAME"] + produced_events = ["DNS_NAME"] + flags = ["subdomain-enum", "passive", "safe"] + meta = { + "description": "Query BufferOverrun's TLS API for subdomains", + "created_date": "2024-10-23", + "author": "@TheTechromancer", + "auth_required": True, + } + options = {"api_key": "", "commercial": False} + options_desc = {"api_key": "BufferOverrun API key", "commercial": "Use commercial API"} + + base_url = "https://tls.bufferover.run/dns" + commercial_base_url = "https://bufferover-run-tls.p.rapidapi.com/ipv4/dns" + + def prepare_api_request(self, url, kwargs): + if "x-rapidapi-key" in kwargs["headers"]: + kwargs["headers"]["x-rapidapi-host"] = "bufferover-run-tls.p.rapidapi.com" + else: + kwargs["headers"]["x-api-key"] = self.api_key + return url, kwargs + + async def request_url(self, query, commercial=None): + if commercial is None: + commercial = self.options.get("commercial", False) + _, domain = self.helpers.split_domain(query) + url = f"{self.commercial_base_url if commercial else self.base_url}?q=.{domain}" + return await self.api_request(url) + + def parse_results(self, r, query): + j = r.json() + subdomains_set = set() + if isinstance(j, dict): + results = j.get("Results", []) + for result in results: + parts = result.split(",") + if len(parts) > 4: + subdomain = parts[4].strip() + if subdomain and subdomain.endswith(f".{query}"): + subdomains_set.add(subdomain) + for subdomain in subdomains_set: + yield subdomain From 6821a1ea7d20ad6fcc7dcea930a1c24cef851aac Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 23 Oct 2024 14:57:07 -0400 Subject: [PATCH 45/46] add test --- bbot/modules/bufferoverrun.py | 14 ++++---- .../module_tests/test_module_bufferoverrun.py | 35 +++++++++++++++++++ 2 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 bbot/test/test_step_2/module_tests/test_module_bufferoverrun.py diff --git a/bbot/modules/bufferoverrun.py b/bbot/modules/bufferoverrun.py index 224239636..1eba8ad4c 100644 --- a/bbot/modules/bufferoverrun.py +++ b/bbot/modules/bufferoverrun.py @@ -17,18 +17,20 @@ class BufferOverrun(subdomain_enum_apikey): base_url = "https://tls.bufferover.run/dns" commercial_base_url = "https://bufferover-run-tls.p.rapidapi.com/ipv4/dns" + async def setup(self): + self.commercial = self.config.get("commercial", False) + return await super().setup() + def prepare_api_request(self, url, kwargs): - if "x-rapidapi-key" in kwargs["headers"]: + if self.commercial: kwargs["headers"]["x-rapidapi-host"] = "bufferover-run-tls.p.rapidapi.com" + kwargs["headers"]["x-rapidapi-key"] = self.api_key else: kwargs["headers"]["x-api-key"] = self.api_key return url, kwargs - async def request_url(self, query, commercial=None): - if commercial is None: - commercial = self.options.get("commercial", False) - _, domain = self.helpers.split_domain(query) - url = f"{self.commercial_base_url if commercial else self.base_url}?q=.{domain}" + async def request_url(self, query): + url = f"{self.commercial_base_url if self.commercial else self.base_url}?q=.{query}" return await self.api_request(url) def parse_results(self, r, query): diff --git a/bbot/test/test_step_2/module_tests/test_module_bufferoverrun.py b/bbot/test/test_step_2/module_tests/test_module_bufferoverrun.py new file mode 100644 index 000000000..b8a8137e2 --- /dev/null +++ b/bbot/test/test_step_2/module_tests/test_module_bufferoverrun.py @@ -0,0 +1,35 @@ +from .base import ModuleTestBase + + +class TestBufferOverrun(ModuleTestBase): + config_overrides = {"modules": {"bufferoverrun": {"api_key": "asdf", "commercial": False}}} + + async def setup_before_prep(self, module_test): + # Mock response for non-commercial API + module_test.httpx_mock.add_response( + url="https://tls.bufferover.run/dns?q=.blacklanternsecurity.com", + match_headers={"x-api-key": "asdf"}, + json={"Results": ["1.2.3.4,example.com,*,*,sub.blacklanternsecurity.com"]}, + ) + + def check(self, module_test, events): + assert any(e.data == "sub.blacklanternsecurity.com" for e in events), "Failed to detect subdomain for free API" + + +class TestBufferOverrunCommercial(ModuleTestBase): + modules_overrides = ["bufferoverrun"] + module_name = "bufferoverrun" + config_overrides = {"modules": {"bufferoverrun": {"api_key": "asdf", "commercial": True}}} + + async def setup_before_prep(self, module_test): + # Mock response for commercial API + module_test.httpx_mock.add_response( + url="https://bufferover-run-tls.p.rapidapi.com/ipv4/dns?q=.blacklanternsecurity.com", + match_headers={"x-rapidapi-host": "bufferover-run-tls.p.rapidapi.com", "x-rapidapi-key": "asdf"}, + json={"Results": ["5.6.7.8,blacklanternsecurity.com,*,*,sub.blacklanternsecurity.com"]}, + ) + + def check(self, module_test, events): + assert any( + e.data == "sub.blacklanternsecurity.com" for e in events + ), "Failed to detect subdomain for commercial API" From ee078b39bf968d8718fefa17dc5d72c48acff799 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 23 Oct 2024 18:58:49 -0400 Subject: [PATCH 46/46] update docs workflow --- .github/workflows/docs_updater.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs_updater.yml b/.github/workflows/docs_updater.yml index fdc585718..a9f9b81f5 100644 --- a/.github/workflows/docs_updater.yml +++ b/.github/workflows/docs_updater.yml @@ -3,6 +3,7 @@ name: Daily Docs Update on: schedule: - cron: '0 0 * * *' # Runs daily at midnight UTC + workflow_dispatch: # Allows manual triggering jobs: update_docs: @@ -23,14 +24,17 @@ jobs: - name: Generate docs run: | poetry run bbot/scripts/docs.py - - name: Commit changes - uses: EndBug/add-and-commit@v9 - with: - add: '["*.md", "docs/data/chord_graph/*.json"]' - author_name: "BBOT Docs Autopublish" - author_email: info@blacklanternsecurity.com - message: "Refresh module docs" - - name: Create Pull Request + - name: Commit and Push Changes + run: | + git config user.name "BBOT Docs Autopublish" + git config user.email "info@blacklanternsecurity.com" + git checkout -b update-docs + git add "*.md" "docs/data/chord_graph/*.json" + git commit -m "Refresh module docs" + git push -u origin update-docs --force + env: + GITHUB_TOKEN: ${{ secrets.BBOT_DOCS_UPDATER_PAT }} + - name: Create or Update Pull Request uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }} @@ -38,3 +42,4 @@ jobs: base: dev title: "Daily Docs Update" body: "This is an automated pull request to update the documentation." + update-existing: true