fix: Cloudflare module always returning True

pull/664/head
Raphaël Vinot 2023-04-12 14:05:05 +02:00
parent 4ceae60db7
commit c7d3e54edf
4 changed files with 24 additions and 23 deletions

View File

@ -556,7 +556,7 @@ class CapturesIndex(Mapping):
for ip in _all_ips:
if ip in ipasn:
ipasn_entries[ip] = ipasn[ip]
if ip in cflare_hits:
if ip in cflare_hits and cflare_hits[ip] is True:
cflare_entries[ip] = True
if ipasn_entries:

View File

@ -159,6 +159,7 @@ class Lookyloo():
# We need a redis connector that doesn't decode.
redis: Redis = Redis(unix_socket_path=get_socket_path('cache'))
self._lacus = LacusCore(redis, tor_proxy=get_config('generic', 'tor_proxy'),
max_capture_time=get_config('generic', 'max_capture_time'),
only_global_lookups=get_config('generic', 'only_global_lookups'),
loglevel=get_config('generic', 'loglevel'))
return self._lacus

40
poetry.lock generated
View File

@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
[[package]]
name = "aiohttp"
@ -1081,14 +1081,14 @@ files = [
[[package]]
name = "importlib-metadata"
version = "6.2.0"
version = "6.3.0"
description = "Read metadata from Python packages"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
{file = "importlib_metadata-6.2.0-py3-none-any.whl", hash = "sha256:8388b74023a138c605fddd0d47cb81dd706232569f56c9aca7d9c7fdb54caeba"},
{file = "importlib_metadata-6.2.0.tar.gz", hash = "sha256:9127aad2f49d7203e7112098c12b92e4fd1061ccd18548cdfdc49171a8c073cc"},
{file = "importlib_metadata-6.3.0-py3-none-any.whl", hash = "sha256:8f8bd2af397cf33bd344d35cfe7f489219b7d14fc79a3f854b75b8417e9226b0"},
{file = "importlib_metadata-6.3.0.tar.gz", hash = "sha256:23c2bcae4762dfb0bbe072d358faec24957901d75b6c4ab11172c0c982532402"},
]
[package.dependencies]
@ -1232,19 +1232,19 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-
[[package]]
name = "lacuscore"
version = "1.4.2"
version = "1.4.8"
description = "Core of Lacus, usable as a module"
category = "main"
optional = false
python-versions = ">=3.8,<4.0"
files = [
{file = "lacuscore-1.4.2-py3-none-any.whl", hash = "sha256:ed454ed5808bb0b00983622484e159cf06a51b9110094e01b26d630d56b9a801"},
{file = "lacuscore-1.4.2.tar.gz", hash = "sha256:47e2022cb3f99706af7c579239aa6a52da7576b46eeea042adc1910056c029d1"},
{file = "lacuscore-1.4.8-py3-none-any.whl", hash = "sha256:89b357325f7781d7ca97e8e0e584661927ff7ca85b1be7861640dca406874e31"},
{file = "lacuscore-1.4.8.tar.gz", hash = "sha256:d63734c2e46871b50de025a61d2193183471532f148addb551f31564d6342a49"},
]
[package.dependencies]
defang = ">=0.5.3,<0.6.0"
playwrightcapture = {version = ">=1.19.1,<2.0.0", extras = ["recaptcha"]}
playwrightcapture = {version = ">=1.19.9,<2.0.0", extras = ["recaptcha"]}
redis = {version = ">=4.5.4,<5.0.0", extras = ["hiredis"]}
requests = ">=2.28.2,<3.0.0"
ua-parser = ">=0.16.1,<0.17.0"
@ -1900,18 +1900,18 @@ typing-extensions = {version = "*", markers = "python_version <= \"3.8\""}
[[package]]
name = "playwrightcapture"
version = "1.19.1"
version = "1.19.9"
description = "A simple library to capture websites using playwright"
category = "main"
optional = false
python-versions = ">=3.8,<4.0"
files = [
{file = "playwrightcapture-1.19.1-py3-none-any.whl", hash = "sha256:95f669d30fedbfb73411edeef1860ca304fb7658ca534aad0e18ecd41f429118"},
{file = "playwrightcapture-1.19.1.tar.gz", hash = "sha256:cc8de71b5528b07cd7f68c864c5ca3a337449b2b304f7244a6932a5bfbce3ed5"},
{file = "playwrightcapture-1.19.9-py3-none-any.whl", hash = "sha256:621ffaefd9a2e80f9036cd64291d66196f16397dc8f987f0c938309b5a76086b"},
{file = "playwrightcapture-1.19.9.tar.gz", hash = "sha256:4047ab6a0392cd1004279d09e4df509bcced304189a680400f6332039fbeabeb"},
]
[package.dependencies]
beautifulsoup4 = ">=4.12.0,<5.0.0"
beautifulsoup4 = ">=4.12.2,<5.0.0"
dateparser = ">=1.1.8,<2.0.0"
lxml = ">=4.9.2,<5.0.0"
playwright = ">=1.32.1,<2.0.0"
@ -2072,14 +2072,14 @@ files = [
[[package]]
name = "pygments"
version = "2.14.0"
version = "2.15.0"
description = "Pygments is a syntax highlighting package written in Python."
category = "main"
optional = false
python-versions = ">=3.6"
python-versions = ">=3.7"
files = [
{file = "Pygments-2.14.0-py3-none-any.whl", hash = "sha256:fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717"},
{file = "Pygments-2.14.0.tar.gz", hash = "sha256:b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297"},
{file = "Pygments-2.15.0-py3-none-any.whl", hash = "sha256:77a3299119af881904cd5ecd1ac6a66214b6e9bed1f2db16993b54adede64094"},
{file = "Pygments-2.15.0.tar.gz", hash = "sha256:f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500"},
]
[package.extras]
@ -2661,14 +2661,14 @@ test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"]
[[package]]
name = "types-beautifulsoup4"
version = "4.12.0.2"
version = "4.12.0.3"
description = "Typing stubs for beautifulsoup4"
category = "dev"
optional = false
python-versions = "*"
files = [
{file = "types-beautifulsoup4-4.12.0.2.tar.gz", hash = "sha256:4d689bc581af6832ab7c47d67de9d4875eb8c23f6dea4d1c9efb2d28999c7ce9"},
{file = "types_beautifulsoup4-4.12.0.2-py3-none-any.whl", hash = "sha256:b09bb3062ad3fbae02f38cc7de2d1acfa494b34818445be57b18b733b4cac370"},
{file = "types-beautifulsoup4-4.12.0.3.tar.gz", hash = "sha256:64b71d44d6a6030e39bb324dd51ef176bec158cd4d2994ed7213c1b2b8fa0785"},
{file = "types_beautifulsoup4-4.12.0.3-py3-none-any.whl", hash = "sha256:019e1a9096ecd12a37981d562cfed405398e6ed3c7717852c1f01871d052906a"},
]
[package.dependencies]
@ -3135,4 +3135,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more
[metadata]
lock-version = "2.0"
python-versions = ">=3.8,<3.12"
content-hash = "5917030e798c3068972436cbbcca0c0a6f1dd9c8e1bf789d4df1fa5498d2d684"
content-hash = "4a71f0950322895007c94b35b17dc5783fecffff50d2eb08e803cf91f20261cd"

View File

@ -65,7 +65,7 @@ passivetotal = "^2.5.9"
werkzeug = "^2.2.3"
filetype = "^1.2.0"
pypandora = "^1.4.0"
lacuscore = "^1.4.2"
lacuscore = "^1.4.8"
pylacus = "^1.4.0"
pyipasnhistory = "^2.1.2"
publicsuffixlist = "^0.9.3"
@ -82,7 +82,7 @@ types-requests = "^2.28.11.17"
types-pkg-resources = "^0.1.3"
types-Deprecated = "^1.2.9.2"
types-python-dateutil = "^2.8.19.12"
types-beautifulsoup4 = "^4.12.0.2"
types-beautifulsoup4 = "^4.12.0.3"
types-Pillow = "^9.4.0.19"
[build-system]