-
Notifications
You must be signed in to change notification settings - Fork 47
111 lines (89 loc) · 2.94 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Lint and check code for errors
on:
push:
branches:
- main
- dev
paths-ignore:
- 'Payload_Type/thanatos/Dockerfile'
pull_request:
branches:
- main
- dev
workflow_dispatch:
env:
THANATOS_PATH: Payload_Type/thanatos
AGENT_CODE: Payload_Type/thanatos/thanatos/agent_code
MYTHIC_CODE: Payload_Type/thanatos/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.AGENT_CODE }}
- name: Check Mythic code for errors
run: python -m pylint -f colorized --errors-only ${THANATOS_PATH}/*.py ${MYTHIC_CODE}/*.py
- name: Check Agent code for errors
working-directory: ${{ env.AGENT_CODE }}
run: cargo check --color always --all-targets --all-features
env:
UUID: ""
callback_interval: ""
callback_jitter: ""
encrypted_exchange_check: ""
connection_retries: ""
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.AGENT_CODE }}
- name: Check Mythic code formatting
run: python -m black --color --diff --check ${THANATOS_PATH}/*.py ${MYTHIC_CODE}/*.py
- name: Check Agent code formatting
working-directory: ${{ env.AGENT_CODE }}
run: cargo fmt -- --color always --check
env:
UUID: ""
callback_interval: ""
callback_jitter: ""
encrypted_exchange_check: ""
connection_retries: ""
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.AGENT_CODE }}
- name: Install Clippy
run: rustup component add clippy
- name: Lint Mythic code with pylint
run: python -m pylint -f colorized --rcfile ${THANATOS_PATH}/pylintrc ${THANATOS_PATH}/*.py ${MYTHIC_CODE}/*.py
- name: Lint Agent code with clippy
working-directory: ${{ env.AGENT_CODE }}
run: cargo clippy --color always --all-features --all-targets -- -D warnings
env:
UUID: ""
callback_interval: ""
callback_jitter: ""
encrypted_exchange_check: ""
connection_retries: ""
working_hours: ""