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

changes to the mappings (dev) #1897

Open
wants to merge 4 commits into
base: dev
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
4 changes: 2 additions & 2 deletions assemblyline/odm/models/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class File(odm.Model):
name = odm.Keyword(copyto="__text__", description="The original name of the file as submitted.")
sha1 = odm.SHA1(copyto="__text__", description="The SHA1 hash of the file.")
sha256 = odm.SHA256(copyto="__text__", description="The SHA256 hash of the file.")
size = odm.Integer(store=False, description="The size of the file in bytes.")
size = odm.long(store=False, description="The size of the file in bytes.")
type = odm.Keyword(copyto="__text__", description=" The file type as identified by Assemblyline's analysis.")
screenshots = odm.List(odm.Compound(Screenshot), default=[], description="Screenshots taken of the file during analysis, if applicable.")

Expand Down Expand Up @@ -202,7 +202,7 @@ class Alert(odm.Model):
filtered = odm.Boolean(default=False, description="Indicates whether portions of the submission's analysis results have been omitted due to the user's classification level not meeting the required threshold for viewing certain data.")
heuristic = odm.Compound(Heuristic, description="Data regarding the heuristics that triggered the alert.")
label = odm.List(odm.Keyword(), copyto="__text__", default=[], description="Labels assigned to the alert for categorization and filtering.")
metadata = odm.FlattenedObject(default={}, store=False, description="Additional metadata provided with the file at the time of submission.")
metadata = odm.Mapping(odm.wildcard(), copyto="__text__", default={}, store=False, description="Additional metadata provided with the file at the time of submission.")
owner = odm.Optional(odm.Keyword(), description="Specifies the user or system component that has taken ownership of the alert. If no user has claimed the alert, it remains under system ownership with no specific user associated, indicated by a value of `None`.")
priority = odm.Optional(odm.Enum(values=PRIORITIES), description="Indicates the importance level assigned to the alert.")
reporting_ts = odm.Date(description="Timestamp when the alert was created.")
Expand Down
2 changes: 1 addition & 1 deletion assemblyline/odm/models/badlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Hashes(odm.Model):
class File(odm.Model):
name = odm.List(odm.Keyword(store=True, copyto="__text__"), default=[],
description="List of names seen for that file")
size = odm.Optional(odm.Integer(), description="Size of the file in bytes")
size = odm.Optional(odm.long(), description="Size of the file in bytes")
type = odm.Optional(odm.Keyword(), description="Type of file as identified by Assemblyline")


Expand Down
2 changes: 1 addition & 1 deletion assemblyline/odm/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class File(odm.Model):
seen = odm.Compound(Seen, default={}, description="Records the frequency and timestamps of when the file was encountered.", ai=False)
sha1 = odm.SHA1(copyto="__text__", description="The SHA1 hash of the file, providing a more secure alternative to MD5 for integrity checks.", ai=False)
sha256 = odm.SHA256(copyto="__text__", description="The SHA256 hash of the file, offering a high level of security for integrity verification.")
size = odm.Integer(description="Size of the file in bytes.")
size = odm.long(description="Size of the file in bytes.")
ssdeep = odm.SSDeepHash(store=False, description="The fuzzy hash of the file using SSDEEP, which is useful for identifying similar files.", ai=False)
type = odm.Keyword(copyto="__text__", description="The file type as determined by the AssemblyLine file type identification service.")
tlsh = odm.Optional(odm.Keyword(copyto="__text__"), description="A locality-sensitive hash (TLSH) of the file's content, useful for similarity comparisons.", ai=False)
Expand Down
2 changes: 1 addition & 1 deletion assemblyline/odm/models/safelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Hashes(odm.Model):
class File(odm.Model):
name = odm.List(odm.Keyword(store=True, copyto="__text__"), default=[],
description="List of names seen for that file")
size = odm.Optional(odm.Integer(), description="Size of the file in bytes")
size = odm.Optional(odm.long(), description="Size of the file in bytes")
type = odm.Optional(odm.Keyword(), description="Type of file as identified by Assemblyline")


Expand Down
2 changes: 1 addition & 1 deletion assemblyline/odm/models/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@odm.model(index=True, store=True)
class Signature(odm.Model):
classification = odm.Classification(store=True, default=Classification.UNRESTRICTED)
data = odm.Text(index=False, store=False)
data = odm.Text(copyto="__text__", store=False)
last_modified = odm.Date(default="NOW")
name = odm.Keyword(copyto="__text__")
order = odm.Integer(default=1, store=False)
Expand Down
6 changes: 3 additions & 3 deletions assemblyline/odm/models/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@odm.model(index=True, store=False, description="File Model of Submission")
class File(odm.Model):
name = odm.Keyword(copyto="__text__", description="Name of the file")
size = odm.Optional(odm.Integer(), description="Size of the file in bytes")
size = odm.Optional(odm.long(), description="Size of the file in bytes")
sha256 = odm.SHA256(copyto="__text__", description="SHA256 hash of the file")


Expand Down Expand Up @@ -140,9 +140,9 @@ class Submission(odm.Model):
file_count = odm.Integer(description="Total number of files in the submission", ai=False)
files: list[File] = odm.List(odm.Compound(File), description="List of files that were originally submitted")
max_score = odm.Integer(description="Maximum score of all the files in the scan")
metadata = odm.FlattenedObject(store=False, description="Metadata associated to the submission")
metadata = odm.Mapping(odm.wildcard(), copyto="__text__", store=False, description="Metadata associated to the submission")
params: SubmissionParams = odm.Compound(SubmissionParams, description="Submission parameter details", ai=False)
results: list[str] = odm.List(odm.Keyword(), store=False, description="List of result keys", ai=False)
results: list[str] = odm.List(odm.wildcard(), store=False, description="List of result keys", ai=False)
sid: str = odm.UUID(copyto="__text__", description="Submission ID")
state = odm.Enum(values=SUBMISSION_STATES, description="Status of the submission", ai=False)
to_be_deleted = odm.Boolean(
Expand Down