This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
forked from intelowlproject/IntelOwl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Playbook choice for pivot and ingestor (intelowlproject#2411)
* As title Signed-off-by: 0ssigeno <s.berni@certego.net> * Blake Signed-off-by: 0ssigeno <s.berni@certego.net> * Fixes Signed-off-by: 0ssigeno <s.berni@certego.net> * Fix tests Signed-off-by: 0ssigeno <s.berni@certego.net> * Fixes Signed-off-by: 0ssigeno <s.berni@certego.net> * Fixes Signed-off-by: 0ssigeno <s.berni@certego.net> * Fixes Signed-off-by: 0ssigeno <s.berni@certego.net> * Fix migrations after rebase Signed-off-by: 0ssigeno <s.berni@certego.net> --------- Signed-off-by: 0ssigeno <s.berni@certego.net>
- Loading branch information
1 parent
e75741d
commit 0d50418
Showing
25 changed files
with
412 additions
and
97 deletions.
There are no files selected for viewing
170 changes: 170 additions & 0 deletions
170
...nalyzers_manager/migrations/0105_alter_analyzerconfig_not_supported_filetypes_and_more.py
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,170 @@ | ||
# Generated by Django 4.2.11 on 2024-07-09 07:50 | ||
|
||
from django.db import migrations, models | ||
|
||
import api_app.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("analyzers_manager", "0104_analyzer_config_goresym"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="analyzerconfig", | ||
name="not_supported_filetypes", | ||
field=api_app.fields.ChoiceArrayField( | ||
base_field=models.CharField( | ||
choices=[ | ||
("application/w-script-file", "Wscript"), | ||
("application/javascript", "Javascript1"), | ||
("application/x-javascript", "Javascript2"), | ||
("text/javascript", "Javascript3"), | ||
("application/x-vbscript", "Vb Script"), | ||
("text/x-ms-iqy", "Iqy"), | ||
("application/vnd.android.package-archive", "Apk"), | ||
("application/x-dex", "Dex"), | ||
("application/onenote", "One Note"), | ||
("application/zip", "Zip1"), | ||
("multipart/x-zip", "Zip2"), | ||
("application/java-archive", "Java"), | ||
("text/rtf", "Rtf1"), | ||
("application/rtf", "Rtf2"), | ||
("application/x-sharedlib", "Shared Lib"), | ||
("application/vnd.microsoft.portable-executable", "Exe"), | ||
("application/x-elf", "Elf"), | ||
("application/octet-stream", "Octet"), | ||
("application/vnd.tcpdump.pcap", "Pcap"), | ||
("application/pdf", "Pdf"), | ||
("text/html", "Html"), | ||
("application/x-mspublisher", "Pub"), | ||
("application/vnd.ms-excel.addin.macroEnabled", "Excel Macro1"), | ||
( | ||
"application/vnd.ms-excel.sheet.macroEnabled.12", | ||
"Excel Macro2", | ||
), | ||
("application/vnd.ms-excel", "Excel1"), | ||
("application/excel", "Excel2"), | ||
( | ||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
"Doc", | ||
), | ||
("application/xml", "Xml1"), | ||
("text/xml", "Xml2"), | ||
("application/encrypted", "Encrypted"), | ||
("text/plain", "Plain"), | ||
("text/csv", "Csv"), | ||
( | ||
"application/vnd.openxmlformats-officedocument.presentationml.presentation", | ||
"Pptx", | ||
), | ||
("application/msword", "Word1"), | ||
( | ||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", | ||
"Word2", | ||
), | ||
("application/vnd.ms-powerpoint", "Powerpoint"), | ||
("application/vnd.ms-office", "Office"), | ||
("application/x-binary", "Binary"), | ||
("application/x-macbinary", "Mac1"), | ||
("application/mac-binary", "Mac2"), | ||
("application/x-mach-binary", "Mac3"), | ||
("application/x-zip-compressed", "Compress1"), | ||
("application/x-compressed", "Compress2"), | ||
("application/vnd.ms-outlook", "Outlook"), | ||
("message/rfc822", "Eml"), | ||
("application/pkcs7-signature", "Pkcs7"), | ||
("application/x-pkcs7-signature", "Xpkcs7"), | ||
("multipart/mixed", "Mixed"), | ||
("text/x-shellscript", "X Shellscript"), | ||
("application/x-chrome-extension", "Crx"), | ||
("application/json", "Json"), | ||
("application/x-executable", "Executable"), | ||
], | ||
max_length=90, | ||
), | ||
blank=True, | ||
default=list, | ||
size=None, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="analyzerconfig", | ||
name="supported_filetypes", | ||
field=api_app.fields.ChoiceArrayField( | ||
base_field=models.CharField( | ||
choices=[ | ||
("application/w-script-file", "Wscript"), | ||
("application/javascript", "Javascript1"), | ||
("application/x-javascript", "Javascript2"), | ||
("text/javascript", "Javascript3"), | ||
("application/x-vbscript", "Vb Script"), | ||
("text/x-ms-iqy", "Iqy"), | ||
("application/vnd.android.package-archive", "Apk"), | ||
("application/x-dex", "Dex"), | ||
("application/onenote", "One Note"), | ||
("application/zip", "Zip1"), | ||
("multipart/x-zip", "Zip2"), | ||
("application/java-archive", "Java"), | ||
("text/rtf", "Rtf1"), | ||
("application/rtf", "Rtf2"), | ||
("application/x-sharedlib", "Shared Lib"), | ||
("application/vnd.microsoft.portable-executable", "Exe"), | ||
("application/x-elf", "Elf"), | ||
("application/octet-stream", "Octet"), | ||
("application/vnd.tcpdump.pcap", "Pcap"), | ||
("application/pdf", "Pdf"), | ||
("text/html", "Html"), | ||
("application/x-mspublisher", "Pub"), | ||
("application/vnd.ms-excel.addin.macroEnabled", "Excel Macro1"), | ||
( | ||
"application/vnd.ms-excel.sheet.macroEnabled.12", | ||
"Excel Macro2", | ||
), | ||
("application/vnd.ms-excel", "Excel1"), | ||
("application/excel", "Excel2"), | ||
( | ||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
"Doc", | ||
), | ||
("application/xml", "Xml1"), | ||
("text/xml", "Xml2"), | ||
("application/encrypted", "Encrypted"), | ||
("text/plain", "Plain"), | ||
("text/csv", "Csv"), | ||
( | ||
"application/vnd.openxmlformats-officedocument.presentationml.presentation", | ||
"Pptx", | ||
), | ||
("application/msword", "Word1"), | ||
( | ||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", | ||
"Word2", | ||
), | ||
("application/vnd.ms-powerpoint", "Powerpoint"), | ||
("application/vnd.ms-office", "Office"), | ||
("application/x-binary", "Binary"), | ||
("application/x-macbinary", "Mac1"), | ||
("application/mac-binary", "Mac2"), | ||
("application/x-mach-binary", "Mac3"), | ||
("application/x-zip-compressed", "Compress1"), | ||
("application/x-compressed", "Compress2"), | ||
("application/vnd.ms-outlook", "Outlook"), | ||
("message/rfc822", "Eml"), | ||
("application/pkcs7-signature", "Pkcs7"), | ||
("application/x-pkcs7-signature", "Xpkcs7"), | ||
("multipart/mixed", "Mixed"), | ||
("text/x-shellscript", "X Shellscript"), | ||
("application/x-chrome-extension", "Crx"), | ||
("application/json", "Json"), | ||
("application/x-executable", "Executable"), | ||
], | ||
max_length=90, | ||
), | ||
blank=True, | ||
default=list, | ||
size=None, | ||
), | ||
), | ||
] |
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
28 changes: 28 additions & 0 deletions
28
...p/ingestors_manager/migrations/0023_remove_ingestorconfig_playbook_to_execute_and_more.py
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,28 @@ | ||
# Generated by Django 4.2.11 on 2024-07-09 07:50 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def migrate(apps, schema_editor): | ||
IngestorConfig = apps.get_model("ingestors_manager", "IngestorConfig") | ||
for ingestor in IngestorConfig.objects.all(): | ||
ingestor.playbooks_choice.set([ingestor.playbook_to_execute]) | ||
ingestor.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("playbooks_manager", "0050_add_goresym_to_sample_static_abalysis"), | ||
("ingestors_manager", "0022_ingestor_fix_duplicated_users"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="ingestorconfig", | ||
name="playbooks_choice", | ||
field=models.ManyToManyField( | ||
related_name="ingestors", to="playbooks_manager.playbookconfig" | ||
), | ||
), | ||
migrations.RunPython(migrate, reverse_code=migrations.RunPython.noop), | ||
] |
19 changes: 19 additions & 0 deletions
19
api_app/ingestors_manager/migrations/0024_remove_ingestorconfig_playbook_to_execute.py
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,19 @@ | ||
# Generated by Django 4.2.11 on 2024-07-09 08:22 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
( | ||
"ingestors_manager", | ||
"0023_remove_ingestorconfig_playbook_to_execute_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="ingestorconfig", | ||
name="playbook_to_execute", | ||
), | ||
] |
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
Oops, something went wrong.