synapse.models package
Subpackages
Submodules
synapse.models.auth module
synapse.models.base module
synapse.models.belief module
synapse.models.biz module
synapse.models.crypto module
synapse.models.dns module
- class synapse.models.dns.DnsName(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
synapse.models.economic module
synapse.models.files module
- class synapse.models.files.FileBase(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
- class synapse.models.files.FileBytes(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
- class synapse.models.files.FileModule(core, conf=None)[source]
Bases:
synapse.lib.module.CoreModule
- async initCoreModule()[source]
Module implementers may override this method to initialize the module after the Cortex has completed and is accessible to perform storage operations.
Notes
This is the preferred function to override for implementing custom code that needs to be executed during Cortex startup.
Any exception raised within this method will remove the module from the list of currently loaded modules.
This is called for modules after getModelDefs() and getStormCmds() has been called, in order to allow for model loading and storm command loading prior to code execution offered by initCoreModule.
A failure during initCoreModule will not unload data model or storm commands registered by the module.
- Returns
None
- class synapse.models.files.FilePath(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
synapse.models.geopol module
synapse.models.geospace module
- class synapse.models.geospace.Area(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Int
- class synapse.models.geospace.Dist(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Int
synapse.models.inet module
- class synapse.models.inet.Addr(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
- class synapse.models.inet.Cidr4(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
- class synapse.models.inet.Cidr6(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
- class synapse.models.inet.Email(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
- class synapse.models.inet.Fqdn(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Type
- repr(valu)[source]
Return a printable representation for the value. This may return a string or a tuple of values for display purposes.
- stortype: int = 17
- class synapse.models.inet.HttpCookie(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
- class synapse.models.inet.IPv4(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Type
The base type for an IPv4 address.
- repr(norm)[source]
Return a printable representation for the value. This may return a string or a tuple of values for display purposes.
- stortype: int = 4
- class synapse.models.inet.IPv4Range(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Range
- class synapse.models.inet.IPv6(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Type
- stortype: int = 18
- class synapse.models.inet.IPv6Range(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Range
- class synapse.models.inet.InetModule(core, conf=None)[source]
Bases:
synapse.lib.module.CoreModule
- async initCoreModule()[source]
Module implementers may override this method to initialize the module after the Cortex has completed and is accessible to perform storage operations.
Notes
This is the preferred function to override for implementing custom code that needs to be executed during Cortex startup.
Any exception raised within this method will remove the module from the list of currently loaded modules.
This is called for modules after getModelDefs() and getStormCmds() has been called, in order to allow for model loading and storm command loading prior to code execution offered by initCoreModule.
A failure during initCoreModule will not unload data model or storm commands registered by the module.
- Returns
None
- class synapse.models.inet.Rfc2822Addr(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
An RFC 2822 compatible email address parser
- class synapse.models.inet.Url(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
synapse.models.infotech module
- class synapse.models.infotech.Cpe22Str(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
CPE 2.2 Formatted String https://cpe.mitre.org/files/cpe-specification_2.2.pdf
- class synapse.models.infotech.Cpe23Str(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str
CPE 2.3 Formatted String
https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf (Section 6.2) cpe:2.3: part : vendor : product : version : update : edition : language : sw_edition : target_sw : target_hw : other * = "any" - = N/A
- class synapse.models.infotech.ItModule(core, conf=None)[source]
Bases:
synapse.lib.module.CoreModule
- bruteVersionStr(valu)[source]
Brute force the version out of a string.
- Parameters
valu (str) – String to attempt to get version information for.
Notes
This first attempts to parse strings using the it:semver normalization before attempting to extract version parts out of the string.
- Returns
The system normalized version integer and a subs dictionary.
- Return type
int, dict
- async initCoreModule()[source]
Module implementers may override this method to initialize the module after the Cortex has completed and is accessible to perform storage operations.
Notes
This is the preferred function to override for implementing custom code that needs to be executed during Cortex startup.
Any exception raised within this method will remove the module from the list of currently loaded modules.
This is called for modules after getModelDefs() and getStormCmds() has been called, in order to allow for model loading and storm command loading prior to code execution offered by initCoreModule.
A failure during initCoreModule will not unload data model or storm commands registered by the module.
- Returns
None
- class synapse.models.infotech.SemVer(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Int
Provides support for parsing a semantic version string into its component parts. This normalizes a version string into an integer to allow version ordering. Prerelease information is disregarded for integer comparison purposes, as we cannot map an arbitrary pre-release version into a integer value
Major, minor and patch levels are represented as integers, with a max width of 20 bits. The comparable integer value representing the semver is the bitwise concatenation of the major, minor and patch levels.
Prerelease and build information will be parsed out and available as strings if that information is present.
- synapse.models.infotech.chopCpe22(text)[source]
CPE 2.2 Formatted String https://cpe.mitre.org/files/cpe-specification_2.2.pdf
synapse.models.language module
synapse.models.material module
A data model focused on material objects.
synapse.models.media module
synapse.models.orgs module
synapse.models.person module
synapse.models.proj module
- class synapse.models.proj.ProjectModule(core, conf=None)[source]
Bases:
synapse.lib.module.CoreModule
- async initCoreModule()[source]
Module implementers may override this method to initialize the module after the Cortex has completed and is accessible to perform storage operations.
Notes
This is the preferred function to override for implementing custom code that needs to be executed during Cortex startup.
Any exception raised within this method will remove the module from the list of currently loaded modules.
This is called for modules after getModelDefs() and getStormCmds() has been called, in order to allow for model loading and storm command loading prior to code execution offered by initCoreModule.
A failure during initCoreModule will not unload data model or storm commands registered by the module.
- Returns
None
synapse.models.risk module
synapse.models.syn module
- class synapse.models.syn.SynModule(core, conf=None)[source]
Bases:
synapse.lib.module.CoreModule
- initCoreModule()[source]
Module implementers may override this method to initialize the module after the Cortex has completed and is accessible to perform storage operations.
Notes
This is the preferred function to override for implementing custom code that needs to be executed during Cortex startup.
Any exception raised within this method will remove the module from the list of currently loaded modules.
This is called for modules after getModelDefs() and getStormCmds() has been called, in order to allow for model loading and storm command loading prior to code execution offered by initCoreModule.
A failure during initCoreModule will not unload data model or storm commands registered by the module.
- Returns
None
synapse.models.telco module
- class synapse.models.telco.Imei(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Int
- class synapse.models.telco.Imsi(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Int
- class synapse.models.telco.Phone(modl, name, info, opts)[source]
Bases:
synapse.lib.types.Str