Skip to content

Commit

Permalink
Merge pull request #1475 from Bidaya0/feat/new-sca-impl
Browse files Browse the repository at this point in the history
Feat/new sca impl
  • Loading branch information
Bidaya0 authored May 31, 2023
2 parents 9e46a23 + e18e677 commit f7618ff
Show file tree
Hide file tree
Showing 16 changed files with 1,056 additions and 26 deletions.
4 changes: 4 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ uwsgi = "==2.0.21"
marisa-trie = "==0.8.0"
gunicorn = "==20.1.0"
celery-singleton = "*"
djangorestframework-dataclasses = "*"
django-seriously = "*"
dataclasses-json = "*"
django-silk = "*"

[dev-packages]

Expand Down
158 changes: 139 additions & 19 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions dongtai_common/models/asset_vul_v2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import uuid
from dongtai_common.models.agent import IastAgent
from django.core.cache import cache
from django_elasticsearch_dsl.search import Search
from dongtai_conf.settings import ASSET_VUL_INDEX
from django_elasticsearch_dsl import Document, fields
from django_elasticsearch_dsl.registries import registry
from dongtai_common.models.assetv2 import AssetV2Global
from django.db import models
from dongtai_common.utils.settings import get_managed
from dongtai_common.models.vulnerablity import IastVulnerabilityStatus
from dongtai_common.models.vul_level import IastVulLevel


class IastAssetVulV2(models.Model):
vul_name = models.CharField(max_length=255, blank=True, null=True)
vul_detail = models.TextField(blank=True, null=True)
# 漏洞类型等级
level = models.ForeignKey(IastVulLevel,
models.DO_NOTHING,
blank=True,
null=True)
update_time = models.IntegerField(blank=True, null=True)
create_time = models.IntegerField(blank=True, null=True)
references = models.JSONField(blank=True, null=True, default=list)
change_time = models.IntegerField(blank=True, null=True)
published_time = models.IntegerField(blank=True, null=True)
vul_id = models.CharField(max_length=255,
blank=True,
null=True,
unique=True)

class Meta:
managed = True
db_table = 'iast_asset_vul_v2'


class IastVulAssetRelationV2(models.Model):
asset_vul = models.ForeignKey(IastAssetVulV2,
on_delete=models.DO_NOTHING,
db_constraint=False,
db_column='vul_id',
to_field="vul_id")
asset = models.ForeignKey(AssetV2Global,
on_delete=models.DO_NOTHING,
db_constraint=False,
db_column='asset',
to_field="aql")

class Meta:
managed = get_managed()
db_table = 'iast_asset_vul_v2_relation'


#class IastPackageGAInfo(models.Model):
# package_name = models.ForeignKey(AssetV2Global,
# on_delete=models.DO_NOTHING,
# db_constraint=False,
# db_column='package_name')
# affected_versions = models.JSONField(blank=True, null=True, default=list)
# unaffected_versions = models.JSONField(blank=True, null=True, default=list)
#
# class Meta:
# managed = get_managed()
# db_table = 'iast_asset_v2_ga_info'
Loading

0 comments on commit f7618ff

Please sign in to comment.