Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint_python.yml + Fixed Typos #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: lint_python
on: [pull_request, push]
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install bandit black codespell flake8 isort mypy pytest pyupgrade
- run: bandit --recursive --skip B101 . || true # B101 is assert statements
- run: black --check . || true
- run: codespell || true # --ignore-words-list="" --skip=""
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --show-source --statistics
- run: isort --check-only --profile black . || true
- run: pip install -r requirements.txt || true
- run: mypy --install-types --non-interactive . || true
- run: pytest . || true
- run: pytest --doctest-modules . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ There are currently two modes of execution: `Batch` and `Concurrent`.
**Required params:**

* `-t`: The Target Caldera Agent
* `-rf`: The relations file containg the ruleid to abilityid links
* `-rf`: The relations file containing the ruleid to abilityid links
* `-b`: Batch Mode Switch

**Example:**
Expand All @@ -100,7 +100,7 @@ python .\main.py -t rkersr -rf .\relations.json -b

* `-bc`: Switch that enables "Concurrent" execution type.
* `-t`: The Target Caldera Agent
* `-rf`: The relations file containg the ruleid to abilityid links
* `-rf`: The relations file containing the ruleid to abilityid links

**Example:**

Expand Down
4 changes: 2 additions & 2 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
- Changes functions to use rule_id instead of id
- Small improvements:
- Parsing of Ability files
- Reduced the ammount of the default output messages
- Reduced the amount of the default output messages
- Adds Pipfile
- Better handling of the output CSV file
- Remove hardcoded values for output
Expand All @@ -46,7 +46,7 @@
04/21/2021
------------
- Version 0.0.9
- Adds Paralel Batch Execution Capability
- Adds Parallel Batch Execution Capability
- Adds Logging Capabilities

03/26/2021
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setup_args():
parser.add_argument('-b', '--batch', action='store_true', help='Batch Execution of the tests on Rules specified in the relations file')
parser.add_argument('-bae', '--bypass_ability_execution', dest='bypass_ability_execution', action='store_true', help='Switch to bypass ability execution phase and directly query elastic.')
parser.add_argument('-ist', '--initial_sleep_time', type=int, default=120, help='Initial sleep time in seconds before making first call to elastic to check for detection...')
parser.add_argument('-ilt', '--initial_limit_time', type=int, default=300, help='Limit execution time in seconds before skiping to the next test')
parser.add_argument('-ilt', '--initial_limit_time', type=int, default=300, help='Limit execution time in seconds before skipping to the next test')
parser.add_argument('-si', '--sleep_interval', type=int, default=30, help='Sleep time in seconds before making calls after the first one, to elastic to check for detection...')
parser.add_argument('-rlt', '--rule_lookup_time', type=str, default="5m", help='Rule lookup time to check elastic rules triggered in the past. Eg: -rlt 5m...')
parser.add_argument('-aa', '--ability_args', help='Arguments that are required by advanced abilities to be passed as variables for successful execution. Eg: field_name=value,field_name_2=value_2,...')
Expand Down
4 changes: 2 additions & 2 deletions utils/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def generate_report(csvf, outputf, infof, logger):
pagesize=letter
)
all = list()
paragraph = ParagraphStyle('', aligment=10)
paragraph = ParagraphStyle('', alignment=10)
generate_pie(dt)
paragraph_1 = Paragraph("Result Percentage", ParagraphStyle('kk', fontSize=18, alignment=1), )
all.append(paragraph_1)
Expand All @@ -92,4 +92,4 @@ def generate_report(csvf, outputf, infof, logger):
tabf.close()
graphf.close()
os.remove("file.pdf")
os.remove("graph.pdf")
os.remove("graph.pdf")