Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bbot_server/modules/assets/assets_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,8 @@ async def _update_asset(self, host: str, update: dict):

async def _insert_asset(self, asset: dict):
# we exclude scope here to avoid accidentally clobbering it
asset.pop("scope", None)
# however we preserve scope for technologies and findings since they should inherit scope
asset_type = asset.get("type", "Asset")
if asset_type == "Asset":
asset.pop("scope", None)
await self.strict_collection.insert_one(asset)
3 changes: 3 additions & 0 deletions bbot_server/modules/findings/findings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ async def handle_event(self, event, asset):
cves=cves,
event=event,
)
# inherit scope from the parent asset so as to make sure that target_id filtering works
if asset and hasattr(asset, "scope"):
finding.scope = asset.scope
# update finding names
findings = set(getattr(asset, "findings", []))
findings.add(finding.name)
Expand Down
3 changes: 3 additions & 0 deletions bbot_server/modules/technologies/technologies_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ async def handle_event(self, event, asset):
netloc=event.netloc,
last_seen=event.timestamp,
)
# inherit scope from the parent asset so as to make sure that target_id filtering works
if asset and hasattr(asset, "scope"):
t.scope = asset.scope
# insert the technology into the database
await self._update_or_insert_technology(t)
# make an activity if the technology is new
Expand Down