Skip to content

Commit

Permalink
Merge pull request #1290 from Bidaya0/fix/normal_vul_handler
Browse files Browse the repository at this point in the history
fix: normal vul handler.
  • Loading branch information
Bidaya0 authored Feb 24, 2023
2 parents c948855 + 97edfab commit 6f80336
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions dongtai_protocol/report/handler/narmal_vul_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ def save(self):
iast_vul.agent.bind_project_id, iast_vul.id,
iast_vul.strategy.vul_name)
IastVulnerabilityModel.objects.filter(
strategy_id=strategy_id,
uri=self.http_uri,
http_method=self.http_method,
project_version_id=self.agent.project_version_id,
strategy_id=iast_vul.strategy_id,
uri=iast_vul.uri,
http_method=iast_vul.http_method,
project_version_id=iast_vul.agent.project_version_id,
pk__lt=iast_vul.id,
).delete()
header_vul = None
Expand All @@ -300,18 +300,19 @@ def save(self):
logger.debug("unique error stack: ", exc_info=True)
logger.info(
"unique error cause by concurrency insert,ignore it")
if header_vul and not IastHeaderVulnerabilityDetail.objects.filter(
agent_id=self.agent.id,
header_vul_id=header_vul.id,
).exists():
try:
IastHeaderVulnerabilityDetail.objects.create(
agent_id=self.agent.id,
method_pool_id=-1,
header_vul_id=header_vul.id,
req_header=self.req_header_for_search,
res_header=self.http_res_header)
except IntegrityError as e:
logger.debug("unique error stack: ", exc_info=True)
logger.info(
"unique error cause by concurrency insert,ignore it")
# disable when no req_header and res_header
# if header_vul and not IastHeaderVulnerabilityDetail.objects.filter(
# agent_id=self.agent.id,
# header_vul_id=header_vul.id,
# ).exists():
# try:
# IastHeaderVulnerabilityDetail.objects.create(
# agent_id=self.agent.id,
# method_pool_id=-1,
# header_vul_id=header_vul.id,
# req_header=self.req_header_for_search,
# res_header=self.http_res_header)
# except IntegrityError as e:
# logger.debug("unique error stack: ", exc_info=True)
# logger.info(
# "unique error cause by concurrency insert,ignore it")

0 comments on commit 6f80336

Please sign in to comment.