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

fixed dashboard backend unittest #187

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
111 changes: 62 additions & 49 deletions .github/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please refer to https://khulnasoft.github.io/docs/ThreatMatrix/contribute/
Please refer to https://khulnasoft.github.io/devsec-docs/ThreatMatrix/contribute/
3 changes: 2 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
patreon: khulnasoft
open_collective: threatmatrix-project
github: khulnasoft
38 changes: 31 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ updates:
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "dependabot-validation"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
Expand All @@ -31,7 +31,7 @@ updates:
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "dependabot-validation"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
Expand All @@ -43,7 +43,19 @@ updates:
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "dependabot-validation"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
- dependency-name: "*"
update-types: [ "version-update:semver-patch" ]

- package-ecosystem: "pip"
directory: "/integrations/phishing_analyzers"
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
Expand Down Expand Up @@ -76,7 +88,7 @@ updates:
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "dependabot-validation"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
Expand All @@ -88,7 +100,7 @@ updates:
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "dependabot-validation"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
Expand All @@ -100,7 +112,7 @@ updates:
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "dependabot-validation"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
Expand All @@ -112,7 +124,19 @@ updates:
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "dependabot-validation"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
- dependency-name: "*"
update-types: ["version-update:semver-patch"]

- package-ecosystem: "docker"
directory: "/integrations/phishing_analyzers"
schedule:
interval: "weekly"
day: "tuesday"
target-branch: "develop"
ignore:
# ignore all patch updates since we are using ~=
# this does not work for security updates
Expand Down
16 changes: 8 additions & 8 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ Please delete options that are not relevant.

# Checklist

