Skip to content

Commit ea3262c

Browse files
committed
gis-9379 add new endpoint /iocs/generate
1 parent 0236ff1 commit ea3262c

File tree

1 file changed

+7
-7
lines changed
  • uncoder-core/app/translator/tools

1 file changed

+7
-7
lines changed

uncoder-core/app/translator/tools/const.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import typing
1+
from typing import get_args, Literal
22

33
IP_IOC_REGEXP_PATTERN = r"(?:^|[ \/\[(\"',;>|])((?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2})){3})(?=[\s)\]\"',;:\/?\n<|]|$)" # noqa: E501
44
DOMAIN_IOC_REGEXP_PATTERN = r"(?:^|[\s\/\[\]@(\"',;{>|])(?:(?:http[s]?|ftp):\/\/?)?([^:\\\/\s({\[\]@\"'`,]+\.[a-zA-Z]+)(?:(?:(?:[/|:]\w+)*\/)(?:[\w\-.]+[^#?\s]+)?(?:[\w/\-&?=%.#]+(?:\(\))?)?)?(?=[\s)\]\"',;<|]|$)" # noqa: E501
55
URL_IOC_REGEXP_PATTERN = r"(?:^|[\s\/\[\]@(\"',;{>|])((?:(?:http[s]?|ftp):\/\/?)+(?:[^:\\\/\s({\[\]@\"'`,]+\.[a-zA-Z0-9]+)(?:(?:(?:[/|:]\w+)*\/)(?:[\w\-.]+[^#?\s<']+)?(?:[\w/\-&?=%.#]+(?:\(\))?)?)?)(?=[\s)\]\"',;<|]|$)" # noqa: E501
66

7-
IOCType = typing.Literal["ip", "domain", "url", "hash"]
8-
HashType = typing.Literal["md5", "sha1", "sha256", "sha512"]
9-
IocParsingRule = typing.Literal["replace_dots", "remove_private_and_reserved_ips", "replace_hxxp"]
7+
IOCType = Literal["ip", "domain", "url", "hash"]
8+
HashType = Literal["md5", "sha1", "sha256", "sha512"]
9+
IocParsingRule = Literal["replace_dots", "remove_private_and_reserved_ips", "replace_hxxp"]
1010

11-
DefaultIOCType = list(typing.get_args(IOCType))
12-
DefaultHashType = list(typing.get_args(HashType))
13-
DefaultIocParsingRule = list(typing.get_args(IocParsingRule))
11+
DefaultIOCType = list(get_args(IOCType))
12+
DefaultHashType = list(get_args(HashType))
13+
DefaultIocParsingRule = list(get_args(IocParsingRule))
1414

1515
HASH_MAP = {"md5": "HashMd5", "sha1": "HashSha1", "sha256": "HashSha256", "sha512": "HashSha512"}
1616

0 commit comments

Comments
 (0)