-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding linter check for commits #11
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: precommit-actions | ||
run-name: ${{ github.actor }} is running precommit actions. | ||
on: | ||
push: | ||
branches-ignore: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
build: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
# To report GitHub Actions status checks | ||
statuses: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
# super-linter needs the full git history to get the | ||
# list of files that changed across commits | ||
fetch-depth: 0 | ||
|
||
- name: Super-linter | ||
uses: super-linter/[email protected] # x-release-please-version | ||
env: | ||
DEFAULT_BRANCH: main | ||
# To report GitHub Actions status checks | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
IGNORE_GITIGNORED_FILES: true | ||
VALIDATE_ALL_CODEBASE: true | ||
VALIDATE_PYTHON_FLAKE8: true | ||
VALIDATE_HTML: true |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
APP_NAME = 'your-daily-dose-malware' | ||
APP_NAME = "your-daily-dose-malware" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import click | ||
|
||
|
||
@click.group(name='scraper') | ||
@click.group(name="scraper") | ||
def scraper(): | ||
"""Commands for scraping data from your daily dose malware.""" | ||
pass |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
import click | ||
from .commands.scraper import scraper | ||
from .commands.utils.retrieve_malware import all_most_recent, hundred_most_recent | ||
from .commands.utils.retrieve_malware import (all_most_recent, | ||
hundred_most_recent) | ||
from dotenv import load_dotenv | ||
import os | ||
|
||
load_dotenv() | ||
|
||
|
||
@click.command( | ||
help=""" | ||
Download eitheir hundred recent malwares uploaded within the last 60 min or all the recent malwares uploaded within the last 48 hours sha256 hash by using api from 'https://mb-api.abuse.ch/api/v1/' | ||
Download either hundred recent malware's uploaded within the last 60 min or | ||
all the recent malware's uploaded within the last 48 hours sha256 hash | ||
by using api from 'https://mb-api.abuse.ch/api/v1/' | ||
|
||
-s256 or --by-sha256: get the lastest sha256 hashes from 'https://bazaar.abuse.ch/export/txt/sha256/recent' save them in sha256_names.txt then for each file download all malwares in zip file | ||
-s256 or --by-sha256: get the most recent sha256 hashes from | ||
'https://bazaar.abuse.ch/export/txt/sha256/recent' save them in | ||
sha256_names.txt then for each file download all malware's in zip file | ||
|
||
-hr or --hundred-recent: get the lastest hundred recent malwares uploaded within the last 60 min | ||
""") | ||
@click.option('-s256','--by-sha256',is_flag=True) | ||
@click.option('-hr','--hundred-recent',is_flag=True) | ||
-hr or --hundred-recent: get the most recent hundred recent malware's | ||
uploaded within the last 60 min | ||
""" | ||
) | ||
@click.option("-s256", "--by-sha256", is_flag=True) | ||
@click.option("-hr", "--hundred-recent", is_flag=True) | ||
def run_scrapper(by_sha256, hundred_recent): | ||
headers = { | ||
'API-KEY':os.getenv('API_KEY') | ||
} | ||
headers = {"API-KEY": os.getenv("API_KEY")} | ||
if hundred_recent: | ||
hundred_most_recent(headers) | ||
elif by_sha256: | ||
all_most_recent(headers) | ||
else: | ||
click.echo(' No selector provided. Please use either by_sha256, hundred_recent as selector',) | ||
click.echo( | ||
" No selector provided. Please use either by_sha256, " | ||
"hundred_recent as selector", | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
scraper.add_command(run_scrapper) | ||
scraper() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This help will likely change once we start adding more backends.
This is very descriptive of Malware Bazaar but keep in mind this tool will likely use 8 or 9 different backends, so we wont be able to go into that much detail for each backend.