eyeo 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.
- eyeo-0.1.0/CHANGELOG.md +25 -0
- eyeo-0.1.0/LICENSE +202 -0
- eyeo-0.1.0/MANIFEST.in +8 -0
- eyeo-0.1.0/PKG-INFO +126 -0
- eyeo-0.1.0/README.md +97 -0
- eyeo-0.1.0/REFERENCE.md +146 -0
- eyeo-0.1.0/ROADMAP.md +21 -0
- eyeo-0.1.0/SECURITY.md +54 -0
- eyeo-0.1.0/SPEC.md +682 -0
- eyeo-0.1.0/eyeo.egg-info/PKG-INFO +126 -0
- eyeo-0.1.0/eyeo.egg-info/SOURCES.txt +19 -0
- eyeo-0.1.0/eyeo.egg-info/dependency_links.txt +1 -0
- eyeo-0.1.0/eyeo.egg-info/entry_points.txt +2 -0
- eyeo-0.1.0/eyeo.egg-info/requires.txt +4 -0
- eyeo-0.1.0/eyeo.egg-info/top_level.txt +1 -0
- eyeo-0.1.0/eyeo.py +2376 -0
- eyeo-0.1.0/pyproject.toml +43 -0
- eyeo-0.1.0/setup.cfg +4 -0
- eyeo-0.1.0/test_eyeo.py +2913 -0
- eyeo-0.1.0/tools/make_vectors.py +118 -0
- eyeo-0.1.0/vectors.json +203 -0
eyeo-0.1.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - unreleased
|
|
6
|
+
|
|
7
|
+
First public version.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Hidden values inside ordinary JSON files: one encrypted string per value (AES-256-GCM), the rest
|
|
12
|
+
of the file stays plain data that any program can parse.
|
|
13
|
+
- Reading shows `eyeo:hidden` in place of a hidden value (`ls`, `show`, `get`); `reveal` is the one
|
|
14
|
+
command that prints the plaintext.
|
|
15
|
+
- `set`, `hide`, `import`, `del` to put values into a store, hide the ones already there, and
|
|
16
|
+
remove them.
|
|
17
|
+
- `exec`: run a command with secrets in its environment; the values are blanked out of its output.
|
|
18
|
+
- `mask`: a filter that replaces known secret values in text.
|
|
19
|
+
- `doctor`: proves that every hidden value still decrypts, printing counts only.
|
|
20
|
+
- Key policies: an unlock string (the default for a new key; the key file alone decrypts nothing),
|
|
21
|
+
a guard that asks for an explicit acknowledgement before a reveal, or none.
|
|
22
|
+
- `rekey` to move a store from one key to another in one atomic write; `policy` to show a key's
|
|
23
|
+
policy and turn the guard on or off.
|
|
24
|
+
- Linux, macOS and Windows, Python 3.10+.
|
|
25
|
+
- A Python library in the same single file (`import eyeo`).
|
eyeo-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
eyeo-0.1.0/MANIFEST.in
ADDED
eyeo-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: eyeo
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Keep individual secrets hidden inside ordinary JSON files, so that tools and AI agents do not read them by accident
|
|
5
|
+
Author: gigaroai
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Keywords: secrets,configuration,json,encryption,masking,ai-agents
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Intended Audience :: System Administrators
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Security
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: cryptography
|
|
26
|
+
Provides-Extra: yaml
|
|
27
|
+
Requires-Dist: PyYAML; extra == "yaml"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# eyeo
|
|
31
|
+
|
|
32
|
+
Keeps the passwords and API tokens in your config files hidden, so that an AI assistant -- or anyone
|
|
33
|
+
else who opens the file -- does not get to read them.
|
|
34
|
+
|
|
35
|
+
You ask your AI coding assistant to fix a bug. It opens `config.json` to look around, and now your
|
|
36
|
+
API token is in the chat transcript. Nobody did anything wrong; the file was simply there to be read.
|
|
37
|
+
eyeo encrypts the few values that matter and leaves the rest of the file alone, so it is still
|
|
38
|
+
ordinary JSON that any program can open. Whoever reads it finds `eyeo:hidden` where the secret was.
|
|
39
|
+
|
|
40
|
+
Before:
|
|
41
|
+
|
|
42
|
+
$ cat config.json
|
|
43
|
+
{"ha": {"username": "bob", "password": "tok-EXAMPLE-123"}}
|
|
44
|
+
|
|
45
|
+
After:
|
|
46
|
+
|
|
47
|
+
$ eyeo show ./config.json
|
|
48
|
+
{"ha": {"username": "bob", "password": "eyeo:hidden"}}
|
|
49
|
+
|
|
50
|
+
The file itself now holds `"password": "eyeo:AQVob3VzZdDQr_e3f..."` -- scrambled, and useless without
|
|
51
|
+
your key. Your own programs still get the real value: you hand it to them directly, and it never has
|
|
52
|
+
to appear on a screen.
|
|
53
|
+
|
|
54
|
+
## Install
|
|
55
|
+
|
|
56
|
+
pip install eyeo
|
|
57
|
+
|
|
58
|
+
Linux, macOS, Windows; Python 3.10+.
|
|
59
|
+
|
|
60
|
+
## Quick start
|
|
61
|
+
|
|
62
|
+
export EYEO_UNLOCK='house=a phrase you choose' # your unlock phrase for the key "house"; eyeo stores it nowhere
|
|
63
|
+
eyeo keygen house # make the key (once)
|
|
64
|
+
printf %s 'tok-EXAMPLE-123' | eyeo set house ha.password - # store a secret; it is hidden from here on
|
|
65
|
+
eyeo set house ha.username bob --plain # an ordinary, readable value
|
|
66
|
+
eyeo show house # {"ha": {"password": "eyeo:hidden", "username": "bob"}}
|
|
67
|
+
eyeo exec house --env PW=ha.password -- sh -c 'echo "oops: $PW"' # prints: oops: [hidden:ha.password]
|
|
68
|
+
|
|
69
|
+
That made a small JSON file, `~/.config/eyeo/house.json`, with one hidden value and one plain one.
|
|
70
|
+
The last line ran a program that was given the real password -- and when the program printed it,
|
|
71
|
+
eyeo blanked it out on the way to your screen.
|
|
72
|
+
|
|
73
|
+
## What people use it for
|
|
74
|
+
|
|
75
|
+
**A config file your assistant is going to read.** Hide the sensitive values where they are. The
|
|
76
|
+
file stays valid JSON and everything else in it stays readable; a program that needs the real value
|
|
77
|
+
gets it through `exec` or the library, below:
|
|
78
|
+
|
|
79
|
+
eyeo hide ./config.json ha.password --key house
|
|
80
|
+
|
|
81
|
+
**Giving a script a token without printing it.** `exec` runs a command with the secret in an
|
|
82
|
+
environment variable. You never see the value, and if the command echoes it, the echo is blanked out:
|
|
83
|
+
|
|
84
|
+
eyeo exec house --env TOKEN=ha.password -- sh -c 'curl -H "Authorization: Bearer $TOKEN" https://api.example.com/me'
|
|
85
|
+
|
|
86
|
+
**Cleaning a log or a paste before you share it.** `mask` replaces every secret it knows with a
|
|
87
|
+
placeholder such as `[hidden:ha.password]`:
|
|
88
|
+
|
|
89
|
+
eyeo mask house < app.log > safe-to-share.log
|
|
90
|
+
|
|
91
|
+
**From Python.** The value arrives as an object that prints as `<eyeo hidden>` until you ask for it:
|
|
92
|
+
|
|
93
|
+
import eyeo
|
|
94
|
+
token = eyeo.open("house").get("ha.password") # print(token) shows <eyeo hidden>
|
|
95
|
+
client = connect(user="bob", password=token.reveal())
|
|
96
|
+
|
|
97
|
+
## Why is it strict by default?
|
|
98
|
+
|
|
99
|
+
Because eyeo assumes that whoever is reading was not looking for the secret -- typically an AI
|
|
100
|
+
assistant working through your project. So a plain read shows `eyeo:hidden`, printing the real value
|
|
101
|
+
takes a separate, deliberate command (`eyeo reveal`), and a new key will not work at all until you
|
|
102
|
+
give it an unlock phrase. The safe path is the one you get without thinking about it. If that is
|
|
103
|
+
heavier than you need, you can opt out, on purpose and by name: `eyeo keygen house --unprotected`.
|
|
104
|
+
eyeo will not make that choice for you.
|
|
105
|
+
|
|
106
|
+
## What it is not
|
|
107
|
+
|
|
108
|
+
- **Not a vault.** It is a small tool for keeping secrets out of sight, not a secrets manager.
|
|
109
|
+
- **Not access control.** Whoever can read the key file and knows the unlock phrase can decrypt.
|
|
110
|
+
That includes every program running as you.
|
|
111
|
+
- **Not a scrubber for free text.** `mask` removes the exact values it has been told about. It
|
|
112
|
+
does not go looking for secrets it has never seen.
|
|
113
|
+
|
|
114
|
+
## If you lose the unlock phrase
|
|
115
|
+
|
|
116
|
+
**The hidden values are gone.** eyeo keeps the phrase nowhere and cannot recover it; nobody can.
|
|
117
|
+
|
|
118
|
+
## More
|
|
119
|
+
|
|
120
|
+
- [REFERENCE.md](REFERENCE.md) -- every command and option, keys and their policies, the Python
|
|
121
|
+
library, platform notes (including what is different on Windows), running the tests
|
|
122
|
+
- [SPEC.md](SPEC.md) -- the exact contract: file format, encryption, behaviour
|
|
123
|
+
- [SECURITY.md](SECURITY.md) -- what eyeo protects against, what it does not, how to report a problem
|
|
124
|
+
- [ROADMAP.md](ROADMAP.md) -- what may come next
|
|
125
|
+
- [CHANGELOG.md](CHANGELOG.md) -- what changed
|
|
126
|
+
- [LICENSE](LICENSE) -- Apache-2.0
|
eyeo-0.1.0/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# eyeo
|
|
2
|
+
|
|
3
|
+
Keeps the passwords and API tokens in your config files hidden, so that an AI assistant -- or anyone
|
|
4
|
+
else who opens the file -- does not get to read them.
|
|
5
|
+
|
|
6
|
+
You ask your AI coding assistant to fix a bug. It opens `config.json` to look around, and now your
|
|
7
|
+
API token is in the chat transcript. Nobody did anything wrong; the file was simply there to be read.
|
|
8
|
+
eyeo encrypts the few values that matter and leaves the rest of the file alone, so it is still
|
|
9
|
+
ordinary JSON that any program can open. Whoever reads it finds `eyeo:hidden` where the secret was.
|
|
10
|
+
|
|
11
|
+
Before:
|
|
12
|
+
|
|
13
|
+
$ cat config.json
|
|
14
|
+
{"ha": {"username": "bob", "password": "tok-EXAMPLE-123"}}
|
|
15
|
+
|
|
16
|
+
After:
|
|
17
|
+
|
|
18
|
+
$ eyeo show ./config.json
|
|
19
|
+
{"ha": {"username": "bob", "password": "eyeo:hidden"}}
|
|
20
|
+
|
|
21
|
+
The file itself now holds `"password": "eyeo:AQVob3VzZdDQr_e3f..."` -- scrambled, and useless without
|
|
22
|
+
your key. Your own programs still get the real value: you hand it to them directly, and it never has
|
|
23
|
+
to appear on a screen.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
pip install eyeo
|
|
28
|
+
|
|
29
|
+
Linux, macOS, Windows; Python 3.10+.
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
export EYEO_UNLOCK='house=a phrase you choose' # your unlock phrase for the key "house"; eyeo stores it nowhere
|
|
34
|
+
eyeo keygen house # make the key (once)
|
|
35
|
+
printf %s 'tok-EXAMPLE-123' | eyeo set house ha.password - # store a secret; it is hidden from here on
|
|
36
|
+
eyeo set house ha.username bob --plain # an ordinary, readable value
|
|
37
|
+
eyeo show house # {"ha": {"password": "eyeo:hidden", "username": "bob"}}
|
|
38
|
+
eyeo exec house --env PW=ha.password -- sh -c 'echo "oops: $PW"' # prints: oops: [hidden:ha.password]
|
|
39
|
+
|
|
40
|
+
That made a small JSON file, `~/.config/eyeo/house.json`, with one hidden value and one plain one.
|
|
41
|
+
The last line ran a program that was given the real password -- and when the program printed it,
|
|
42
|
+
eyeo blanked it out on the way to your screen.
|
|
43
|
+
|
|
44
|
+
## What people use it for
|
|
45
|
+
|
|
46
|
+
**A config file your assistant is going to read.** Hide the sensitive values where they are. The
|
|
47
|
+
file stays valid JSON and everything else in it stays readable; a program that needs the real value
|
|
48
|
+
gets it through `exec` or the library, below:
|
|
49
|
+
|
|
50
|
+
eyeo hide ./config.json ha.password --key house
|
|
51
|
+
|
|
52
|
+
**Giving a script a token without printing it.** `exec` runs a command with the secret in an
|
|
53
|
+
environment variable. You never see the value, and if the command echoes it, the echo is blanked out:
|
|
54
|
+
|
|
55
|
+
eyeo exec house --env TOKEN=ha.password -- sh -c 'curl -H "Authorization: Bearer $TOKEN" https://api.example.com/me'
|
|
56
|
+
|
|
57
|
+
**Cleaning a log or a paste before you share it.** `mask` replaces every secret it knows with a
|
|
58
|
+
placeholder such as `[hidden:ha.password]`:
|
|
59
|
+
|
|
60
|
+
eyeo mask house < app.log > safe-to-share.log
|
|
61
|
+
|
|
62
|
+
**From Python.** The value arrives as an object that prints as `<eyeo hidden>` until you ask for it:
|
|
63
|
+
|
|
64
|
+
import eyeo
|
|
65
|
+
token = eyeo.open("house").get("ha.password") # print(token) shows <eyeo hidden>
|
|
66
|
+
client = connect(user="bob", password=token.reveal())
|
|
67
|
+
|
|
68
|
+
## Why is it strict by default?
|
|
69
|
+
|
|
70
|
+
Because eyeo assumes that whoever is reading was not looking for the secret -- typically an AI
|
|
71
|
+
assistant working through your project. So a plain read shows `eyeo:hidden`, printing the real value
|
|
72
|
+
takes a separate, deliberate command (`eyeo reveal`), and a new key will not work at all until you
|
|
73
|
+
give it an unlock phrase. The safe path is the one you get without thinking about it. If that is
|
|
74
|
+
heavier than you need, you can opt out, on purpose and by name: `eyeo keygen house --unprotected`.
|
|
75
|
+
eyeo will not make that choice for you.
|
|
76
|
+
|
|
77
|
+
## What it is not
|
|
78
|
+
|
|
79
|
+
- **Not a vault.** It is a small tool for keeping secrets out of sight, not a secrets manager.
|
|
80
|
+
- **Not access control.** Whoever can read the key file and knows the unlock phrase can decrypt.
|
|
81
|
+
That includes every program running as you.
|
|
82
|
+
- **Not a scrubber for free text.** `mask` removes the exact values it has been told about. It
|
|
83
|
+
does not go looking for secrets it has never seen.
|
|
84
|
+
|
|
85
|
+
## If you lose the unlock phrase
|
|
86
|
+
|
|
87
|
+
**The hidden values are gone.** eyeo keeps the phrase nowhere and cannot recover it; nobody can.
|
|
88
|
+
|
|
89
|
+
## More
|
|
90
|
+
|
|
91
|
+
- [REFERENCE.md](REFERENCE.md) -- every command and option, keys and their policies, the Python
|
|
92
|
+
library, platform notes (including what is different on Windows), running the tests
|
|
93
|
+
- [SPEC.md](SPEC.md) -- the exact contract: file format, encryption, behaviour
|
|
94
|
+
- [SECURITY.md](SECURITY.md) -- what eyeo protects against, what it does not, how to report a problem
|
|
95
|
+
- [ROADMAP.md](ROADMAP.md) -- what may come next
|
|
96
|
+
- [CHANGELOG.md](CHANGELOG.md) -- what changed
|
|
97
|
+
- [LICENSE](LICENSE) -- Apache-2.0
|
eyeo-0.1.0/REFERENCE.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# eyeo reference
|
|
2
|
+
|
|
3
|
+
The working reference: commands, keys, the library, platforms, tests. [README.md](README.md) is the
|
|
4
|
+
introduction; [SPEC.md](SPEC.md) is the contract, and where this file and SPEC.md disagree, SPEC.md
|
|
5
|
+
is right.
|
|
6
|
+
|
|
7
|
+
eyeo is one Python file, `eyeo.py`: the command-line tool and the importable library. It depends on
|
|
8
|
+
`cryptography`; `pip install "eyeo[yaml]"` adds PyYAML for `--format yaml`.
|
|
9
|
+
|
|
10
|
+
## Stores, paths, values
|
|
11
|
+
|
|
12
|
+
- A STORE is a JSON file. Name it by a bare name (`house` is `~/.config/eyeo/house.json`; `$EYEO_PATH`
|
|
13
|
+
lists other directories to search) or by a path (`./config.json`; anything with a `/` in it).
|
|
14
|
+
- A PATH points into the document: `a.b[2].c`; `a."b.c"` for a key with a dot in it.
|
|
15
|
+
- A hidden value is one string, `eyeo:<payload>`. The payload is base64url, no padding, of
|
|
16
|
+
`version(1) || keyid_length(1) || keyid || nonce(12) || ciphertext || tag(16)`, AES-256-GCM, with
|
|
17
|
+
the version and key id authenticated. It uses only `A-Za-z0-9:_-`, so it needs no quoting in JSON,
|
|
18
|
+
YAML, .env, INI, shell words or URLs. For example:
|
|
19
|
+
|
|
20
|
+
"password": "eyeo:AQVob3VzZQe0yDz26mUDtQyPY-5EYGqVNFRuzAG9oYx8e7t5A74XRV7dKetPs9F2YIsj"
|
|
21
|
+
|
|
22
|
+
- Any string that starts with `eyeo:` is an eyeo value; one this copy cannot read is an error
|
|
23
|
+
(exit 4), never plain text. A plain string that itself starts with `eyeo:` is stored as `eyeo::...`.
|
|
24
|
+
- `eyeo:hidden` is what a read shows in place of a hidden value. Feeding it back into `set` or
|
|
25
|
+
`import` is refused.
|
|
26
|
+
|
|
27
|
+
## Verbs
|
|
28
|
+
|
|
29
|
+
`eyeo [--format json|text|yaml] VERB ...` (the option may also follow the verb; `$EYEO_FORMAT` sets a
|
|
30
|
+
default). stdout carries the result as one JSON document; an error is one JSON object on stderr.
|
|
31
|
+
Verbs that hide or read values also take `--unlock-file ID=FILE`; verbs that hand out plaintext take
|
|
32
|
+
`--ack ID`.
|
|
33
|
+
|
|
34
|
+
| verb | does | shows values? |
|
|
35
|
+
|------|------|---------------|
|
|
36
|
+
| `ls [STORE [PATH]] [--depth N]` | stores, or the entries below PATH | never (no key loaded) |
|
|
37
|
+
| `doctor STORE` | decrypts everything to prove it works; counts only | never |
|
|
38
|
+
| `show STORE [PATH] [--values masked\|raw\|reveal]` | a subtree as data | only with `--values reveal` |
|
|
39
|
+
| `get STORE PATH [--values ...]` | same, PATH required | only with `--values reveal` |
|
|
40
|
+
| `reveal STORE PATH [--out FILE]` | the plaintext, raw on stdout | yes -- the one verb for it |
|
|
41
|
+
| `set STORE PATH [VALUE \| -] [--env VAR] [--json] [--plain] [--key ID] [--force]` | store a value, hidden by default | no |
|
|
42
|
+
| `del STORE PATH [--force]` | delete | no |
|
|
43
|
+
| `hide STORE [PATH] [--node] [--key ID]` | hide plain values already in a store | no |
|
|
44
|
+
| `import STORE PATH (--stdin \| --env PREFIX) [--plain] [--key ID] [--force]` | store a JSON document or environment variables | no |
|
|
45
|
+
| `exec STORE --env VAR=PATH ... [--no-mask] -- COMMAND ...` | run a command with revealed values in its environment, output masked | to the child only |
|
|
46
|
+
| `mask STORE [PATH] [--match exact\|substr] [--token TEXT] [--min-len N] [-i]` | stdin -> stdout with hidden values replaced. Default `exact`: only where the value stands alone (`Ann` is not replaced inside `Annual`, and is not caught when glued to other letters or digits); `substr`: anywhere | no |
|
|
47
|
+
| `keygen ID [--dir DIR] [--require ack \| --unprotected]` | new key file, never overwrites; needs the unlock string unless one of the two options is given | no |
|
|
48
|
+
| `policy ID [--dir DIR] [--require ack \| --unprotected] [--ack ID]` | show what a key demands, or turn the guard on / off | no |
|
|
49
|
+
| `rekey STORE --from OLD --to NEW [--ack OLD]` | hide every value of key OLD again under key NEW, all or nothing | no |
|
|
50
|
+
| `link NAME FILE` | `NAME` becomes a short name for a config file that lives elsewhere | no |
|
|
51
|
+
| `hint` | a short rule sheet to give to an AI assistant that will use eyeo | no |
|
|
52
|
+
|
|
53
|
+
A value that starts with `-` needs `--` before it (`eyeo set house k --plain -- -x`) or `-` / `--env`.
|
|
54
|
+
Bare `eyeo` prints a short guide to the common cases; `eyeo --help` lists every verb;
|
|
55
|
+
`eyeo VERB --help` explains one; `eyeo --version` prints the version.
|
|
56
|
+
|
|
57
|
+
Exit codes:
|
|
58
|
+
|
|
59
|
+
| code | name | meaning |
|
|
60
|
+
|------|------|---------|
|
|
61
|
+
| 0 | | ok |
|
|
62
|
+
| 1 | `internal` | an internal error (for example, the `cryptography` package is missing) |
|
|
63
|
+
| 2 | `usage` | bad arguments or input |
|
|
64
|
+
| 3 | `not_found` | store, path or key not found; also: an unlock string was needed and not given |
|
|
65
|
+
| 4 | `crypto` | a value that cannot be read or decrypted; also: a wrong unlock string |
|
|
66
|
+
| 5 | `blocked` | a write refused, or a guarded key not acknowledged |
|
|
67
|
+
|
|
68
|
+
`exec` returns the child's exit code when the child ran.
|
|
69
|
+
|
|
70
|
+
## Keys and their policies
|
|
71
|
+
|
|
72
|
+
A key is a small JSON file, `~/.config/eyeo/keys/ID.key` (or in a directory listed in `$EYEO_KEY_PATH`,
|
|
73
|
+
or beside the store). It can carry one of two policies, or none.
|
|
74
|
+
|
|
75
|
+
- **Unlock string** (`secret`; what `eyeo keygen ID` makes). The real key is made from the key file AND
|
|
76
|
+
a string you choose, each time it is used; the key file alone opens nothing. Everything that hides or
|
|
77
|
+
reads a value needs the string; `eyeo ls` and the default `eyeo show` do not. Give it as
|
|
78
|
+
`EYEO_UNLOCK='ID=the string'`, or keep it in a file and say `EYEO_UNLOCK_FILE=ID=/path/to/file` (or
|
|
79
|
+
`--unlock-file ID=FILE`). It is never a command-line argument, and it should not live next to the key
|
|
80
|
+
file. Lose the string and the data is gone.
|
|
81
|
+
- **Guard** (`ack`; `eyeo keygen ID --require ack`). The key file opens the values, but `reveal`,
|
|
82
|
+
`show --values reveal` and `exec` refuse until you name the key: `--ack ID`, or `EYEO_ACK=ID`. It
|
|
83
|
+
stops the accidental reveal, nothing more. `eyeo mask` and `eyeo doctor` work without it.
|
|
84
|
+
- **None** (`eyeo keygen ID --unprotected`). The key file alone decrypts; nobody is asked.
|
|
85
|
+
|
|
86
|
+
Which key hides a new value: `--key ID`; else the one key the store already uses; else a key named
|
|
87
|
+
like the store.
|
|
88
|
+
|
|
89
|
+
`eyeo policy ID` shows what a key demands. `eyeo policy ID --require ack` and
|
|
90
|
+
`eyeo policy ID --unprotected --ack ID` turn the guard on and off. Changing the unlock string, or
|
|
91
|
+
adding or removing one, means a new key and `eyeo rekey`:
|
|
92
|
+
|
|
93
|
+
export EYEO_UNLOCK_FILE=house=/path/to/old.txt:house2=/path/to/new.txt # each key names its own file
|
|
94
|
+
eyeo keygen house2
|
|
95
|
+
eyeo rekey house --from house --to house2 # once for every store that uses the key
|
|
96
|
+
eyeo doctor house # then, and only then, delete house.key
|
|
97
|
+
|
|
98
|
+
`rekey` rewrites the store in one step or not at all, and leaves values under other keys alone.
|
|
99
|
+
Section 9 of SPEC.md has the details.
|
|
100
|
+
|
|
101
|
+
## Library
|
|
102
|
+
|
|
103
|
+
import eyeo
|
|
104
|
+
|
|
105
|
+
store = eyeo.open("house") # a name or a path; reads EYEO_UNLOCK like the CLI,
|
|
106
|
+
# or: eyeo.open("house", unlock={"house": text})
|
|
107
|
+
store.show() # {"ha": {"password": "eyeo:hidden", "username": "bob"}}
|
|
108
|
+
store.ls("ha") # names and types, never values
|
|
109
|
+
secret = store.get("ha.password") # an eyeo.Secret: str(), repr() and f"{...}" give "<eyeo hidden>"
|
|
110
|
+
secret.reveal() # the plaintext
|
|
111
|
+
store.reveal("ha.password") # the same in one call
|
|
112
|
+
store.set("ha.token", "new value") # hidden by default; hidden=False for a plain value
|
|
113
|
+
store.hide("ha") # hide the plain strings below a path
|
|
114
|
+
store.delete("ha.token", force=True)
|
|
115
|
+
store.mask("some text") # hidden values replaced by [hidden:PATH]
|
|
116
|
+
store.doctor() # the report dict
|
|
117
|
+
eyeo.keygen("house2", unlock={"house2": text})
|
|
118
|
+
|
|
119
|
+
Every call reads the file fresh; writes are locked and atomic. Failures are `eyeo.EyeoError` with
|
|
120
|
+
`.code`, `.exit` and `.message`. Section 7 of SPEC.md lists everything.
|
|
121
|
+
|
|
122
|
+
## Platforms
|
|
123
|
+
|
|
124
|
+
Linux, macOS and Windows, Python 3.10+; the test suite runs on all three
|
|
125
|
+
(`.github/workflows/test.yml`). The commands, the files and the value format are the same everywhere,
|
|
126
|
+
and a store or key file written on one system opens on the others. What differs on Windows:
|
|
127
|
+
|
|
128
|
+
- Files live in the same place, `%USERPROFILE%\.config\eyeo`.
|
|
129
|
+
- **eyeo does not set or check file permissions on Windows.** On Linux and macOS its files are created
|
|
130
|
+
with mode 0600 and a key file that others can read draws a warning. Windows has no such modes: who
|
|
131
|
+
can read a store or a key file is decided by the permissions of the directory it is in.
|
|
132
|
+
- Lists in `EYEO_PATH`, `EYEO_KEY_PATH` and `EYEO_UNLOCK_FILE` are separated by `;` instead of `:`.
|
|
133
|
+
- In PowerShell the first line of the quick start is `$env:EYEO_UNLOCK = 'house=a phrase you choose'`,
|
|
134
|
+
and `eyeo exec` runs a program directly, so use one that exists there in place of `sh -c`.
|
|
135
|
+
- `eyeo link` needs the right to create symbolic links. An ordinary Windows account does not have it unless
|
|
136
|
+
Developer Mode is on or the shell is elevated; without it `eyeo link` stops with exit 5 and changes nothing.
|
|
137
|
+
|
|
138
|
+
On every platform, one trailing line ending (LF or CRLF) is dropped from a value piped into
|
|
139
|
+
`eyeo set ... -` and from an unlock file. Section 10 of SPEC.md has the full list, including what
|
|
140
|
+
the file lock guarantees on each system.
|
|
141
|
+
|
|
142
|
+
## Tests
|
|
143
|
+
|
|
144
|
+
python test_eyeo.py # unittest; every test isolates the home directory and EYEO_* in a temp dir
|
|
145
|
+
python -O test_eyeo.py # the same with assertions stripped: the module does not rely on them
|
|
146
|
+
python tools/make_vectors.py # regenerate vectors.json, the test vectors for ports (SPEC.md, section 8)
|
eyeo-0.1.0/ROADMAP.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
Things that may come. This is a list of ideas, not a plan: no dates, no order, no promises.
|
|
4
|
+
[SPEC.md](SPEC.md) (section 11, "Not in v1") has the detail for most of them.
|
|
5
|
+
|
|
6
|
+
- **Line-ending handling configurable.** Today one trailing LF or CRLF is dropped from piped-in
|
|
7
|
+
values and unlock files on every platform (SPEC.md, section 10.2). Make that a documented setting
|
|
8
|
+
(keep / drop), default unchanged.
|
|
9
|
+
- **Stores that are not JSON**: YAML, TOML, .env. The value format is already safe for them.
|
|
10
|
+
- **Public-key mode**: write a hidden value without being able to read it back.
|
|
11
|
+
- **A shared store directory** for a team.
|
|
12
|
+
- **Ports** to other languages (npm, Rust), checked against `vectors.json`.
|
|
13
|
+
- **A packaged rule set for AI agents**, beyond the text that `eyeo hint` prints.
|
|
14
|
+
- **Padding** to hide the length of a value (today the ciphertext is as long as the plaintext).
|
|
15
|
+
- **A wrapped data key**, so that an unlock string can be changed without `rekey`.
|
|
16
|
+
- **`rekey` across many stores** in one command.
|
|
17
|
+
- **Windows file permissions**: set or check ACLs, where today the directory's permissions decide.
|
|
18
|
+
- **A command-line option for the scrypt parameters** of a new key (today: library only,
|
|
19
|
+
`eyeo.keygen(..., kdf={...})`).
|
|
20
|
+
- **More `mask` match modes** (patterns, plug-ins), beyond `exact` and `substr`. Today `mask` finds a value only as
|
|
21
|
+
written: a base64, URL-encoded or differently-cased copy of the same secret passes through.
|