-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1475 from Bidaya0/feat/new-sca-impl
Feat/new sca impl
- Loading branch information
Showing
16 changed files
with
1,056 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
Oops, something went wrong.