airgap-datahub 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airgap_datahub-0.1.0/LICENSE +201 -0
- airgap_datahub-0.1.0/PKG-INFO +226 -0
- airgap_datahub-0.1.0/README.md +190 -0
- airgap_datahub-0.1.0/airgap/__init__.py +3 -0
- airgap_datahub-0.1.0/airgap/__main__.py +4 -0
- airgap_datahub-0.1.0/airgap/cli.py +207 -0
- airgap_datahub-0.1.0/airgap/data/__init__.py +1 -0
- airgap_datahub-0.1.0/airgap/data/acme_datalake.json +166 -0
- airgap_datahub-0.1.0/airgap/data/config.yaml +51 -0
- airgap_datahub-0.1.0/airgap/detect/__init__.py +4 -0
- airgap_datahub-0.1.0/airgap/detect/findings.py +85 -0
- airgap_datahub-0.1.0/airgap/detect/rules.py +216 -0
- airgap_datahub-0.1.0/airgap/llm/__init__.py +3 -0
- airgap_datahub-0.1.0/airgap/llm/ollama.py +84 -0
- airgap_datahub-0.1.0/airgap/model.py +127 -0
- airgap_datahub-0.1.0/airgap/remediate/__init__.py +3 -0
- airgap_datahub-0.1.0/airgap/remediate/patches.py +108 -0
- airgap_datahub-0.1.0/airgap/report/__init__.py +4 -0
- airgap_datahub-0.1.0/airgap/report/graph_html.py +168 -0
- airgap_datahub-0.1.0/airgap/report/markdown.py +76 -0
- airgap_datahub-0.1.0/airgap/sources/__init__.py +31 -0
- airgap_datahub-0.1.0/airgap/sources/base.py +20 -0
- airgap_datahub-0.1.0/airgap/sources/datahub.py +193 -0
- airgap_datahub-0.1.0/airgap/sources/datahub_lite.py +192 -0
- airgap_datahub-0.1.0/airgap/sources/fixture.py +71 -0
- airgap_datahub-0.1.0/airgap_datahub.egg-info/PKG-INFO +226 -0
- airgap_datahub-0.1.0/airgap_datahub.egg-info/SOURCES.txt +33 -0
- airgap_datahub-0.1.0/airgap_datahub.egg-info/dependency_links.txt +1 -0
- airgap_datahub-0.1.0/airgap_datahub.egg-info/entry_points.txt +2 -0
- airgap_datahub-0.1.0/airgap_datahub.egg-info/requires.txt +8 -0
- airgap_datahub-0.1.0/airgap_datahub.egg-info/top_level.txt +1 -0
- airgap_datahub-0.1.0/pyproject.toml +56 -0
- airgap_datahub-0.1.0/setup.cfg +4 -0
- airgap_datahub-0.1.0/tests/test_cli_defaults.py +91 -0
- airgap_datahub-0.1.0/tests/test_detection.py +68 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work, excluding
|
|
103
|
+
those notices that do not pertain to any part of the Derivative
|
|
104
|
+
Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and do
|
|
117
|
+
not modify the License. You may add Your own attribution notices
|
|
118
|
+
within Derivative Works that You distribute, alongside or as an
|
|
119
|
+
addendum to the NOTICE text from the Work, provided that such
|
|
120
|
+
additional attribution notices cannot be construed as modifying
|
|
121
|
+
the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Airgap contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: airgap-datahub
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local-first data governance & PII lineage auditor for DataHub. Nothing leaves your machine.
|
|
5
|
+
Author: Zeliha Ilgın Güven
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/zelihaguven/airgap
|
|
8
|
+
Project-URL: Source, https://github.com/zelihaguven/airgap
|
|
9
|
+
Project-URL: Documentation, https://github.com/zelihaguven/airgap/blob/main/docs/DOCUMENTATION.md
|
|
10
|
+
Project-URL: Issues, https://github.com/zelihaguven/airgap/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/zelihaguven/airgap/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: datahub,governance,pii,lineage,compliance,gdpr,kvkk,ollama,local-first,data-catalog
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Information Technology
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Database
|
|
24
|
+
Classifier: Topic :: Security
|
|
25
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: requests>=2.28
|
|
30
|
+
Requires-Dist: pyyaml>=6.0
|
|
31
|
+
Provides-Extra: datahub-lite
|
|
32
|
+
Requires-Dist: acryl-datahub[datahub-lite]>=1.6.0; extra == "datahub-lite"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# 🛡️ Airgap
|
|
38
|
+
|
|
39
|
+
[](https://github.com/zelihaguven/airgap/actions/workflows/test.yml)
|
|
40
|
+
|
|
41
|
+
**Local-first data governance & PII lineage auditor for [DataHub](https://datahubproject.io).**
|
|
42
|
+
Finds where sensitive data leaks downstream — without a single byte of your metadata ever leaving your machine.
|
|
43
|
+
|
|
44
|
+
> Built for the **DataHub Agent Hackathon** (Wildcard / Regulatory Automation).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## The problem
|
|
49
|
+
|
|
50
|
+
PII gets classified correctly at the source (`users.email` → `PII`). But as that
|
|
51
|
+
data flows through dozens of transforms, dashboards, and ML features, **the
|
|
52
|
+
classification doesn't travel with it.** The result:
|
|
53
|
+
|
|
54
|
+
- PII lands in untagged downstream tables and dashboards → GDPR/KVKK exposure.
|
|
55
|
+
- Those derived assets often have **no owner** → nobody is accountable.
|
|
56
|
+
- Auditing it means walking the lineage graph by hand → doesn't scale.
|
|
57
|
+
- Automating it usually means shipping your schema/metadata to a **cloud LLM** —
|
|
58
|
+
so the tool meant to protect sensitive data becomes a new way to leak it.
|
|
59
|
+
|
|
60
|
+
## The idea
|
|
61
|
+
|
|
62
|
+
Airgap reads DataHub's metadata (tags, glossary terms, column-level
|
|
63
|
+
classification, lineage, ownership), walks the lineage graph, and flags
|
|
64
|
+
**governance leaks** with deterministic rules. It then uses a **local Ollama
|
|
65
|
+
model** to explain each finding in plain language.
|
|
66
|
+
|
|
67
|
+
**Detection is plain, testable code. The LLM only explains — it never decides.**
|
|
68
|
+
That makes results reproducible and hallucination-free, and it means the whole
|
|
69
|
+
audit runs offline.
|
|
70
|
+
|
|
71
|
+
> The one-liner: **an air-gapped auditor for the data you can't afford to leak.**
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Demo & media
|
|
76
|
+
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
*Airgap's leak map — red paths are where PII escapes, ranked by blast radius. Generated from a **real, local DataHub Lite** run (no Docker, no cloud).*
|
|
80
|
+
|
|
81
|
+
- 🎬 **Demo film** (self-playing walkthrough) — [open live ↗](https://htmlpreview.github.io/?https://github.com/zelihaguven/airgap/blob/main/docs/demo_film.html)
|
|
82
|
+
- 🗺️ **Interactive leak map** — [open live ↗](https://htmlpreview.github.io/?https://github.com/zelihaguven/airgap/blob/main/examples/lineage_graph.html)
|
|
83
|
+
- 🖥️ **Slide deck** — [open live ↗](https://htmlpreview.github.io/?https://github.com/zelihaguven/airgap/blob/main/docs/presentation.html)
|
|
84
|
+
- ▶️ **Video walkthrough** — _add your YouTube link here_
|
|
85
|
+
- 📝 [Project writeup](docs/DEVPOST.md) · 🎥 [video script](docs/VIDEO_SCRIPT.md)
|
|
86
|
+
- 📚 [Technical documentation](docs/DOCUMENTATION.md) · 🧭 [Product requirements doc (PRD, in Turkish)](docs/PRD.md)
|
|
87
|
+
|
|
88
|
+
<p align="center">
|
|
89
|
+
<img src="https://raw.githubusercontent.com/zelihaguven/airgap/main/docs/media/hero.png" width="32%" alt="Airgap">
|
|
90
|
+
<img src="https://raw.githubusercontent.com/zelihaguven/airgap/main/docs/media/findings.png" width="32%" alt="5 governance leaks found">
|
|
91
|
+
<img src="https://raw.githubusercontent.com/zelihaguven/airgap/main/docs/media/architecture.png" width="32%" alt="How Airgap works">
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
All docs live in [`docs/`](docs) and media assets in [`docs/media/`](docs/media).
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Install
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
pip install airgap-datahub
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The PyPI distribution is named `airgap-datahub`; the command and the import
|
|
105
|
+
name are both `airgap`. The default config and the synthetic demo catalog ship
|
|
106
|
+
inside the package, so this works from any directory, with no setup:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
airgap audit --no-llm # writes ./outputs/ in the current directory
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Configuration lookup
|
|
113
|
+
|
|
114
|
+
`airgap audit` picks its config in this order:
|
|
115
|
+
|
|
116
|
+
1. `--config path/to/config.yaml`, if given;
|
|
117
|
+
2. `config.yaml` in the current directory, if present;
|
|
118
|
+
3. the default config bundled with the package (same content as
|
|
119
|
+
[`config.yaml`](config.yaml) in this repo), which audits the bundled demo
|
|
120
|
+
catalog.
|
|
121
|
+
|
|
122
|
+
A relative `fixture_path` is resolved against the directory of the config file
|
|
123
|
+
that sets it; an empty `fixture_path` means the bundled demo catalog. Outputs go
|
|
124
|
+
to `./outputs/` in the current directory; change that with `--out DIR`.
|
|
125
|
+
|
|
126
|
+
## Quickstart (from source, with the bundled demo catalog)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
git clone https://github.com/zelihaguven/airgap.git && cd airgap
|
|
130
|
+
python3 -m venv .venv && ./.venv/bin/pip install -e .
|
|
131
|
+
|
|
132
|
+
# Audit the bundled synthetic catalog (zero setup, fully offline)
|
|
133
|
+
./.venv/bin/airgap audit
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Outputs land in `./outputs/` (relative to the current directory):
|
|
137
|
+
- `findings.json` — machine-readable findings
|
|
138
|
+
- `report.md` — human-readable governance report
|
|
139
|
+
|
|
140
|
+
Skip the LLM (deterministic only) with `--no-llm`. See `examples/` for sample output.
|
|
141
|
+
|
|
142
|
+
### Requirements
|
|
143
|
+
- Python 3.10+
|
|
144
|
+
- (optional) [Ollama](https://ollama.com) running locally for prose explanations
|
|
145
|
+
— `ollama pull qwen2.5:7b`. Without it, Airgap still produces the full
|
|
146
|
+
deterministic report.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Run against a REAL DataHub — no Docker, no cloud
|
|
151
|
+
|
|
152
|
+
Airgap ships with a one-command setup that stands up a **local, Docker-free
|
|
153
|
+
DataHub** ([DataHub Lite](https://docs.datahub.com/docs/datahub-lite) — a DuckDB-backed
|
|
154
|
+
instance), seeds it with the Acme catalog as genuine DataHub metadata aspects,
|
|
155
|
+
and imports it:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bash scripts/setup_datahub_lite.sh
|
|
159
|
+
./.venv/bin/airgap audit --source datahub-lite
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Airgap then reads real DataHub metadata back — `schemaMetadata` with field-level
|
|
163
|
+
tags & glossary terms, `ownership`, `upstreamLineage` with column-level
|
|
164
|
+
`fineGrainedLineages`, and `dashboardInfo` — through the `datahub lite` CLI, and
|
|
165
|
+
runs the **exact same detection** it runs on the fixture. This is Airgap's thesis
|
|
166
|
+
in one line: **a local-first governance auditor reading from a local-first DataHub.**
|
|
167
|
+
|
|
168
|
+
## Auditing a live DataHub (GMS)
|
|
169
|
+
|
|
170
|
+
The same detection also runs against any hosted DataHub via GraphQL:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
./.venv/bin/airgap audit --source datahub \
|
|
174
|
+
--url https://your-company.acryl.io \
|
|
175
|
+
--token $DATAHUB_TOKEN
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Only read-only queries are issued. LLM calls always go only to localhost.
|
|
179
|
+
|
|
180
|
+
### The three sources, one model
|
|
181
|
+
`fixture` (zero setup) · `datahub-lite` (real DataHub, local, no Docker) ·
|
|
182
|
+
`datahub` (live GMS). All normalize into the same `MetadataGraph`, so detection
|
|
183
|
+
is identical regardless of source.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## How detection works
|
|
188
|
+
|
|
189
|
+
| Rule | Detects |
|
|
190
|
+
|---|---|
|
|
191
|
+
| **R1 — Untagged PII propagation** | A field classified as PII/sensitive flows, through column-level lineage, into a downstream field/dataset carrying no equivalent classification. |
|
|
192
|
+
| **R2 — Ownerless sensitive asset** | A dataset that holds sensitive data (directly or by lineage) has no owner — nobody is accountable. |
|
|
193
|
+
|
|
194
|
+
**Severity** is driven by *blast radius*: the transitive downstream consumers of
|
|
195
|
+
the leaking asset. Human-facing consumers (dashboards, charts) escalate a leak to
|
|
196
|
+
CRITICAL, because that's PII reaching real eyes.
|
|
197
|
+
|
|
198
|
+
Every finding ships with the **lineage evidence path** (`users.email → stg_users.email
|
|
199
|
+
→ dim_customer.email → marketing_enriched.email`) so it's auditable, not a black box.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Architecture
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
DataHub (GraphQL, read-only) ─┐
|
|
207
|
+
├─► normalize ─► detect (R1/R2 + blast radius)
|
|
208
|
+
bundled fixture (JSON) ─┘ │
|
|
209
|
+
▼
|
|
210
|
+
local Ollama ◄──── explain findings
|
|
211
|
+
(localhost only) │
|
|
212
|
+
▼
|
|
213
|
+
outputs/ findings.json + report.md
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
- `airgap/model.py` — normalized metadata model (the source-agnostic contract)
|
|
217
|
+
- `airgap/sources/` — `datahub` (live GraphQL) + `fixture` (synthetic)
|
|
218
|
+
- `airgap/detect/` — deterministic rules + severity
|
|
219
|
+
- `airgap/llm/` — local Ollama explanation layer
|
|
220
|
+
- `airgap/report/` — Markdown / JSON output
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## License
|
|
225
|
+
|
|
226
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# 🛡️ Airgap
|
|
2
|
+
|
|
3
|
+
[](https://github.com/zelihaguven/airgap/actions/workflows/test.yml)
|
|
4
|
+
|
|
5
|
+
**Local-first data governance & PII lineage auditor for [DataHub](https://datahubproject.io).**
|
|
6
|
+
Finds where sensitive data leaks downstream — without a single byte of your metadata ever leaving your machine.
|
|
7
|
+
|
|
8
|
+
> Built for the **DataHub Agent Hackathon** (Wildcard / Regulatory Automation).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The problem
|
|
13
|
+
|
|
14
|
+
PII gets classified correctly at the source (`users.email` → `PII`). But as that
|
|
15
|
+
data flows through dozens of transforms, dashboards, and ML features, **the
|
|
16
|
+
classification doesn't travel with it.** The result:
|
|
17
|
+
|
|
18
|
+
- PII lands in untagged downstream tables and dashboards → GDPR/KVKK exposure.
|
|
19
|
+
- Those derived assets often have **no owner** → nobody is accountable.
|
|
20
|
+
- Auditing it means walking the lineage graph by hand → doesn't scale.
|
|
21
|
+
- Automating it usually means shipping your schema/metadata to a **cloud LLM** —
|
|
22
|
+
so the tool meant to protect sensitive data becomes a new way to leak it.
|
|
23
|
+
|
|
24
|
+
## The idea
|
|
25
|
+
|
|
26
|
+
Airgap reads DataHub's metadata (tags, glossary terms, column-level
|
|
27
|
+
classification, lineage, ownership), walks the lineage graph, and flags
|
|
28
|
+
**governance leaks** with deterministic rules. It then uses a **local Ollama
|
|
29
|
+
model** to explain each finding in plain language.
|
|
30
|
+
|
|
31
|
+
**Detection is plain, testable code. The LLM only explains — it never decides.**
|
|
32
|
+
That makes results reproducible and hallucination-free, and it means the whole
|
|
33
|
+
audit runs offline.
|
|
34
|
+
|
|
35
|
+
> The one-liner: **an air-gapped auditor for the data you can't afford to leak.**
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Demo & media
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
*Airgap's leak map — red paths are where PII escapes, ranked by blast radius. Generated from a **real, local DataHub Lite** run (no Docker, no cloud).*
|
|
44
|
+
|
|
45
|
+
- 🎬 **Demo film** (self-playing walkthrough) — [open live ↗](https://htmlpreview.github.io/?https://github.com/zelihaguven/airgap/blob/main/docs/demo_film.html)
|
|
46
|
+
- 🗺️ **Interactive leak map** — [open live ↗](https://htmlpreview.github.io/?https://github.com/zelihaguven/airgap/blob/main/examples/lineage_graph.html)
|
|
47
|
+
- 🖥️ **Slide deck** — [open live ↗](https://htmlpreview.github.io/?https://github.com/zelihaguven/airgap/blob/main/docs/presentation.html)
|
|
48
|
+
- ▶️ **Video walkthrough** — _add your YouTube link here_
|
|
49
|
+
- 📝 [Project writeup](docs/DEVPOST.md) · 🎥 [video script](docs/VIDEO_SCRIPT.md)
|
|
50
|
+
- 📚 [Technical documentation](docs/DOCUMENTATION.md) · 🧭 [Product requirements doc (PRD, in Turkish)](docs/PRD.md)
|
|
51
|
+
|
|
52
|
+
<p align="center">
|
|
53
|
+
<img src="https://raw.githubusercontent.com/zelihaguven/airgap/main/docs/media/hero.png" width="32%" alt="Airgap">
|
|
54
|
+
<img src="https://raw.githubusercontent.com/zelihaguven/airgap/main/docs/media/findings.png" width="32%" alt="5 governance leaks found">
|
|
55
|
+
<img src="https://raw.githubusercontent.com/zelihaguven/airgap/main/docs/media/architecture.png" width="32%" alt="How Airgap works">
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
All docs live in [`docs/`](docs) and media assets in [`docs/media/`](docs/media).
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install airgap-datahub
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The PyPI distribution is named `airgap-datahub`; the command and the import
|
|
69
|
+
name are both `airgap`. The default config and the synthetic demo catalog ship
|
|
70
|
+
inside the package, so this works from any directory, with no setup:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
airgap audit --no-llm # writes ./outputs/ in the current directory
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Configuration lookup
|
|
77
|
+
|
|
78
|
+
`airgap audit` picks its config in this order:
|
|
79
|
+
|
|
80
|
+
1. `--config path/to/config.yaml`, if given;
|
|
81
|
+
2. `config.yaml` in the current directory, if present;
|
|
82
|
+
3. the default config bundled with the package (same content as
|
|
83
|
+
[`config.yaml`](config.yaml) in this repo), which audits the bundled demo
|
|
84
|
+
catalog.
|
|
85
|
+
|
|
86
|
+
A relative `fixture_path` is resolved against the directory of the config file
|
|
87
|
+
that sets it; an empty `fixture_path` means the bundled demo catalog. Outputs go
|
|
88
|
+
to `./outputs/` in the current directory; change that with `--out DIR`.
|
|
89
|
+
|
|
90
|
+
## Quickstart (from source, with the bundled demo catalog)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
git clone https://github.com/zelihaguven/airgap.git && cd airgap
|
|
94
|
+
python3 -m venv .venv && ./.venv/bin/pip install -e .
|
|
95
|
+
|
|
96
|
+
# Audit the bundled synthetic catalog (zero setup, fully offline)
|
|
97
|
+
./.venv/bin/airgap audit
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Outputs land in `./outputs/` (relative to the current directory):
|
|
101
|
+
- `findings.json` — machine-readable findings
|
|
102
|
+
- `report.md` — human-readable governance report
|
|
103
|
+
|
|
104
|
+
Skip the LLM (deterministic only) with `--no-llm`. See `examples/` for sample output.
|
|
105
|
+
|
|
106
|
+
### Requirements
|
|
107
|
+
- Python 3.10+
|
|
108
|
+
- (optional) [Ollama](https://ollama.com) running locally for prose explanations
|
|
109
|
+
— `ollama pull qwen2.5:7b`. Without it, Airgap still produces the full
|
|
110
|
+
deterministic report.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Run against a REAL DataHub — no Docker, no cloud
|
|
115
|
+
|
|
116
|
+
Airgap ships with a one-command setup that stands up a **local, Docker-free
|
|
117
|
+
DataHub** ([DataHub Lite](https://docs.datahub.com/docs/datahub-lite) — a DuckDB-backed
|
|
118
|
+
instance), seeds it with the Acme catalog as genuine DataHub metadata aspects,
|
|
119
|
+
and imports it:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
bash scripts/setup_datahub_lite.sh
|
|
123
|
+
./.venv/bin/airgap audit --source datahub-lite
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Airgap then reads real DataHub metadata back — `schemaMetadata` with field-level
|
|
127
|
+
tags & glossary terms, `ownership`, `upstreamLineage` with column-level
|
|
128
|
+
`fineGrainedLineages`, and `dashboardInfo` — through the `datahub lite` CLI, and
|
|
129
|
+
runs the **exact same detection** it runs on the fixture. This is Airgap's thesis
|
|
130
|
+
in one line: **a local-first governance auditor reading from a local-first DataHub.**
|
|
131
|
+
|
|
132
|
+
## Auditing a live DataHub (GMS)
|
|
133
|
+
|
|
134
|
+
The same detection also runs against any hosted DataHub via GraphQL:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
./.venv/bin/airgap audit --source datahub \
|
|
138
|
+
--url https://your-company.acryl.io \
|
|
139
|
+
--token $DATAHUB_TOKEN
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Only read-only queries are issued. LLM calls always go only to localhost.
|
|
143
|
+
|
|
144
|
+
### The three sources, one model
|
|
145
|
+
`fixture` (zero setup) · `datahub-lite` (real DataHub, local, no Docker) ·
|
|
146
|
+
`datahub` (live GMS). All normalize into the same `MetadataGraph`, so detection
|
|
147
|
+
is identical regardless of source.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## How detection works
|
|
152
|
+
|
|
153
|
+
| Rule | Detects |
|
|
154
|
+
|---|---|
|
|
155
|
+
| **R1 — Untagged PII propagation** | A field classified as PII/sensitive flows, through column-level lineage, into a downstream field/dataset carrying no equivalent classification. |
|
|
156
|
+
| **R2 — Ownerless sensitive asset** | A dataset that holds sensitive data (directly or by lineage) has no owner — nobody is accountable. |
|
|
157
|
+
|
|
158
|
+
**Severity** is driven by *blast radius*: the transitive downstream consumers of
|
|
159
|
+
the leaking asset. Human-facing consumers (dashboards, charts) escalate a leak to
|
|
160
|
+
CRITICAL, because that's PII reaching real eyes.
|
|
161
|
+
|
|
162
|
+
Every finding ships with the **lineage evidence path** (`users.email → stg_users.email
|
|
163
|
+
→ dim_customer.email → marketing_enriched.email`) so it's auditable, not a black box.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Architecture
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
DataHub (GraphQL, read-only) ─┐
|
|
171
|
+
├─► normalize ─► detect (R1/R2 + blast radius)
|
|
172
|
+
bundled fixture (JSON) ─┘ │
|
|
173
|
+
▼
|
|
174
|
+
local Ollama ◄──── explain findings
|
|
175
|
+
(localhost only) │
|
|
176
|
+
▼
|
|
177
|
+
outputs/ findings.json + report.md
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
- `airgap/model.py` — normalized metadata model (the source-agnostic contract)
|
|
181
|
+
- `airgap/sources/` — `datahub` (live GraphQL) + `fixture` (synthetic)
|
|
182
|
+
- `airgap/detect/` — deterministic rules + severity
|
|
183
|
+
- `airgap/llm/` — local Ollama explanation layer
|
|
184
|
+
- `airgap/report/` — Markdown / JSON output
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
Apache-2.0. See [LICENSE](LICENSE).
|