Skip to content

Commit

Permalink
Dep upgrades (#647)
Browse files Browse the repository at this point in the history
* use poetry up

* upgrade deps

* update contrbuting.md

* changelog

* fix testclient

* fix tests

* fix changelog

* typo
  • Loading branch information
vinnybod authored Jul 9, 2023
1 parent 8684c9a commit 98f791c
Show file tree
Hide file tree
Showing 8 changed files with 511 additions and 481 deletions.
11 changes: 7 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ The more information you provide in a Github issue the easier it will be for us
* For more in-depth docs on developing modules, see the [Module Development docs](https://bc-security.gitbook.io/empire-wiki/module-development)

## Code Formatting and Linting
* As of Empire 4.4, we are using [psf/black](https://github.com/psf/black) for code formatting.
* We are using [psf/black](https://github.com/psf/black) for code formatting.
* Black is a Python code formatter that helps to keep the codebase uniform and easy to read
* As of Empire 4.4, we are using [PyCQA/isort](https://github.com/PyCQA/isort)
* We are using [PyCQA/isort](https://github.com/PyCQA/isort)
* Isort is a Python utility that sorts and formats imports.
* As of Empire 5.0.1, we are using [charliermarsh/ruff](https://github.com/charliermarsh/ruff) for linting.
* We are using [charliermarsh/ruff](https://github.com/charliermarsh/ruff) for linting.
* Ruff is a python linter that helps identify common bugs and style issues.
* After implementing your changes:
1. run `black .` (or `poetry run black .`).
Expand All @@ -50,4 +50,7 @@ The more information you provide in a Github issue the easier it will be for us

Please write tests for your code! We use [pytest](https://docs.pytest.org/en/latest/) for testing. Tests are located in the `tests/` directory. To run the tests, run `pytest` from the root directory of the project.

For tests that take >20-30 seconds, please add the `@pytest.mark.slow` decorator to the test function. This will allow us to skip the slow tests when running the tests, unless we explicitly want to run them with `pytest --runslow`.
For tests that take >20-30 seconds, please add the `@pytest.mark.slow` decorator to the test function. This will allow us to skip the slow tests when running the tests, unless we explicitly want to run them with `pytest --runslow`.

## Upgrading dependencies
Dependencies can be upgraded using [poetry-plugin-up](https://github.com/MousaZeidBaker/poetry-plugin-up).
4 changes: 1 addition & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Lint and Test

on:
pull_request:
paths-ignore:
- '**.md'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -14,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@23.1.0
- uses: psf/black@23.3.0
- uses: isort/isort-action@master
- name: Run ruff
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
language_version: python3.9
Expand All @@ -12,6 +12,6 @@ repos:
name: isort (python)

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.236'
rev: 'v0.0.277'
hooks:
- id: ruff
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Upgrade dependencies

## [5.5.1] - 2023-07-06

- Fix basic_reporting plugin using the wrong agent checkin column
Expand Down
2 changes: 1 addition & 1 deletion empire/test/test_agent_checkins_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_get_agent_checkins_multiple_agents(
response = client.get(
"/api/v2/agents/checkins",
headers=admin_auth_header,
params={"agents": [with_checkins[:2]], "limit": 400000},
params={"agents": with_checkins[:2], "limit": 400000},
)

assert response.status_code == 200
Expand Down
4 changes: 2 additions & 2 deletions empire/test/test_agent_task_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def test_create_task_script_import_agent_not_found(client, admin_auth_header, ag
files={
"file": (
"test-upload.yaml",
open("./empire/test/test-upload.yaml", "r"),
open("./empire/test/test-upload.yaml", "rb"),
"text/plain",
)
},
Expand All @@ -614,7 +614,7 @@ def test_create_task_script_import(client, admin_auth_header, agent):
files={
"file": (
"test-upload.yaml",
open("./empire/test/test-upload.yaml", "r"),
open("./empire/test/test-upload.yaml", "rb"),
"text/plain",
)
},
Expand Down
898 changes: 462 additions & 436 deletions poetry.lock

Large diffs are not rendered by default.

67 changes: 34 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,53 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
urllib3 = "*"
requests = "^2.24.0"
iptools = "*"
macholib = "*"
dropbox = "*"
pyOpenSSL = "*"
urllib3 = "^2.0.3"
requests = "^2.31.0"
iptools = "^0.7.0"
macholib = "^1.16.2"
dropbox = "^11.36.2"
pyOpenSSL = "^23.2.0"
zlib_wrapper = "^0.1.3"
netifaces = "*"
jinja2 = "*"
xlutils = "*"
pyparsing = "*"
PyMySQL = "^0.10.1"
SQLAlchemy = "^2.0"
PyYAML = "^5.3.1"
netifaces = "^0.11.0"
jinja2 = "^3.1.2"
xlutils = "^2.0.0"
pyparsing = "^3.1.0"
PyMySQL = "^1.1.0"
SQLAlchemy = "^2.0.18"
PyYAML = "^6.0"
SQLAlchemy-Utc = "^0.14.0"
prompt-toolkit = "^3.0.9"
terminaltables = "^3.1.0"
prompt-toolkit = "^3.0.39"
terminaltables = "^3.1.10"
docopt = "^0.6.2"
humanize = "^3.2.0"
pydantic = "^1.8.1"
pycryptodome = "^3.10.1"
cryptography = "^37.0.3"
fastapi = "0.70"
uvicorn = "^0.14.0"
jq = "^1.2.1"
aiofiles = "^0.7.0"
python-multipart = "^0.0.5"
humanize = "^4.7.0"
pycryptodome = "^3.18.0"
cryptography = "^41.0.1"
fastapi = "^0.99.1"
uvicorn = "^0.22.0"
jq = "^1.4.1"
aiofiles = "^23.1.0"
python-multipart = "^0.0.6"
python-jose = {version = "^3.3.0", extras = ["cryptography"]}
passlib = {version = "^1.7.4", extras = ["bcrypt"]}
websockify = "^0.10.0"
websockets = "^10.1"
websockets = "^11.0.3"
pyperclip = "^1.8.2"
pyvnc = {git = "https://github.com/BC-SECURITY/pyVNC.git"}
python-socketio = {extras = ["client"], version = "^5.7.1"}
Flask = "^2.1.2"
python-socketio = {extras = ["client"], version = "^5.8.0"}
Flask = "^2.3.2"
pysecretsocks = {git = "https://github.com/BC-SECURITY/PySecretSOCKS.git"}
donut-shellcode = "^1.0.2"
python-obfuscator = "^0.0.2"
pyinstaller = "^5.12"
pyinstaller = "^5.13.0"

[tool.poetry.dev-dependencies]
isort = "^5.10.1"
black = "^23.1.0"
pytest = "^7.2.0"

[tool.poetry.group.dev.dependencies]
httpx = "^0.24.1" # For starlette TestClient
isort = "^5.12.0"
black = "^23.3.0"
pytest = "^7.4.0"
pytest-timeout = "^2.1.0"
ruff = "^0.0.233"
ruff = "^0.0.277"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 98f791c

Please sign in to comment.