dn-scribe commited on
Commit
549cc4e
·
unverified ·
2 Parent(s): 21e95e1b3c3356

Merge pull request #7 from scribe-security/add-pyvis-graph

Browse files
.vscode/launch.json CHANGED
@@ -11,6 +11,21 @@
11
  "request": "launch",
12
  "program": "${file}",
13
  "console": "internalConsole"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
  ]
16
  }
 
11
  "request": "launch",
12
  "program": "${file}",
13
  "console": "internalConsole"
14
+ },
15
+ {
16
+ "name": "Query Lineage",
17
+ "type": "debugpy",
18
+ "request": "launch",
19
+ "module": "scribe_python_client.cli",
20
+ "console": "internalConsole",
21
+ "args": [
22
+ "--api-call",
23
+ "query-lineage",
24
+ "--query",
25
+ "{\"columns\": [\"asset_name\", \"asset_type\", \"parent_name\", \"parent_type\", \"external_id\", \"parent_external_id\", \"uri\"], \"filters\": [{\"col\": \"logical_app\", \"op\": \"==\", \"val\": \"Astro-Analytics-Discovery\"}, {\"col\": \"logical_app_version\", \"op\": \"==\", \"val\": \"36\"}], \"orderby\": []}",
26
+ "--lineage-graph-file",
27
+ "lineage_graph.html",
28
+ ]
29
  }
30
  ]
31
  }
README.md CHANGED
@@ -98,6 +98,12 @@ Run a custom query on the lineage dataset:
98
  scribe-client --api-call query-lineage --query "{\"columns\": [\"asset_name\", \"asset_type\"], \"filters\": [{\"col\": \"asset_type\", \"op\": \"==\", \"val\": \"repo\"}], \"orderby\": [], \"row_limit\": 10}"
99
  ```
100
 
 
 
 
 
 
 
101
  ### Notes
102
  - Replace the `--query` argument with your desired query in JSON format.
103
  - Ensure that the query structure matches the dataset schema for accurate results.
 
98
  scribe-client --api-call query-lineage --query "{\"columns\": [\"asset_name\", \"asset_type\"], \"filters\": [{\"col\": \"asset_type\", \"op\": \"==\", \"val\": \"repo\"}], \"orderby\": [], \"row_limit\": 10}"
99
  ```
100
 
101
+ Run a custom query on the lineage dataset and create a graph of the lineage:
102
+ ```bash
103
+ scribe-client --api-call query-lineage --query "{\"columns\": [\"asset_name\", \"asset_type\", \"parent_name\", \"parent_type\", \"external_id\", \"parent_external_id\", \"uri\"], \"filters\": [{\"col\": \"logical_app\", \"op\": \"==\", \"val\": \"Astro-Analytics-Discovery\"}, {\"col\": \"logical_app_version\", \"op\": \"==\", \"val\": \"36\"}], \"orderby\": []}" --lineage-graph-file lineage-graph.html
104
+ ```
105
+ Note that the columns in the query are the minimal set required to create a lineage graph.
106
+
107
  ### Notes
108
  - Replace the `--query` argument with your desired query in JSON format.
109
  - Ensure that the query structure matches the dataset schema for accurate results.
demo-data/astro-lineage.json ADDED
The diff for this file is too large to render. See raw diff
 
