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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ GITHUB_OAUTH_CLIENT_SECRET=
N8N_KEY=
N8N_AI_SYNC_URL=

NETWORK_FLOW_URL=
NETWORK_FLOW_TOKEN=

HELM_URL=https://helm-api.com/api/helm-get-sbom
HELM_TOKEN=

Expand Down
182 changes: 182 additions & 0 deletions prisma/flow.json
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeded network flow information. Eventually, we'll anticipate getting this info from Virta Labs.

So to make the architecture more realistic / write code now that'll be used later, when testing I just serve this from some other server as a static file. There's an env var, NETWORK_FLOW_URL, that we configure to pull data from this static file server. Eventually, NETWORK_FLOW_URL with point to a Blueflow endpoint

Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
{
"schema_version": "0.1.0-minimal",
"snapshot_id": "a1b2c3d4-e5f6-4789-a012-b34c56d7e8f9",
"timestamp": "2026-05-21T00:00:00Z",
"assets": [
{
"id": "seed-asset-001",
"manufacturer": "Philips",
"interfaces": [
{
"id": "if-001",
"mac_address": "00:1A:2B:3C:4D:5E",
"ipv4_address": "10.20.1.101",
"ipv6_address": null
}
],
"services": []
},
{
"id": "seed-asset-002",
"manufacturer": "Baxter",
"interfaces": [
{
"id": "if-002",
"mac_address": "00:1A:2B:3C:4D:5F",
"ipv4_address": "10.20.1.102",
"ipv6_address": null
}
],
"services": []
},
{
"id": "seed-asset-003",
"manufacturer": "Roche",
"interfaces": [
{
"id": "if-003",
"mac_address": "00:1A:2B:3C:4D:62",
"ipv4_address": "10.30.2.201",
"ipv6_address": null
}
],
"services": [{ "port": 2575, "protocol": "tcp" }]
},
{
"id": "seed-asset-004",
"manufacturer": "Epic Systems",
"interfaces": [
{
"id": "if-004",
"mac_address": "00:1A:2B:3C:4D:68",
"ipv4_address": "10.10.4.401",
"ipv6_address": null
}
],
"services": [
{ "port": 443, "protocol": "tcp" },
{ "port": 2575, "protocol": "tcp" }
]
},
{
"id": "seed-asset-005",
"manufacturer": "Dell",
"interfaces": [
{
"id": "if-005",
"mac_address": "00:1A:2B:3C:4D:6E",
"ipv4_address": "10.60.6.601",
"ipv6_address": null
}
],
"services": []
},
{
"id": "seed-asset-006",
"manufacturer": "HP",
"interfaces": [
{
"id": "if-006",
"mac_address": "00:1A:2B:3C:4D:6F",
"ipv4_address": "10.60.6.602",
"ipv6_address": null
}
],
"services": []
},
{
"id": "seed-asset-007",
"manufacturer": "Cisco Systems",
"interfaces": [
{
"id": "if-007",
"mac_address": "00:1A:2B:3C:4D:71",
"ipv4_address": "10.70.7.701",
"ipv6_address": null
}
],
"services": [{ "port": 22, "protocol": "tcp" }]
},
{
"id": "seed-asset-008",
"manufacturer": "Fortinet",
"interfaces": [
{
"id": "if-008",
"mac_address": "00:1A:2B:3C:4D:72",
"ipv4_address": "10.70.7.702",
"ipv6_address": null
}
],
"services": [
{ "port": 443, "protocol": "tcp" },
{ "port": 53, "protocol": "udp" }
]
}
],
"connections": [
{
"src_asset_id": "seed-asset-001",
"dst_asset_id": "seed-asset-004",
"dst_port": 2575,
"protocol": "tcp",
"direction": "bidirectional"
},
{
"src_asset_id": "seed-asset-002",
"dst_asset_id": "seed-asset-004",
"dst_port": 2575,
"protocol": "tcp",
"direction": "unidirectional"
},
{
"src_asset_id": "seed-asset-003",
"dst_asset_id": "seed-asset-004",
"dst_port": 2575,
"protocol": "tcp",
"direction": "bidirectional"
},
{
"src_asset_id": "seed-asset-005",
"dst_asset_id": "seed-asset-004",
"dst_port": 443,
"protocol": "tcp",
"direction": "bidirectional"
},
{
"src_asset_id": "seed-asset-006",
"dst_asset_id": "seed-asset-004",
"dst_port": 443,
"protocol": "tcp",
"direction": "bidirectional"
},
{
"src_asset_id": "seed-asset-001",
"dst_asset_id": "seed-asset-007",
"dst_port": 22,
"protocol": "tcp",
"direction": "unidirectional"
},
{
"src_asset_id": "seed-asset-003",
"dst_asset_id": "seed-asset-007",
"dst_port": 22,
"protocol": "tcp",
"direction": "unidirectional"
},
{
"src_asset_id": "seed-asset-007",
"dst_asset_id": "seed-asset-008",
"dst_port": 443,
"protocol": "tcp",
"direction": "bidirectional"
},
{
"src_asset_id": "seed-asset-008",
"dst_asset_id": "seed-asset-004",
"dst_port": 443,
"protocol": "tcp",
"direction": "unidirectional"
}
]
}
9 changes: 9 additions & 0 deletions prisma/seed.ts
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added static id's to get this to work with flow.json

Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ const SAMPLE_DEVICE_GROUPS = [
const SAMPLE_ASSETS = [
// ICU Medical Devices
{
id: "seed-asset-001",
ip: "10.20.1.101",
cpe: "cpe:2.3:h:philips:intellivue_mp70:*:*:*:*:*:*:*:*",
role: "ICU Patient Monitor",
Expand All @@ -172,6 +173,7 @@ const SAMPLE_ASSETS = [
status: "Active",
},
{
id: "seed-asset-002",
ip: "10.20.1.102",
cpe: "cpe:2.3:h:baxter:infusion_pump:sigma_spectrum:*:*:*:*:*:*:*",
role: "Infusion Pump",
Expand Down Expand Up @@ -224,6 +226,7 @@ const SAMPLE_ASSETS = [
},
// Laboratory Equipment
{
id: "seed-asset-003",
ip: "10.30.2.201",
cpe: "cpe:2.3:h:roche:cobas_6000:*:*:*:*:*:*:*:*",
role: "Laboratory Analyzer",
Expand Down Expand Up @@ -328,6 +331,7 @@ const SAMPLE_ASSETS = [
},
// IT Infrastructure
{
id: "seed-asset-004",
ip: "10.10.4.401",
cpe: "cpe:2.3:a:epic:emr:2023:*:*:*:*:*:*:*",
role: "EMR Server",
Expand Down Expand Up @@ -432,6 +436,7 @@ const SAMPLE_ASSETS = [
},
// Workstations
{
id: "seed-asset-005",
ip: "10.60.6.601",
cpe: "cpe:2.3:h:dell:optiplex_7090:*:*:*:*:*:*:*:*",
role: "Clinical Workstation",
Expand All @@ -449,6 +454,7 @@ const SAMPLE_ASSETS = [
status: "Active",
},
{
id: "seed-asset-006",
ip: "10.60.6.602",
cpe: "cpe:2.3:h:hp:elitedesk_800:*:*:*:*:*:*:*:*",
role: "Nurse Station Workstation",
Expand Down Expand Up @@ -484,6 +490,7 @@ const SAMPLE_ASSETS = [
},
// Network Infrastructure
{
id: "seed-asset-007",
ip: "10.70.7.701",
cpe: "cpe:2.3:h:cisco:catalyst_9300:*:*:*:*:*:*:*:*",
role: "Network Switch",
Expand All @@ -501,6 +508,7 @@ const SAMPLE_ASSETS = [
status: "Active",
},
{
id: "seed-asset-008",
ip: "10.70.7.702",
cpe: "cpe:2.3:h:fortinet:fortigate_600e:*:*:*:*:*:*:*:*",
role: "Firewall",
Expand Down Expand Up @@ -983,6 +991,7 @@ async function seedAssets(userId: string) {

return prisma.asset.create({
data: {
...("id" in asset && asset.id ? { id: asset.id } : {}),
ip: asset.ip,
networkSegment: asset.networkSegment,
role: asset.role,
Expand Down
Loading
Loading