refactor: revert dev branch back to known good state #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and check code for errors | |
on: | |
push: | |
branches: | |
- dev | |
paths: | |
- Payload_Type/thanatos/thanatos/agent_code | |
- Payload_Type/thanatos/**.py | |
pull_request: | |
branches: | |
- main | |
- dev | |
paths: | |
- Payload_Type/thanatos/thanatos/agent_code | |
- Payload_Type/thanatos/**.py | |
workflow_call: | |
env: | |
THANATOS_PATH: Payload_Type/thanatos | |
AGENT_CODE: thanatos/agent_code | |
MYTHIC_CODE: thanatos/mythic/agent_functions | |
jobs: | |
syntax: | |
name: Check Syntax | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: ./.github/actions/setup-lint | |
with: | |
python-requirements: ${{ env.THANATOS_PATH }}/requirements.txt | |
agent-code: ${{ env.THANATOS_PATH }}/${{ env.AGENT_CODE }} | |
- name: Check Mythic code for errors | |
working-directory: ${{ env.THANATOS_PATH }} | |
run: python -m pylint --rcfile pylintrc -f colorized --errors-only main.py ${MYTHIC_CODE}/*.py | |
- name: Check Agent code for errors | |
working-directory: ${{ env.THANATOS_PATH }}/${{ env.AGENT_CODE }} | |
run: cargo check --color always --all-targets --all-features | |
env: | |
RUSTFLAGS: "--cfg http" | |
UUID: "" | |
AESPSK: "" | |
callback_host: "" | |
callback_interval: "" | |
callback_jitter: "" | |
callback_port: "" | |
connection_retries: "" | |
encrypted_exchange_check: "" | |
get_uri: "" | |
headers: "" | |
post_uri: "" | |
working_hours: "" | |
format: | |
name: Check Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: ./.github/actions/setup-lint | |
with: | |
python-requirements: ${{ env.THANATOS_PATH }}/requirements.txt | |
agent-code: ${{ env.THANATOS_PATH }}/${{ env.AGENT_CODE }} | |
- name: Check Mythic code formatting | |
working-directory: ${{ env.THANATOS_PATH }} | |
run: python -m black --color --diff --check main.py ${MYTHIC_CODE}/*.py | |
- name: Check Agent code formatting | |
working-directory: ${{ env.THANATOS_PATH }}/${{ env.AGENT_CODE }} | |
run: cargo fmt -- --color always --check | |
env: | |
RUSTFLAGS: "--cfg http" | |
UUID: "" | |
AESPSK: "" | |
callback_host: "" | |
callback_interval: "" | |
callback_jitter: "" | |
callback_port: "" | |
connection_retries: "" | |
encrypted_exchange_check: "" | |
get_uri: "" | |
headers: "" | |
post_uri: "" | |
working_hours: "" | |
lint: | |
name: Lint Code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: ./.github/actions/setup-lint | |
with: | |
python-requirements: ${{ env.THANATOS_PATH }}/requirements.txt | |
agent-code: ${{ env.THANATOS_PATH }}/${{ env.AGENT_CODE }} | |
- name: Install Clippy | |
run: rustup component add clippy | |
- name: Lint Mythic code with pylint | |
working-directory: ${{ env.THANATOS_PATH }} | |
run: python -m pylint --rcfile pylintrc -f colorized main.py ${MYTHIC_CODE}/*.py | |
- name: Lint Agent code with clippy | |
working-directory: ${{ env.THANATOS_PATH }}/${{ env.AGENT_CODE }} | |
run: cargo clippy --color always --all-features --all-targets -- -D warnings | |
env: | |
RUSTFLAGS: "--cfg http" | |
UUID: "" | |
AESPSK: "" | |
callback_host: "" | |
callback_interval: "" | |
callback_jitter: "" | |
callback_port: "" | |
connection_retries: "" | |
encrypted_exchange_check: "" | |
get_uri: "" | |
headers: "" | |
post_uri: "" | |
working_hours: "" |