demo-data/lineage-graph.html ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <meta charset="utf-8">
4
+
5
+ <script src="lib/bindings/utils.js"></script>
6
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/dist/vis-network.min.css" integrity="sha512-WgxfT5LWjfszlPHXRmBWHkV2eceiWTOBvrKCNbdgDYTHrT2AeLCGbF4sZlZw3UMN3WtL0tGUoIAKsu8mllg/XA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
7
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/vis-network.min.js" integrity="sha512-LnvoEWDFrqGHlHmDD2101OrLcbsfkrzoSpvtSQtxK3RMnRV0eOkhhBN2dXHKRrUU8p2DGRTk35n4O8nWSVe1mQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
8
+
9
+
10
+ <center>
11
+ <h1></h1>
12
+ </center>
13
+
14
+ <!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" />
15
+ <script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>-->
16
+ <link
17
+ href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css"
18
+ rel="stylesheet"
19
+ integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
20
+ crossorigin="anonymous"
21
+ />
22
+ <script
23
+ src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"
24
+ integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
25
+ crossorigin="anonymous"
26
+ ></script>
27
+
28
+
29
+ <center>
30
+ <h1></h1>
31
+ </center>
32
+ <style type="text/css">
33
+
34
+ #mynetwork {
35
+ width: 100%;
36
+ height: 1200px;
37
+ background-color: #ffffff;
38
+ border: 1px solid lightgray;
39
+ position: relative;
40
+ float: left;
41
+ }
42
+
43
+
44
+
45
+
46
+ #config {
47
+ float: left;
48
+ width: 400px;
49
+ height: 600px;
50
+ }
51
+
52
+
53
+
54
+ </style>
55
+ </head>
56
+
57
+
58
+ <body>
59
+ <div class="card" style="width: 100%">
60
+
61
+
62
+ <div id="mynetwork" class="card-body"></div>
63
+ </div>
64
+
65
+
66
+
67
+ <div id="config"></div>
68
+
69
+
70
+ <script type="text/javascript">
71
+
72
+ // initialize global variables.
73
+ var edges;
74
+ var nodes;
75
+ var allNodes;
76
+ var allEdges;
77
+ var nodeColors;
78
+ var originalNodes;
79
+ var network;
80
+ var container;
81
+ var options, data;
82
+ var filter = {
83
+ item : '',
84
+ property : '',
85
+ value : []
86
+ };
87
+
88
+
89
+
90
+
91
+
92
+ // This method is responsible for drawing the graph, returns the drawn network
93
+ function drawGraph() {
94
+ var container = document.getElementById('mynetwork');
95
+
96
+
97
+
98
+ // parsing and collecting nodes and edges from the python
99
+ nodes = new vis.DataSet([{"group": "repo", "id": "scribe-public/reusable-workflows", "label": "reusable-workflows", "physics": false, "shape": "dot", "title": "reusable-workflows\u003cbr\u003eType: repo\u003cbr\u003ehttps://github.com/scribe-public/reusable-workflows", "x": -166.66666666666666, "y": -197.6950354609929}, {"group": "organization", "id": "scribe-public", "label": "scribe-public", "physics": false, "shape": "dot", "title": "scribe-public\u003cbr\u003eType: organization\u003cbr\u003ehttps://github.com/scribe-public/sample-policies", "x": 83.33333333333333, "y": -281.02836879432624}, {"group": "repo", "id": "scribe-public/demo-pipeline", "label": "demo-pipeline", "physics": false, "shape": "dot", "title": "demo-pipeline\u003cbr\u003eType: repo\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline", "x": 166.66666666666666, "y": -197.6950354609929}, {"group": "repo", "id": "scribe-public/gitlab_platforms", "label": "gitlab_platforms", "physics": false, "shape": "dot", "title": "gitlab_platforms\u003cbr\u003eType: repo\u003cbr\u003ehttps://github.com/scribe-public/gitlab_platforms", "x": 0.0, "y": -197.6950354609929}, {"group": "repo", "id": "scribe-public/gitgat", "label": "gitgat", "physics": false, "shape": "dot", "title": "gitgat\u003cbr\u003eType: repo\u003cbr\u003ehttps://github.com/scribe-public/gitgat", "x": 83.33333333333333, "y": -197.6950354609929}, {"group": "repo", "id": "scribe-public/sample-policies", "label": "sample-policies", "physics": false, "shape": "dot", "title": "sample-policies\u003cbr\u003eType: repo\u003cbr\u003ehttps://github.com/scribe-public/sample-policies", "x": -83.33333333333333, "y": -197.6950354609929}, {"group": "organization", "id": "scribe-security", "label": "scribe-security", "physics": false, "shape": "dot", "title": "scribe-security\u003cbr\u003eType: organization\u003cbr\u003e", "x": 0.0, "y": -281.02836879432624}, {"group": "organization", "id": "guycherno", "label": "guycherno", "physics": false, "shape": "dot", "title": "guycherno\u003cbr\u003eType: organization\u003cbr\u003ehttps://github.com/guycherno", "x": -83.33333333333333, "y": -281.02836879432624}, {"group": "branch", "id": "scribe-public/demo-pipeline/mikey_forbidden_test", "label": "mikey_forbidden_test", "physics": false, "shape": "dot", "title": "mikey_forbidden_test\u003cbr\u003eType: branch\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/tree/mikey_forbidden_test", "x": 41.666666666666664, "y": -114.36170212765957}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/build2dockerhub.yml", "label": "Build to Dockerhub", "physics": false, "shape": "dot", "title": "Build to Dockerhub\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/build2dockerhub.yml", "x": -83.33333333333333, "y": -31.028368794326237}, {"group": "repo_secret", "id": "DOCKERHUB_PASSWORD", "label": "DOCKERHUB_PASSWORD", "physics": false, "shape": "dot", "title": "DOCKERHUB_PASSWORD\u003cbr\u003eType: repo_secret\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/DOCKERHUB_PASSWORD", "x": 125.0, "y": -364.36170212765956}, {"group": "branch", "id": "scribe-public/demo-pipeline/mikey_test", "label": "mikey_test", "physics": false, "shape": "dot", "title": "mikey_test\u003cbr\u003eType: branch\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/tree/mikey_test", "x": -208.33333333333331, "y": -114.36170212765957}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/on-push.yml", "label": "Attest to reference data (attest-commit)", "physics": false, "shape": "dot", "title": "Attest to reference data (attest-commit)\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/on-push.yml", "x": 0.0, "y": -31.028368794326237}, {"group": "repo_secret", "id": "DOCKERHUB_USERNAME", "label": "DOCKERHUB_USERNAME", "physics": false, "shape": "dot", "title": "DOCKERHUB_USERNAME\u003cbr\u003eType: repo_secret\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/DOCKERHUB_USERNAME", "x": 208.33333333333331, "y": -364.36170212765956}, {"group": "branch", "id": "scribe-public/demo-pipeline/mikey_gcr_test", "label": "mikey_gcr_test", "physics": false, "shape": "dot", "title": "mikey_gcr_test\u003cbr\u003eType: branch\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/tree/mikey_gcr_test", "x": -125.0, "y": -114.36170212765957}, {"group": "branch", "id": "scribe-public/demo-pipeline/sp800-190-blog", "label": "sp800-190-blog", "physics": false, "shape": "dot", "title": "sp800-190-blog\u003cbr\u003eType: branch\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/tree/sp800-190-blog", "x": -41.666666666666664, "y": -114.36170212765957}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 83.33333333333333, "y": -31.028368794326237}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/file-integrity-demo.yml", "label": "File Integrity Demo", "physics": false, "shape": "dot", "title": "File Integrity Demo\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/file-integrity-demo.yml", "x": -416.66666666666663, "y": -31.028368794326237}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/policy-check.yml", "label": "Policy-Check", "physics": false, "shape": "dot", "title": "Policy-Check\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/policy-check.yml", "x": 500.0, "y": -31.028368794326237}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/trivy.yml", "label": "Upload 3rd party evidence", "physics": false, "shape": "dot", "title": "Upload 3rd party evidence\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/trivy.yml", "x": 333.3333333333333, "y": -31.028368794326237}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/discoverFdockerhub.yml", "label": "Discover (agentless-Dockerhub) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless-Dockerhub) Pipeline\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discoverFdockerhub.yml", "x": -500.0, "y": -31.028368794326237}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/build2gcr.yml", "x": 166.66666666666666, "y": -31.028368794326237}, {"group": "repo_secret", "id": "SCRIBE_GOLD_TEAM_TOKEN", "label": "SCRIBE_GOLD_TEAM_TOKEN", "physics": false, "shape": "dot", "title": "SCRIBE_GOLD_TEAM_TOKEN\u003cbr\u003eType: repo_secret\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/SCRIBE_GOLD_TEAM_TOKEN", "x": -125.0, "y": -364.36170212765956}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/buildonly2gcr.yml", "label": "Build Only to GCR", "physics": false, "shape": "dot", "title": "Build Only to GCR\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/buildonly2gcr.yml", "x": 416.66666666666663, "y": -31.028368794326237}, {"group": "repo_secret", "id": "SCRIBE_STAGING_TOKEN", "label": "SCRIBE_STAGING_TOKEN", "physics": false, "shape": "dot", "title": "SCRIBE_STAGING_TOKEN\u003cbr\u003eType: repo_secret\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/SCRIBE_STAGING_TOKEN", "x": -41.666666666666664, "y": -364.36170212765956}, {"group": "repo_secret", "id": "DEMO_GH_SECRET", "label": "DEMO_GH_SECRET", "physics": false, "shape": "dot", "title": "DEMO_GH_SECRET\u003cbr\u003eType: repo_secret\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/DEMO_GH_SECRET", "x": -208.33333333333331, "y": -364.36170212765956}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/full-pipeline.yml", "label": "Full Pipeline", "physics": false, "shape": "dot", "title": "Full Pipeline\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/full-pipeline.yml", "x": -333.3333333333333, "y": -31.028368794326237}, {"group": "branch", "id": "scribe-public/demo-pipeline/main", "label": "main", "physics": false, "shape": "dot", "title": "main\u003cbr\u003eType: branch\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/tree/main", "x": 208.33333333333331, "y": -114.36170212765957}, {"group": "repo_secret", "id": "SCRIBE_HEYMAN_TEAM_TOKEN", "label": "SCRIBE_HEYMAN_TEAM_TOKEN", "physics": false, "shape": "dot", "title": "SCRIBE_HEYMAN_TEAM_TOKEN\u003cbr\u003eType: repo_secret\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/SCRIBE_HEYMAN_TEAM_TOKEN", "x": 41.666666666666664, "y": -364.36170212765956}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/activate-workflows.yml", "label": "Activate Forked Workflows", "physics": false, "shape": "dot", "title": "Activate Forked Workflows\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/activate-workflows.yml", "x": 250.0, "y": -31.028368794326237}, {"group": "branch", "id": "scribe-public/demo-pipeline/merge", "label": "merge", "physics": false, "shape": "dot", "title": "merge\u003cbr\u003eType: branch\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/tree/merge", "x": 125.0, "y": -114.36170212765957}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/policy-pr.yml", "label": ".github/workflows/policy-pr.yml", "physics": false, "shape": "dot", "title": ".github/workflows/policy-pr.yml\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/merge/.github/workflows/policy-pr.yml", "x": -250.0, "y": -31.028368794326237}, {"group": "workflow", "id": "scribe-public/demo-pipeline/.github/workflows/scan-repos.yml", "label": "Demonstrate usage of reusable GitHub Discovery workflow", "physics": false, "shape": "dot", "title": "Demonstrate usage of reusable GitHub Discovery workflow\u003cbr\u003eType: workflow\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/scan-repos.yml", "x": -166.66666666666666, "y": -31.028368794326237}, {"group": "image", "id": "sha256:381500b4d0cd09e3ba014796b064a9a1f4e0dfd9470003d2b079f10a5eb041f6", "label": "astro-analytics@sha256:381500b4d0cd09e3ba014796b064a9a1f4e0dfd9470003d2b079f10a5eb041f6", "physics": false, "shape": "dot", "title": "astro-analytics@sha256:381500b4d0cd09e3ba014796b064a9a1f4e0dfd9470003d2b079f10a5eb041f6\u003cbr\u003eType: image\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15583937594/sha256:381500b4d0cd09e3ba014796b064a9a1f4e0dfd9470003d2b079f10a5eb041f6/astro-analytics@sha256:381500b4d0cd09e3ba014796b064a9a1f4e0dfd9470003d2b079f10a5eb041f6", "x": -41.666666666666664, "y": 135.63829787234042}, {"group": "workflow_run", "id": "15583937594", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15583937594", "x": 1416.6666666666665, "y": 52.30496453900709}, {"group": "image", "id": "sha256:523dedef734de27dc4bfe4de4a5f5e0e7bbb8e65ed590135d62889aabcc99eb2", "label": "astro-analytics@sha256:523dedef734de27dc4bfe4de4a5f5e0e7bbb8e65ed590135d62889aabcc99eb2", "physics": false, "shape": "dot", "title": "astro-analytics@sha256:523dedef734de27dc4bfe4de4a5f5e0e7bbb8e65ed590135d62889aabcc99eb2\u003cbr\u003eType: image\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/build2gcr.yml", "x": 41.666666666666664, "y": 135.63829787234042}, {"group": "workflow_run", "id": "15439753547", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15439753547", "x": 166.66666666666666, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15445832023", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15445832023", "x": 1833.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15808556525", "label": "48", "physics": false, "shape": "dot", "title": "48\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15808556525", "x": -1500.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15459584376", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15459584376", "x": -1833.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15808557924", "label": "49", "physics": false, "shape": "dot", "title": "49\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15808557924", "x": 1916.6666666666665, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15808387407", "label": "40", "physics": false, "shape": "dot", "title": "40\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15808387407", "x": -1250.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15808346339", "label": "39", "physics": false, "shape": "dot", "title": "39\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15808346339", "x": 1333.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15808532271", "label": "45", "physics": false, "shape": "dot", "title": "45\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15808532271", "x": -1416.6666666666665, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15808535024", "label": "46", "physics": false, "shape": "dot", "title": "46\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15808535024", "x": 1250.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15439357956", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/build2gcr.yml", "x": 250.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15439241969", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/build2gcr.yml", "x": -333.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15439209276", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/build2gcr.yml", "x": -1166.6666666666665, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15459823635", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15459823635", "x": -750.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15808536790", "label": "47", "physics": false, "shape": "dot", "title": "47\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/actions/runs/15808536790", "x": 1583.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15583650366", "label": "Build to GCR", "physics": false, "shape": "dot", "title": "Build to GCR\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/build2gcr.yml", "x": 1750.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15318998681", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -1000.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15322005324", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -833.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15318216265", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -916.6666666666666, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15318437188", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 1166.6666666666665, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15293499020", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 1083.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15291985457", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -1083.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15319277887", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -1333.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15298297812", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -1916.6666666666665, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15295456960", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 666.6666666666666, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15291897730", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -166.66666666666666, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15318236825", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -2000.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15318512164", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 2000.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15318273319", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -666.6666666666666, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15319328318", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -83.33333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15317452565", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 1500.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15318950682", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 333.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15293758901", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -1666.6666666666665, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15451066278", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 1666.6666666666665, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15460109318", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 416.66666666666663, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15237010494", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -583.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15238103456", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -1583.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15238329707", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -416.66666666666663, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15239345431", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 583.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15238616341", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -1750.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15239591210", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": -250.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15238994294", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 916.6666666666666, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15439889079", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 0.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15584026069", "label": "Discover (agentless) Pipeline", "physics": false, "shape": "dot", "title": "Discover (agentless) Pipeline\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/discover.yml", "x": 750.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15317404784", "label": "Policy-Check", "physics": false, "shape": "dot", "title": "Policy-Check\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/policy-check.yml", "x": -500.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15269204245", "label": "Policy-Check", "physics": false, "shape": "dot", "title": "Policy-Check\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/policy-check.yml", "x": 1000.0, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15269200253", "label": "Policy-Check", "physics": false, "shape": "dot", "title": "Policy-Check\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/policy-check.yml", "x": 83.33333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15269182588", "label": "Policy-Check", "physics": false, "shape": "dot", "title": "Policy-Check\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/policy-check.yml", "x": 833.3333333333333, "y": 52.30496453900709}, {"group": "workflow_run", "id": "15440763789", "label": "Demonstrate usage of reusable GitHub Discovery workflow", "physics": false, "shape": "dot", "title": "Demonstrate usage of reusable GitHub Discovery workflow\u003cbr\u003eType: workflow_run\u003cbr\u003ehttps://github.com/scribe-public/demo-pipeline/blob/main/.github/workflows/scan-repos.yml", "x": 500.0, "y": 52.30496453900709}, {"group": "namespace", "id": "minikube@k8s/astro-analytics-discovery", "label": "astro-analytics-discovery", "physics": false, "shape": "dot", "title": "astro-analytics-discovery\u003cbr\u003eType: namespace\u003cbr\u003e", "x": 0.0, "y": 302.3049645390071}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/scribesecurity-astro-analytics-2-1-pod", "label": "scribesecurity-astro-analytics-2-1-pod", "physics": false, "shape": "dot", "title": "scribesecurity-astro-analytics-2-1-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": 166.66666666666666, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/nginx-latest-pod", "label": "nginx-latest-pod", "physics": false, "shape": "dot", "title": "nginx-latest-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": 0.0, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/scribesecurity-astro-analytics-3-0-pod", "label": "scribesecurity-astro-analytics-3-0-pod", "physics": false, "shape": "dot", "title": "scribesecurity-astro-analytics-3-0-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": -250.0, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-11-pod", "label": "ghcr-io-scribe-public-astro-analytics-11-pod", "physics": false, "shape": "dot", "title": "ghcr-io-scribe-public-astro-analytics-11-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": -166.66666666666666, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/scribesecurity-astro-analytics-3-1-pod", "label": "scribesecurity-astro-analytics-3-1-pod", "physics": false, "shape": "dot", "title": "scribesecurity-astro-analytics-3-1-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": -333.3333333333333, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-8-pod", "label": "ghcr-io-scribe-public-astro-analytics-8-pod", "physics": false, "shape": "dot", "title": "ghcr-io-scribe-public-astro-analytics-8-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": 333.3333333333333, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-9-pod", "label": "ghcr-io-scribe-public-astro-analytics-9-pod", "physics": false, "shape": "dot", "title": "ghcr-io-scribe-public-astro-analytics-9-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": 250.0, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-36-pod", "label": "ghcr-io-scribe-public-astro-analytics-36-pod", "physics": false, "shape": "dot", "title": "ghcr-io-scribe-public-astro-analytics-36-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": 83.33333333333333, "y": 218.97163120567376}, {"group": "pod", "id": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-security-astro-analytics-5-pod", "label": "ghcr-io-scribe-security-astro-analytics-5-pod", "physics": false, "shape": "dot", "title": "ghcr-io-scribe-security-astro-analytics-5-pod\u003cbr\u003eType: pod\u003cbr\u003e", "x": -83.33333333333333, "y": 218.97163120567376}]);
100
+ edges = new vis.DataSet([{"arrows": "to", "from": "scribe-public", "to": "scribe-public/reusable-workflows"}, {"arrows": "to", "from": "scribe-public", "to": "scribe-public/demo-pipeline"}, {"arrows": "to", "from": "scribe-public", "to": "scribe-public/gitlab_platforms"}, {"arrows": "to", "from": "scribe-public", "to": "scribe-public/gitgat"}, {"arrows": "to", "from": "scribe-public", "to": "scribe-public/sample-policies"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/mikey_forbidden_test"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/build2dockerhub.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "DOCKERHUB_PASSWORD"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/mikey_test"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/on-push.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "DOCKERHUB_USERNAME"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/mikey_gcr_test"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/sp800-190-blog"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/discover.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/file-integrity-demo.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/policy-check.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/trivy.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/discoverFdockerhub.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "SCRIBE_GOLD_TEAM_TOKEN"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/buildonly2gcr.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "SCRIBE_STAGING_TOKEN"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "DEMO_GH_SECRET"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/full-pipeline.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/main"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "SCRIBE_HEYMAN_TEAM_TOKEN"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/activate-workflows.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/merge"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/policy-pr.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline", "to": "scribe-public/demo-pipeline/.github/workflows/scan-repos.yml"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15318998681"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15322005324"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15318216265"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15318437188"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15293499020"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15291985457"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15319277887"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15298297812"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15295456960"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15291897730"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15318236825"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15318512164"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15318273319"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15319328318"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15317452565"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15318950682"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15293758901"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15451066278"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15460109318"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15237010494"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15238103456"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15238329707"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15239345431"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15238616341"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15239591210"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15238994294"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15439889079"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/discover.yml", "to": "15584026069"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/policy-check.yml", "to": "15317404784"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/policy-check.yml", "to": "15269204245"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/policy-check.yml", "to": "15269200253"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/policy-check.yml", "to": "15269182588"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15439753547"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15445832023"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15808556525"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15583937594"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15459584376"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15808557924"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15808387407"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15808346339"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15808532271"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15808535024"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15439357956"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15439241969"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15439209276"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15459823635"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15808536790"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/build2gcr.yml", "to": "15583650366"}, {"arrows": "to", "from": "scribe-public/demo-pipeline/.github/workflows/scan-repos.yml", "to": "15440763789"}, {"arrows": "to", "from": "15583937594", "to": "sha256:381500b4d0cd09e3ba014796b064a9a1f4e0dfd9470003d2b079f10a5eb041f6"}, {"arrows": "to", "from": "15583937594", "to": "sha256:523dedef734de27dc4bfe4de4a5f5e0e7bbb8e65ed590135d62889aabcc99eb2"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/scribesecurity-astro-analytics-2-1-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/nginx-latest-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/scribesecurity-astro-analytics-3-0-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-11-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/scribesecurity-astro-analytics-3-1-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-8-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-9-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-36-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery", "to": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-security-astro-analytics-5-pod"}, {"arrows": "to", "from": "minikube@k8s/astro-analytics-discovery/ghcr-io-scribe-public-astro-analytics-36-pod", "to": "sha256:381500b4d0cd09e3ba014796b064a9a1f4e0dfd9470003d2b079f10a5eb041f6"}]);
101
+
102
+ nodeColors = {};
103
+ allNodes = nodes.get({ returnType: "Object" });
104
+ for (nodeId in allNodes) {
105
+ nodeColors[nodeId] = allNodes[nodeId].color;
106
+ }
107
+ allEdges = edges.get({ returnType: "Object" });
108
+ // adding nodes and edges to the graph
109
+ data = {nodes: nodes, edges: edges};
110
+
111
+ var options = {
112
+ "configure": {
113
+ "enabled": true,
114
+ "filter": [
115
+ "physics",
116
+ "interaction",
117
+ "clustering"
118
+ ]
119
+ },
120
+ "edges": {
121
+ "color": {
122
+ "inherit": true
123
+ },
124
+ "smooth": {
125
+ "enabled": true,
126
+ "type": "dynamic"
127
+ }
128
+ },
129
+ "interaction": {
130
+ "dragNodes": true,
131
+ "hideEdgesOnDrag": false,
132
+ "hideNodesOnDrag": false
133
+ },
134
+ "physics": {
135
+ "enabled": false,
136
+ "stabilization": {
137
+ "enabled": true,
138
+ "fit": true,
139
+ "iterations": 1000,
140
+ "onlyDynamicEdges": false,
141
+ "updateInterval": 50
142
+ }
143
+ }
144
+ };
145
+
146
+
147
+
148
+
149
+
150
+ // if this network requires displaying the configure window,
151
+ // put it in its div
152
+ options.configure["container"] = document.getElementById("config");
153
+
154
+
155
+ network = new vis.Network(container, data, options);
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ return network;
167
+
168
+ }
169
+ drawGraph();
170
+ </script>
171
+
172
+ <script type="text/javascript">
173
+ window.addEventListener('load', () => {
174
+ const types = ['branch', 'image', 'namespace', 'organization', 'pod', 'repo', 'repo_secret', 'workflow', 'workflow_run'];
175
+ const colors = {'branch': '#e6194B', 'image': '#3cb44b', 'namespace': '#ffe119', 'organization': '#4363d8', 'pod': '#f58231', 'repo': '#911eb4', 'repo_secret': '#46f0f0', 'workflow': '#f032e6', 'workflow_run': '#bcf60c'};
176
+ types.forEach(t => {
177
+ network.cluster({
178
+ joinCondition: opts => opts.group === t,
179
+ clusterNodeProperties: {
180
+ id: 'cluster:' + t,
181
+ label: 'Cluster: ' + t,
182
+ shape: 'box',
183
+ color: {
184
+ background: colors[t],
185
+ border: colors[t],
186
+ highlight: {background: colors[t], border: colors[t]},
187
+ hover: {background: colors[t], border: colors[t]}
188
+ }
189
+ }
190
+ });
191
+ });
192
+ network.on('doubleClick', params => {
193
+ if (params.nodes.length === 1) {
194
+ const id = params.nodes[0];
195
+ if (network.isCluster(id)) {
196
+ network.openCluster(id);
197
+ }
198
+ }
199
+ });
200
+ });
201
+ </script>
202
+ <div id='legend' style='position:fixed; top:10px; right:10px; background:white; border:1px solid #ccc; padding:10px; font-family:Arial;'><strong>Legend</strong><br><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#e6194B; border:1px solid #000; display:inline-block; margin-right:5px;'></span>branch</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#3cb44b; border:1px solid #000; display:inline-block; margin-right:5px;'></span>image</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#ffe119; border:1px solid #000; display:inline-block; margin-right:5px;'></span>namespace</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#4363d8; border:1px solid #000; display:inline-block; margin-right:5px;'></span>organization</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#f58231; border:1px solid #000; display:inline-block; margin-right:5px;'></span>pod</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#911eb4; border:1px solid #000; display:inline-block; margin-right:5px;'></span>repo</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#46f0f0; border:1px solid #000; display:inline-block; margin-right:5px;'></span>repo_secret</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#f032e6; border:1px solid #000; display:inline-block; margin-right:5px;'></span>workflow</div><div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:#bcf60c; border:1px solid #000; display:inline-block; margin-right:5px;'></span>workflow_run</div></div>
203
+ </body>
204
+ </html>
requirements.txt ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ asttokens==3.0.0
2
+ certifi==2025.1.31
3
+ charset-normalizer==3.4.1
4
+ decorator==5.2.1
5
+ exceptiongroup==1.3.0
6
+ executing==2.2.0
7
+ idna==3.10
8
+ ipython==8.37.0
9
+ jedi==0.19.2
10
+ Jinja2==3.1.6
11
+ jsonpickle==4.1.1
12
+ MarkupSafe==3.0.2
13
+ matplotlib-inline==0.1.7
14
+ networkx==3.4.2
15
+ parso==0.8.4
16
+ pexpect==4.9.0
17
+ prompt_toolkit==3.0.51
18
+ ptyprocess==0.7.0
19
+ pure_eval==0.2.3
20
+ Pygments==2.19.2
21
+ PyJWT==2.10.1
22
+ pyvis==0.3.2
23
+ requests==2.32.3
24
+ -e git+ssh://git@github.com/scribe-security/scribe-python-client.git@21e95e1bdd4f7b25b506baa4cd03174e1301ba12#egg=scribe_python_client
25
+ stack-data==0.6.3
26
+ traitlets==5.14.3
27
+ typing_extensions==4.14.0
28
+ urllib3==2.4.0
29
+ wcwidth==0.2.13
scribe_python_client/cli.py CHANGED
@@ -25,6 +25,7 @@ def main():
25
  parser.add_argument("--product-name", required=False, help="The name of the product (required for specific API calls)")
26
  parser.add_argument("--attestation-id", required=False, help="The ID of the attestation (required for get-attestation API call)")
27
  parser.add_argument("--query", required=False, help="The query to run on the dataset (required for query commands)")
 
28
 
29
  args = parser.parse_args()
30
 
@@ -75,6 +76,9 @@ def main():
75
  print(client.query_policy_results(querystr=args.query))
76
  elif args.api_call == "query-lineage":
77
  print(client.query_lineage(querystr=args.query))
 
 
 
78
 
79
  if __name__ == "__main__":
80
  main()
 
25
  parser.add_argument("--product-name", required=False, help="The name of the product (required for specific API calls)")
26
  parser.add_argument("--attestation-id", required=False, help="The ID of the attestation (required for get-attestation API call)")
27
  parser.add_argument("--query", required=False, help="The query to run on the dataset (required for query commands)")
28
+ parser.add_argument("--lineage-graph-file", required=False, help="The file to save the lineage graph to (optional)")
29
 
30
  args = parser.parse_args()
31
 
 
76
  print(client.query_policy_results(querystr=args.query))
77
  elif args.api_call == "query-lineage":
78
  print(client.query_lineage(querystr=args.query))
79
+ if args.lineage_graph_file:
80
+ client.query_lineage(args.query, graph_filename=args.lineage_graph_file)
81
+ # logging.info(f"Lineage graph saved to {args.lineage_graph_file}")
82
 
83
  if __name__ == "__main__":
84
  main()
scribe_python_client/client.py CHANGED
@@ -7,6 +7,7 @@ import jwt
7
  import urllib #Needed for avoiding using requests, which modified the S3 presigned URL
8
 
9
  from .utils import convert_timestamps, send_post_request, send_get_request, decode_jwt_token, querystr_to_json, att2statement
 
10
 
11
  from .constants import (
12
  SCRIBE_VULNERABILITIES_DATASET,
@@ -1033,12 +1034,24 @@ class ScribeClient:
1033
  return f"{title}\n{self.format_query_result_table(r)}"
1034
  return "Error running query"
1035
 
1036
- def query_lineage(self, querystr, title="") -> str:
1037
  logging.debug(f"Query lineage with: {querystr}")
1038
  query = self.querystr_to_json(querystr)
1039
  if query:
1040
  r = self.query_superset(self.scribe_lineage_dataset, query, time_tokens=["timestamp"])
1041
  if r:
 
 
 
 
 
 
 
 
 
 
 
 
1042
  return f"{title}\n{self.format_query_result_table(r)}"
1043
  return "Error running query"
1044
 
 
7
  import urllib #Needed for avoiding using requests, which modified the S3 presigned URL
8
 
9
  from .utils import convert_timestamps, send_post_request, send_get_request, decode_jwt_token, querystr_to_json, att2statement
10
+ from .lineage_graph import create_lineage_graph
11
 
12
  from .constants import (
13
  SCRIBE_VULNERABILITIES_DATASET,
 
1034
  return f"{title}\n{self.format_query_result_table(r)}"
1035
  return "Error running query"
1036
 
1037
+ def query_lineage(self, querystr, title="", graph_filename=None) -> str:
1038
  logging.debug(f"Query lineage with: {querystr}")
1039
  query = self.querystr_to_json(querystr)
1040
  if query:
1041
  r = self.query_superset(self.scribe_lineage_dataset, query, time_tokens=["timestamp"])
1042
  if r:
1043
+ if graph_filename:
1044
+ required_fields = ["asset_name", "asset_type", "parent_name", "parent_type", "external_id", "parent_external_id", "uri"]
1045
+ columns = query.get("columns", [])
1046
+ if not all(field in columns for field in required_fields):
1047
+ logging.error(f"Query must include the following fields: {', '.join(required_fields)}")
1048
+ return "Error: Query must include required fields for lineage graph generation."
1049
+
1050
+ lineage_data = r["result"][0]["data"]
1051
+ full_path_filename = create_lineage_graph(lineage_data, output_file=graph_filename)
1052
+ logging.info(f"Lineage graph saved to {full_path_filename}")
1053
+ else:
1054
+ logging.warning("No graph filename provided, lineage graph will not be generated.")
1055
  return f"{title}\n{self.format_query_result_table(r)}"
1056
  return "Error running query"
1057
 
scribe_python_client/lineage_graph.py ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import networkx as nx
3
+ # import plotly.graph_objects as go
4
+ from pyvis.network import Network
5
+ from pathlib import Path
6
+
7
+
8
+ def create_network(data, include_types, type_to_position):
9
+ G = nx.DiGraph()
10
+ for record in data:
11
+ asset_type = record.get("asset_type")
12
+ parent_type = record.get("parent_type")
13
+ child = record.get("external_id")
14
+ parent = record.get("parent_external_id")
15
+ # Filter nodes based on allowed types.
16
+ add_child = include_types is None or asset_type in include_types
17
+ add_parent = include_types is None or parent_type in include_types
18
+
19
+ if add_child and child:
20
+ node_attrs = {"type": asset_type, "label": record.get("asset_name")}
21
+ if record.get("uri"):
22
+ node_attrs["uri"] = record.get("uri")
23
+ G.add_node(child, **node_attrs)
24
+ if parent and add_parent:
25
+ node_attrs = {"type": parent_type, "label": record.get("parent_name")}
26
+ if record.get("uri"):
27
+ node_attrs["uri"] = record.get("uri")
28
+ G.add_node(parent, **node_attrs)
29
+ if child and parent and add_child and add_parent:
30
+ G.add_edge(parent, child)
31
+
32
+ # Assign 'layer' attribute for each node based on its type.
33
+ for node in G.nodes():
34
+ node_type = G.nodes[node].get('type')
35
+ G.nodes[node]['layer'] = type_to_position.get(node_type, 1)
36
+ return G
37
+
38
+ # def visualize_network_plotly(data, include_types, type_to_position):
39
+ # """
40
+ # Build and return a Plotly figure of a network graph.
41
+
42
+ # Parameters:
43
+ # data (list): JSON array of records.
44
+ # include_types (set): Allowed asset types.
45
+ # type_to_position (dict): Mapping of asset types to numeric layer positions.
46
+
47
+ # Returns:
48
+ # go.Figure: The Plotly figure with the network visualization.
49
+ # """
50
+ # # Create network graph
51
+
52
+ # G = create_network(data, include_types, type_to_position)
53
+ # # Compute positions using a multipartite layout (vertical alignment)
54
+ # pos = nx.multipartite_layout(G, subset_key="layer", align="vertical")
55
+
56
+ # # Build edge coordinates for Plotly
57
+ # edge_x, edge_y = [], []
58
+ # for source, target in G.edges():
59
+ # x0, y0 = pos[source]
60
+ # x1, y1 = pos[target]
61
+ # edge_x.extend([x0, x1, None])
62
+ # edge_y.extend([y0, y1, None])
63
+ # edge_trace = go.Scatter(
64
+ # x=edge_x, y=edge_y,
65
+ # line=dict(width=1, color='#888'),
66
+ # hoverinfo='none',
67
+ # mode='lines'
68
+ # )
69
+
70
+ # # Build node coordinates and text lists.
71
+ # node_x, node_y = [], []
72
+ # node_text_trunc, node_text_hover, node_color = [], [], []
73
+ # for node in G.nodes():
74
+ # x, y = pos[node]
75
+ # node_x.append(x)
76
+ # node_y.append(y)
77
+ # full_label = G.nodes[node].get('label', str(node))
78
+ # truncated_label = full_label[0:30] # truncated version for display
79
+ # # Check for a "uri" attribute (lowercase) and create a clickable link if present.
80
+ # uri = G.nodes[node].get('uri')
81
+ # uri_link = f'<br><a href="{uri}" target="_blank">{uri}</a>' if uri else ""
82
+ # node_text_trunc.append(f"{truncated_label}<br>Type: {G.nodes[node].get('type')}")
83
+ # node_text_hover.append(f"{full_label}<br>Type: {G.nodes[node].get('type')}{uri_link}")
84
+ # node_color.append(G.nodes[node]['layer'])
85
+
86
+ # node_trace = go.Scatter(
87
+ # x=node_x, y=node_y,
88
+ # mode='markers+text',
89
+ # textposition="bottom center",
90
+ # hoverinfo='text',
91
+ # marker=dict(
92
+ # showscale=True,
93
+ # colorscale='YlGnBu',
94
+ # reversescale=True,
95
+ # color=node_color,
96
+ # size=15,
97
+ # colorbar=dict(title='Layer')
98
+ # ),
99
+ # text=node_text_trunc, # Display truncated text on the plot.
100
+ # hovertext=node_text_hover # Full text (with clickable URL if present) for hover.
101
+ # )
102
+
103
+ # # Create the Plotly figure.
104
+ # fig = go.Figure(data=[edge_trace, node_trace],
105
+ # layout=go.Layout(
106
+ # title='<br>Integrated Network Graph Visualization',
107
+ # titlefont_size=16,
108
+ # dragmode='pan',
109
+ # showlegend=False,
110
+ # hovermode='closest',
111
+ # margin=dict(b=20, l=5, r=5, t=40),
112
+ # width=1000,
113
+ # height=800,
114
+ # xaxis=dict(showgrid=False, zeroline=False, showticklabels=False),
115
+ # yaxis=dict(showgrid=False, zeroline=False, showticklabels=False)
116
+ # ))
117
+ # return fig
118
+
119
+ def filter_network(data, include_types, include_fields):
120
+ """
121
+ Filter the data to only include records of the specified types
122
+ and remove specified fields.
123
+
124
+ Parameters:
125
+ data (list): List of JSON records.
126
+ include_types (set): Asset types to keep.
127
+ include_fields (set): Fields to remove from records.
128
+
129
+ Returns:
130
+ list: Filtered data.
131
+ """
132
+ filtered_data = []
133
+
134
+ for record in data:
135
+ if record.get("asset_type") in include_types:
136
+ # Create a copy to avoid modifying original data
137
+ filtered_record = {key: value for key, value in record.items() if key in include_fields}
138
+ filtered_data.append(filtered_record)
139
+
140
+ return filtered_data
141
+
142
+ def visualize_network_pyvis(data, include_types, type_to_position, output_html = "graph.html"):
143
+
144
+ width="100%"
145
+ height="1200px"
146
+ layer_spacing=2.0
147
+ node_spacing=2.0
148
+
149
+ # import tempfile
150
+ # output_html = tempfile.NamedTemporaryFile(delete=False)
151
+
152
+ G = create_network(data, include_types, type_to_position) # Create the network graph
153
+ # 1. Assign hierarchy and determine types
154
+ nx.set_node_attributes(
155
+ G,
156
+ {n: type_to_position.get(attrs["type"], 0) for n, attrs in G.nodes(data=True)},
157
+ name="layer"
158
+ )
159
+ types = sorted({attrs["type"] for _, attrs in G.nodes(data=True)})
160
+
161
+ # 2. Layout
162
+ pos = nx.multipartite_layout(G, subset_key="layer", align="horizontal")
163
+ pos = {n: (x * layer_spacing * 1000, y * node_spacing * 1000) for n, (x, y) in pos.items()}
164
+
165
+ # 3. Assign colors
166
+ base_colors = ["#e6194B", "#3cb44b", "#ffe119", "#4363d8", "#f58231",
167
+ "#911eb4", "#46f0f0", "#f032e6", "#bcf60c", "#fabebe"]
168
+ color_map = {t: base_colors[i % len(base_colors)] for i, t in enumerate(types)}
169
+
170
+ # 4. Build the graph
171
+ net = Network(width=width, height=height, directed=True)
172
+ net.toggle_physics(False)
173
+ net.toggle_drag_nodes(True)
174
+ net.show_buttons(filter_=["physics", "interaction", "clustering"])
175
+
176
+ for node_id, attrs in G.nodes(data=True):
177
+ x, y = pos[node_id]
178
+ t = attrs["type"]
179
+ c = color_map[t]
180
+ net.add_node(node_id, label=attrs.get("label", str(node_id)), title=f"{attrs.get('label')}<br>Type: {t}<br>{attrs.get('uri','')}",
181
+ x=x, y=y, physics=False, group=t,
182
+ color={"background": c, "border": c, "highlight": {"background": c, "border": c}, "hover": {"background": c, "border": c}})
183
+ for u, v in G.edges():
184
+ net.add_edge(u, v)
185
+
186
+ # 5. Inject clustering + double-click expand
187
+ cluster_js = f"""
188
+ <script type="text/javascript">
189
+ window.addEventListener('load', () => {{
190
+ const types = {types};
191
+ const colors = {color_map};
192
+ types.forEach(t => {{
193
+ network.cluster({{
194
+ joinCondition: opts => opts.group === t,
195
+ clusterNodeProperties: {{
196
+ id: 'cluster:' + t,
197
+ label: 'Cluster: ' + t,
198
+ shape: 'box',
199
+ color: {{
200
+ background: colors[t],
201
+ border: colors[t],
202
+ highlight: {{background: colors[t], border: colors[t]}},
203
+ hover: {{background: colors[t], border: colors[t]}}
204
+ }}
205
+ }}
206
+ }});
207
+ }});
208
+ network.on('doubleClick', params => {{
209
+ if (params.nodes.length === 1) {{
210
+ const id = params.nodes[0];
211
+ if (network.isCluster(id)) {{
212
+ network.openCluster(id);
213
+ }}
214
+ }}
215
+ }});
216
+ }});
217
+ </script>
218
+ """
219
+
220
+ # 6. Inject a floating HTML legend panel
221
+ legend_html = "<div id='legend' style='position:fixed; top:10px; right:10px; background:white; border:1px solid #ccc; padding:10px; font-family:Arial;'><strong>Legend</strong><br>"
222
+ for t in types:
223
+ c = color_map[t]
224
+ legend_html += f"<div style='display:flex; align-items:center; margin-top:5px;'><span style='width:15px; height:15px; background:{c}; border:1px solid #000; display:inline-block; margin-right:5px;'></span>{t}</div>"
225
+ legend_html += "</div>"
226
+
227
+ # net.toggle_physics(True)
228
+
229
+
230
+ # Combine HTML parts
231
+ net.save_graph(output_html)
232
+ with open(output_html, "r+", encoding="utf-8") as f:
233
+ html = f.read().replace("</body>", cluster_js + legend_html + "\n</body>")
234
+ f.seek(0); f.write(html); f.truncate()
235
+
236
+ return output_html
237
+
238
+ def create_lineage_graph(lineage_data, type="pyvis", output_file="graph.html"):
239
+
240
+ all_types = {record.get("asset_type") for record in lineage_data if record.get("asset_type")}
241
+ # Exclude unwanted types.
242
+ exclude_types = {"user", "secret", "org_secret", "commit", "actor", "build_machine"}
243
+ types_to_position = {
244
+ "organization": 1,
245
+ "repo": 2,
246
+ "branch": 3,
247
+ "workflow": 4,
248
+ "workflow_run": 5,
249
+ "image": 6,
250
+ "pod": 7,
251
+ "namespace": 8
252
+
253
+ }
254
+ include_types = all_types - exclude_types
255
+ # Generate and display the network visualization.
256
+ if type == "plotly":
257
+ # fig = visualize_network_plotly(lineage_data, include_types, types_to_position)
258
+ return None
259
+ else:
260
+ output_file = Path(output_file)
261
+ output_file.touch(exist_ok=True)
262
+ output_file = output_file.resolve()
263
+ output_file = str(output_file)
264
+ file = visualize_network_pyvis(lineage_data, include_types, types_to_position, output_html=output_file)
265
+ return file
266
+
267
+ if __name__ == "__main__":
268
+ # Open the JSON file and load data.
269
+ filepath = "demo-data/astro-lineage.json"
270
+ with open(filepath, "r") as f:
271
+ data = json.load(f)
272
+
273
+
274
+ filename = create_lineage_graph(data, output_file="demo-data/lineage_graph.html")
275
+ print(f"Network graph saved to {filename}")
276
+ print(f"Open by browsing file:///{filename}")
scribe_python_client/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.4"
 
1
+ __version__ = "0.1.5"