- [ ] I have read and understood the rules about [how to Contribute](https://khulnasoft.github.io/docs/ThreatMatrix/contribute/) to this project
- [ ] I have read and understood the rules about [how to Contribute](https://khulnasoft.github.io/devsec-docs/ThreatMatrix/contribute/) to this project
- [ ] The pull request is for the branch `develop`
- [ ] A new plugin (analyzer, connector, visualizer, playbook, pivot or ingestor) was added or changed, in which case:
- [ ] I strictly followed the documentation ["How to create a Plugin"](https://khulnasoft.github.io/docs/ThreatMatrix/contribute/#how-to-add-a-new-plugin)
- [ ] [Usage](https://github.com/khulnasoft/docs/blob/main/docs/ThreatMatrix/usage.md) file was updated.
- [ ] [Advanced-Usage](https://github.com/khulnasoft/docs/blob/main/docs/ThreatMatrix/advanced_usage.md) was updated (in case the plugin provides additional optional configuration).
- [ ] I have dumped the configuration from Django Admin using the `dumpplugin` command and added it in the project as a data migration. (["How to share a plugin with the community"](https://khulnasoft.github.io/docs/ThreatMatrix/contribute/#how-to-share-your-plugin-with-the-community))
- [ ] I strictly followed the documentation ["How to create a Plugin"](https://khulnasoft.github.io/devsec-docs/ThreatMatrix/contribute/#how-to-add-a-new-plugin)
- [ ] [Usage](https://github.com/khulnasoft/docs/blob/main/docs/ThreatMatrix/usage.md) file was updated. A link to the PR to the [docs](https://github.com/khulnasoft/docs) repo has been added as a comment here.
- [ ] [Advanced-Usage](https://github.com/khulnasoft/docs/blob/main/docs/ThreatMatrix/advanced_usage.md) was updated (in case the plugin provides additional optional configuration). A link to the PR to the [docs](https://github.com/khulnasoft/docs) repo has been added as a comment here.
- [ ] I have dumped the configuration from Django Admin using the `dumpplugin` command and added it in the project as a data migration. (["How to share a plugin with the community"](https://khulnasoft.github.io/devsec-docs/ThreatMatrix/contribute/#how-to-share-your-plugin-with-the-community))
- [ ] If a File analyzer was added and it supports a mimetype which is not already supported, you added a sample of that type inside the archive `test_files.zip` and you added the default tests for that mimetype in [test_classes.py](https://github.com/khulnasoft/ThreatMatrix/blob/master/tests/api_app/analyzers_manager/test_classes.py).
- [ ] If you created a new analyzer and it is free (does not require any API key), please add it in the `FREE_TO_USE_ANALYZERS` playbook by following [this guide](https://khulnasoft.github.io/docs/ThreatMatrix/contribute/#how-to-modify-a-plugin).
- [ ] Check if it could make sense to add that analyzer/connector to other [freely available playbooks](https://khulnasoft.github.io/docs/ThreatMatrix/usage/#list-of-pre-built-playbooks).
- [ ] If you created a new analyzer and it is free (does not require any API key), please add it in the `FREE_TO_USE_ANALYZERS` playbook by following [this guide](https://khulnasoft.github.io/devsec-docs/ThreatMatrix/contribute/#how-to-modify-a-plugin).
- [ ] Check if it could make sense to add that analyzer/connector to other [freely available playbooks](https://khulnasoft.github.io/devsec-docs/ThreatMatrix/usage/#list-of-pre-built-playbooks).
- [ ] I have provided the resulting raw JSON of a finished analysis and a screenshot of the results.
- [ ] If the plugin interacts with an external service, I have created an attribute called precisely `url` that contains this information. This is required for Health Checks.
- [ ] If the plugin requires mocked testing, `_monkeypatch()` was used in its class to apply the necessary decorators.
- [ ] I have added that raw JSON sample to the `MockUpResponse` of the `_monkeypatch()` method. This serves us to provide a valid sample for testing.
- [ ] If external libraries/packages with restrictive licenses were used, they were added in the [Legal Notice](https://github.com/certego/ThreatMatrix/blob/master/.github/legal_notice.md) section.
- [ ] Linters (`Black`, `Flake`, `Isort`) gave 0 errors. If you have correctly installed [pre-commit](https://khulnasoft.github.io/docs/ThreatMatrix/contribute/#how-to-start-setup-project-and-development-instance), it does these checks and adjustments on your behalf.
- [ ] Linters (`Black`, `Flake`, `Isort`) gave 0 errors. If you have correctly installed [pre-commit](https://khulnasoft.github.io/devsec-docs/ThreatMatrix/contribute/#how-to-start-setup-project-and-development-instance), it does these checks and adjustments on your behalf.
- [ ] I have added tests for the feature/bug I solved (see `tests` folder). All the tests (new and old ones) gave 0 errors.
- [ ] If the GUI has been modified:
- [ ] I have a provided a screenshot of the result in the PR.
Expand Down
12 changes: 7 additions & 5 deletions .github/release_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Checklist for creating a new release

- [ ] (optional) If we changed/added Docker Analyzers, we need to configure Docker Hub / Dependabot properly.
- [ ] Update `CHANGELOG.md` for the new version
- [ ] If we changed/added Docker Analyzers, we need to configure Docker Hub / Dependabot properly.
- [ ] I have already checked if all Dependabot issues have been solved before creating this PR.
- [ ] Update `CHANGELOG.md` for the new version. Tag another maintainer to review the Changelog and wait for their feedback.
- [ ] Change version number `docker/.env`
- [ ] Verify CI Tests
- [ ] Create release for the branch `develop`.
- [ ] Create release for the branch `develop`. Remember to prepend a `v` to the version number.
Write the following statement there (change the version number):

```commandline
Expand All @@ -16,7 +17,8 @@ WARNING: The release will be live within an hour!
- [ ] Wait for [dockerHub](https://hub.docker.com/repository/docker/khulnasoft/threatmatrix) to finish the builds
- [ ] Merge the PR to the `master` branch. **Note:** Only use "Merge and commit" as the merge strategy and not "Squash and merge". Using "Squash and merge" makes history between branches misaligned.
- [ ] Remove the "wait" statement in the release description.
- [ ] Publish new Post into official Twitter and LinkedIn accounts:
- [ ] Publish new Post into official Twitter and LinkedIn accounts (change the version number):
```commandline
published #ThreatMatrix vX.X.X! https://github.com/khulnasoft/ThreatMatrix/releases/tag/vX.X.X #ThreatIntelligence #CyberSecurity #OpenSource #OSINT #DFIR
```
```
- [ ] If that was a major release or an important release, communicate the news to the marketing staff
8 changes: 3 additions & 5 deletions .github/workflows/pull_request_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,10 @@ jobs:
BUILDKIT_PROGRESS: "plain"
STAGE: "ci"
REPO_DOWNLOADER_ENABLED: false
- name: Run Startup Script (Master Branch Only)
if: github.base_ref == 'master'

- name: Startup script launch (Fast)
if: "!contains(github.base_ref, 'master')"
run: |
echo "Starting CI build on 'master' branch"
set -e # Exit on error
./start ci up -- --build -d
env:
DOCKER_BUILDKIT: 1
Expand Down
Loading
Loading