open-pushscan 0.3.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.
- open_pushscan-0.3.0/LICENSE +202 -0
- open_pushscan-0.3.0/PKG-INFO +193 -0
- open_pushscan-0.3.0/README.md +183 -0
- open_pushscan-0.3.0/pyproject.toml +19 -0
- open_pushscan-0.3.0/setup.cfg +4 -0
- open_pushscan-0.3.0/src/open_pushscan/__init__.py +2 -0
- open_pushscan-0.3.0/src/open_pushscan/__main__.py +5 -0
- open_pushscan-0.3.0/src/open_pushscan/agents.py +666 -0
- open_pushscan-0.3.0/src/open_pushscan/ci.py +88 -0
- open_pushscan-0.3.0/src/open_pushscan/cli.py +534 -0
- open_pushscan-0.3.0/src/open_pushscan/config.py +256 -0
- open_pushscan-0.3.0/src/open_pushscan/fingerprints.py +153 -0
- open_pushscan-0.3.0/src/open_pushscan/gitscan.py +248 -0
- open_pushscan-0.3.0/src/open_pushscan/hooks.py +121 -0
- open_pushscan-0.3.0/src/open_pushscan/i18n.py +90 -0
- open_pushscan-0.3.0/src/open_pushscan/media.py +318 -0
- open_pushscan-0.3.0/src/open_pushscan/publish.py +160 -0
- open_pushscan-0.3.0/src/open_pushscan/report.py +130 -0
- open_pushscan-0.3.0/src/open_pushscan/rules.py +277 -0
- open_pushscan-0.3.0/src/open_pushscan/scanner.py +226 -0
- open_pushscan-0.3.0/src/open_pushscan/visibility.py +87 -0
- open_pushscan-0.3.0/src/open_pushscan.egg-info/PKG-INFO +193 -0
- open_pushscan-0.3.0/src/open_pushscan.egg-info/SOURCES.txt +29 -0
- open_pushscan-0.3.0/src/open_pushscan.egg-info/dependency_links.txt +1 -0
- open_pushscan-0.3.0/src/open_pushscan.egg-info/entry_points.txt +2 -0
- open_pushscan-0.3.0/src/open_pushscan.egg-info/top_level.txt +1 -0
- open_pushscan-0.3.0/tests/test_agents.py +260 -0
- open_pushscan-0.3.0/tests/test_git.py +199 -0
- open_pushscan-0.3.0/tests/test_media.py +56 -0
- open_pushscan-0.3.0/tests/test_patch.py +60 -0
- open_pushscan-0.3.0/tests/test_rules.py +131 -0
|
@@ -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.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: open-pushscan
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Check what you are about to make public: host names, local paths, personal data, keys and AI tool files
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Dynamic: license-file
|
|
10
|
+
|
|
11
|
+
# open-pushscan
|
|
12
|
+
|
|
13
|
+
**English** | [繁體中文](README.zh-TW.md)
|
|
14
|
+
|
|
15
|
+
Before you commit or push, open-pushscan looks for things that should not be public: who you are, your computer's
|
|
16
|
+
names, your organisation's internal details, passwords and keys. If it finds any, it stops the commit or push and
|
|
17
|
+
tells you how to fix it.
|
|
18
|
+
|
|
19
|
+
It finds your computer's names and network addresses by itself, so there is nothing to set up.
|
|
20
|
+
|
|
21
|
+
## Get started
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
pip install git+https://github.com/yu-ken0207/open-pushscan
|
|
25
|
+
open-pushscan setup
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
That's it. Commit and push as usual; open-pushscan only speaks up when it finds something.
|
|
29
|
+
|
|
30
|
+
`setup`:
|
|
31
|
+
|
|
32
|
+
- makes every repository on this computer checked, including ones you clone later
|
|
33
|
+
- finds the names and network addresses that identify you (called "fingerprints" below) and shows them to you
|
|
34
|
+
- asks whether you have team rules to use; press Enter if not
|
|
35
|
+
- if you have Claude Code or Codex, stops them from skipping the checks
|
|
36
|
+
|
|
37
|
+
> Typed `open-pushscan` and got "command not found"? This is common on Windows, where pip installs it in a folder
|
|
38
|
+
> outside PATH. Use `python -m open_pushscan` instead, for example `python -m open_pushscan setup`. open-pushscan's
|
|
39
|
+
> own messages also show the form that runs on your computer.
|
|
40
|
+
|
|
41
|
+
## When something is found
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
open-pushscan stopped this push (it goes to a public repo)
|
|
45
|
+
|
|
46
|
+
1. src/app.py line 12 | Your account folder on this computer
|
|
47
|
+
/home/you/
|
|
48
|
+
Why: The path shows your account name and how your folders are laid out
|
|
49
|
+
Fix: Use a relative path, or ~ for the home folder
|
|
50
|
+
|
|
51
|
+
2. photo.jpg hidden details | GPS location inside a photo
|
|
52
|
+
25.04, 121.55
|
|
53
|
+
Why: The photo records where it was taken, which may be your home or office
|
|
54
|
+
Fix: Save a copy without location (most photo apps have "remove location")
|
|
55
|
+
|
|
56
|
+
Fix these, commit again, then push.
|
|
57
|
+
If item 1 is fine: open-pushscan allow 1
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- **Fix what the report says**, then commit again.
|
|
61
|
+
- **It's fine?** `open-pushscan allow 1` (use the number from the report). It asks you once more and only works in a
|
|
62
|
+
terminal you opened yourself, so an AI assistant cannot allow things for you. You can also add
|
|
63
|
+
`open-pushscan: allow` to the end of that line; lines with it are listed on every commit, so if someone else added
|
|
64
|
+
one, you will notice.
|
|
65
|
+
- **Pushing to a private repository?** You get the same list as a reminder, but nothing is stopped.
|
|
66
|
+
|
|
67
|
+
## What it checks
|
|
68
|
+
|
|
69
|
+
| | Examples |
|
|
70
|
+
|---|---|
|
|
71
|
+
| Your computer | host name, account name, home folder, network and Tailscale addresses, ssh hosts, the email in your git settings — found automatically |
|
|
72
|
+
| Team rules | your organisation, project and client names, internal domains (shared through a private repository) |
|
|
73
|
+
| Private network | private IP addresses, internal host names, MAC addresses |
|
|
74
|
+
| Local paths | `/home/you/…`, `C:\Users\you\…` |
|
|
75
|
+
| Personal data | email addresses, Taiwan ID numbers, mobile numbers |
|
|
76
|
+
| Passwords and keys | GitHub, AWS, Google, OpenAI, Anthropic, Slack and other keys, private keys, passwords written in code, webhook URLs; also uses [gitleaks](https://github.com/gitleaks/gitleaks) if you have it |
|
|
77
|
+
| Sensitive files | `.env`, `id_rsa`, `*.pem`, `credentials.json`, kubeconfig, AI chat logs, files over 50 MB |
|
|
78
|
+
| Commit details | author name and email, commit messages, tag names |
|
|
79
|
+
| Hidden file details | photo GPS, owner and device (JPEG, PNG, WebP, TIFF, HEIC); text hidden in PNG; author and company in PDF, Word, Excel and PowerPoint |
|
|
80
|
+
| AI tool files | `CLAUDE.md`, `AGENTS.md`, `.cursor/` and similar notes for AI tools, AI signatures in commit messages |
|
|
81
|
+
|
|
82
|
+
## When it checks
|
|
83
|
+
|
|
84
|
+
| | Public repository | Private repository |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `git commit` | stops | reminds |
|
|
87
|
+
| `git push` | stops | reminds |
|
|
88
|
+
| `open-pushscan check` | lists everything | lists everything |
|
|
89
|
+
| GitHub Action | stops | stops |
|
|
90
|
+
|
|
91
|
+
If open-pushscan cannot tell whether a repository is public (no network, not on GitHub, no remote yet), it treats it
|
|
92
|
+
as public.
|
|
93
|
+
|
|
94
|
+
## Commands
|
|
95
|
+
|
|
96
|
+
| Command | What it does |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `open-pushscan setup` | First time: install, find fingerprints, set up team rules |
|
|
99
|
+
| `open-pushscan check` | Check this repository right now (uncommitted changes, and commits not pushed yet) |
|
|
100
|
+
| `open-pushscan check --history` | Check the whole history |
|
|
101
|
+
| `open-pushscan publish-check` | Everything to look at before making a private repository public |
|
|
102
|
+
| `open-pushscan allow N` | Stop reporting item N of the last report (asks you to confirm) |
|
|
103
|
+
| `open-pushscan status` | See what is installed and checked |
|
|
104
|
+
| `open-pushscan uninstall` | Remove it (from git, Claude Code and Codex) |
|
|
105
|
+
|
|
106
|
+
## Common situations
|
|
107
|
+
|
|
108
|
+
**Making a private repository public.** Run `open-pushscan publish-check`. It checks the whole history, tells you how
|
|
109
|
+
to clean it, and looks at releases, issues, pull requests and the wiki on GitHub. One thing to know: if you rewrite a
|
|
110
|
+
repository's history, GitHub still keeps the old commits, readable by anyone who knows the commit id. Push the cleaned
|
|
111
|
+
history to a brand-new repository instead of switching the old one to public.
|
|
112
|
+
|
|
113
|
+
**Team rules.** Put one name per line in a `.txt` file in a private GitHub repository and give your team read access. Each
|
|
114
|
+
person runs `open-pushscan setup --team <address>`; the rules update once a day.
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
# a word: matched as a whole word, upper or lower case
|
|
118
|
+
Example Corp
|
|
119
|
+
project-falcon
|
|
120
|
+
# a regular expression
|
|
121
|
+
re:\bEXC-\d{4}\b
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Checks on GitHub too.** In a repository, run `open-pushscan setup --github-action`, then commit and push the file it
|
|
125
|
+
creates. GitHub then checks every push and pull request, including edits made on the website. Or add it to a workflow
|
|
126
|
+
yourself:
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
on: [push, pull_request]
|
|
130
|
+
permissions:
|
|
131
|
+
contents: read
|
|
132
|
+
jobs:
|
|
133
|
+
open-pushscan:
|
|
134
|
+
runs-on: ubuntu-latest
|
|
135
|
+
steps:
|
|
136
|
+
- uses: actions/checkout@v4
|
|
137
|
+
with:
|
|
138
|
+
fetch-depth: 0 # lets it see every commit in the push
|
|
139
|
+
- uses: yu-ken0207/open-pushscan@v0
|
|
140
|
+
with:
|
|
141
|
+
team-rules: ${{ secrets.OPEN_PUSHSCAN_RULES }} # optional
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
On GitHub it cannot see your computer's names and addresses, so it checks everything else: keys, private IP addresses,
|
|
145
|
+
local paths, personal data, AI tool files, and team rules if you save them as a repository secret named
|
|
146
|
+
`OPEN_PUSHSCAN_RULES`.
|
|
147
|
+
|
|
148
|
+
**Projects that use the pre-commit framework.** If a project manages its hooks with [pre-commit](https://pre-commit.com),
|
|
149
|
+
add open-pushscan to its `.pre-commit-config.yaml` instead of running `setup` (pre-commit will not install its hooks
|
|
150
|
+
while `setup`'s hooks folder is in use):
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
repos:
|
|
154
|
+
- repo: https://github.com/yu-ken0207/open-pushscan
|
|
155
|
+
rev: v0.3.0
|
|
156
|
+
hooks:
|
|
157
|
+
- id: open-pushscan
|
|
158
|
+
- id: open-pushscan-commit-msg
|
|
159
|
+
- id: open-pushscan-pre-push
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Then run `pre-commit install -t pre-commit -t commit-msg -t pre-push`.
|
|
163
|
+
|
|
164
|
+
**A repository with its own hooks folder.** Some projects set `core.hooksPath` themselves, which hides open-pushscan.
|
|
165
|
+
`open-pushscan status` tells you, and how to connect it.
|
|
166
|
+
|
|
167
|
+
**Letting an AI assistant write code (Claude Code, Codex).** `setup` adds a check to the settings of Claude Code and
|
|
168
|
+
Codex that stops the usual ways around open-pushscan: `--no-verify`, changing `core.hooksPath`, editing the settings folder, and running
|
|
169
|
+
`open-pushscan allow` or `uninstall`. It also adds a short note to their instructions (`CLAUDE.md`, `AGENTS.md`): fix
|
|
170
|
+
what the report says, and ask you when they think something is a false alarm. For Codex, open it once, type `/hooks`
|
|
171
|
+
and trust the open-pushscan check. `open-pushscan status` shows whether they are protected.
|
|
172
|
+
|
|
173
|
+
**Skipping the check once.** `git push --no-verify` skips every hook. Use it only when you are sure.
|
|
174
|
+
|
|
175
|
+
## Your settings
|
|
176
|
+
|
|
177
|
+
Everything stays on your computer (`~/.config/open-pushscan` on Linux and macOS, `%APPDATA%\open-pushscan` on
|
|
178
|
+
Windows), never inside a repository:
|
|
179
|
+
|
|
180
|
+
- `fingerprints.txt`: your fingerprints, the names and network addresses that identify you. Add a line to check one
|
|
181
|
+
more; put `-` in front of a line to stop checking it.
|
|
182
|
+
- `rules.txt`: words or patterns you want checked, same format as team rules.
|
|
183
|
+
- `allowed.json`: items you allowed with `open-pushscan allow`.
|
|
184
|
+
|
|
185
|
+
It goes online for one thing only: asking GitHub whether a repository is public, without signing in to your account.
|
|
186
|
+
|
|
187
|
+
## Requirements
|
|
188
|
+
|
|
189
|
+
Python 3.9 or newer and git. Tested on Linux and Windows; macOS should work too. No other packages are needed.
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
Apache-2.0
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# open-pushscan
|
|
2
|
+
|
|
3
|
+
**English** | [繁體中文](README.zh-TW.md)
|
|
4
|
+
|
|
5
|
+
Before you commit or push, open-pushscan looks for things that should not be public: who you are, your computer's
|
|
6
|
+
names, your organisation's internal details, passwords and keys. If it finds any, it stops the commit or push and
|
|
7
|
+
tells you how to fix it.
|
|
8
|
+
|
|
9
|
+
It finds your computer's names and network addresses by itself, so there is nothing to set up.
|
|
10
|
+
|
|
11
|
+
## Get started
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
pip install git+https://github.com/yu-ken0207/open-pushscan
|
|
15
|
+
open-pushscan setup
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
That's it. Commit and push as usual; open-pushscan only speaks up when it finds something.
|
|
19
|
+
|
|
20
|
+
`setup`:
|
|
21
|
+
|
|
22
|
+
- makes every repository on this computer checked, including ones you clone later
|
|
23
|
+
- finds the names and network addresses that identify you (called "fingerprints" below) and shows them to you
|
|
24
|
+
- asks whether you have team rules to use; press Enter if not
|
|
25
|
+
- if you have Claude Code or Codex, stops them from skipping the checks
|
|
26
|
+
|
|
27
|
+
> Typed `open-pushscan` and got "command not found"? This is common on Windows, where pip installs it in a folder
|
|
28
|
+
> outside PATH. Use `python -m open_pushscan` instead, for example `python -m open_pushscan setup`. open-pushscan's
|
|
29
|
+
> own messages also show the form that runs on your computer.
|
|
30
|
+
|
|
31
|
+
## When something is found
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
open-pushscan stopped this push (it goes to a public repo)
|
|
35
|
+
|
|
36
|
+
1. src/app.py line 12 | Your account folder on this computer
|
|
37
|
+
/home/you/
|
|
38
|
+
Why: The path shows your account name and how your folders are laid out
|
|
39
|
+
Fix: Use a relative path, or ~ for the home folder
|
|
40
|
+
|
|
41
|
+
2. photo.jpg hidden details | GPS location inside a photo
|
|
42
|
+
25.04, 121.55
|
|
43
|
+
Why: The photo records where it was taken, which may be your home or office
|
|
44
|
+
Fix: Save a copy without location (most photo apps have "remove location")
|
|
45
|
+
|
|
46
|
+
Fix these, commit again, then push.
|
|
47
|
+
If item 1 is fine: open-pushscan allow 1
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- **Fix what the report says**, then commit again.
|
|
51
|
+
- **It's fine?** `open-pushscan allow 1` (use the number from the report). It asks you once more and only works in a
|
|
52
|
+
terminal you opened yourself, so an AI assistant cannot allow things for you. You can also add
|
|
53
|
+
`open-pushscan: allow` to the end of that line; lines with it are listed on every commit, so if someone else added
|
|
54
|
+
one, you will notice.
|
|
55
|
+
- **Pushing to a private repository?** You get the same list as a reminder, but nothing is stopped.
|
|
56
|
+
|
|
57
|
+
## What it checks
|
|
58
|
+
|
|
59
|
+
| | Examples |
|
|
60
|
+
|---|---|
|
|
61
|
+
| Your computer | host name, account name, home folder, network and Tailscale addresses, ssh hosts, the email in your git settings — found automatically |
|
|
62
|
+
| Team rules | your organisation, project and client names, internal domains (shared through a private repository) |
|
|
63
|
+
| Private network | private IP addresses, internal host names, MAC addresses |
|
|
64
|
+
| Local paths | `/home/you/…`, `C:\Users\you\…` |
|
|
65
|
+
| Personal data | email addresses, Taiwan ID numbers, mobile numbers |
|
|
66
|
+
| Passwords and keys | GitHub, AWS, Google, OpenAI, Anthropic, Slack and other keys, private keys, passwords written in code, webhook URLs; also uses [gitleaks](https://github.com/gitleaks/gitleaks) if you have it |
|
|
67
|
+
| Sensitive files | `.env`, `id_rsa`, `*.pem`, `credentials.json`, kubeconfig, AI chat logs, files over 50 MB |
|
|
68
|
+
| Commit details | author name and email, commit messages, tag names |
|
|
69
|
+
| Hidden file details | photo GPS, owner and device (JPEG, PNG, WebP, TIFF, HEIC); text hidden in PNG; author and company in PDF, Word, Excel and PowerPoint |
|
|
70
|
+
| AI tool files | `CLAUDE.md`, `AGENTS.md`, `.cursor/` and similar notes for AI tools, AI signatures in commit messages |
|
|
71
|
+
|
|
72
|
+
## When it checks
|
|
73
|
+
|
|
74
|
+
| | Public repository | Private repository |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `git commit` | stops | reminds |
|
|
77
|
+
| `git push` | stops | reminds |
|
|
78
|
+
| `open-pushscan check` | lists everything | lists everything |
|
|
79
|
+
| GitHub Action | stops | stops |
|
|
80
|
+
|
|
81
|
+
If open-pushscan cannot tell whether a repository is public (no network, not on GitHub, no remote yet), it treats it
|
|
82
|
+
as public.
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
| Command | What it does |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `open-pushscan setup` | First time: install, find fingerprints, set up team rules |
|
|
89
|
+
| `open-pushscan check` | Check this repository right now (uncommitted changes, and commits not pushed yet) |
|
|
90
|
+
| `open-pushscan check --history` | Check the whole history |
|
|
91
|
+
| `open-pushscan publish-check` | Everything to look at before making a private repository public |
|
|
92
|
+
| `open-pushscan allow N` | Stop reporting item N of the last report (asks you to confirm) |
|
|
93
|
+
| `open-pushscan status` | See what is installed and checked |
|
|
94
|
+
| `open-pushscan uninstall` | Remove it (from git, Claude Code and Codex) |
|
|
95
|
+
|
|
96
|
+
## Common situations
|
|
97
|
+
|
|
98
|
+
**Making a private repository public.** Run `open-pushscan publish-check`. It checks the whole history, tells you how
|
|
99
|
+
to clean it, and looks at releases, issues, pull requests and the wiki on GitHub. One thing to know: if you rewrite a
|
|
100
|
+
repository's history, GitHub still keeps the old commits, readable by anyone who knows the commit id. Push the cleaned
|
|
101
|
+
history to a brand-new repository instead of switching the old one to public.
|
|
102
|
+
|
|
103
|
+
**Team rules.** Put one name per line in a `.txt` file in a private GitHub repository and give your team read access. Each
|
|
104
|
+
person runs `open-pushscan setup --team <address>`; the rules update once a day.
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
# a word: matched as a whole word, upper or lower case
|
|
108
|
+
Example Corp
|
|
109
|
+
project-falcon
|
|
110
|
+
# a regular expression
|
|
111
|
+
re:\bEXC-\d{4}\b
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Checks on GitHub too.** In a repository, run `open-pushscan setup --github-action`, then commit and push the file it
|
|
115
|
+
creates. GitHub then checks every push and pull request, including edits made on the website. Or add it to a workflow
|
|
116
|
+
yourself:
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
on: [push, pull_request]
|
|
120
|
+
permissions:
|
|
121
|
+
contents: read
|
|
122
|
+
jobs:
|
|
123
|
+
open-pushscan:
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
steps:
|
|
126
|
+
- uses: actions/checkout@v4
|
|
127
|
+
with:
|
|
128
|
+
fetch-depth: 0 # lets it see every commit in the push
|
|
129
|
+
- uses: yu-ken0207/open-pushscan@v0
|
|
130
|
+
with:
|
|
131
|
+
team-rules: ${{ secrets.OPEN_PUSHSCAN_RULES }} # optional
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
On GitHub it cannot see your computer's names and addresses, so it checks everything else: keys, private IP addresses,
|
|
135
|
+
local paths, personal data, AI tool files, and team rules if you save them as a repository secret named
|
|
136
|
+
`OPEN_PUSHSCAN_RULES`.
|
|
137
|
+
|
|
138
|
+
**Projects that use the pre-commit framework.** If a project manages its hooks with [pre-commit](https://pre-commit.com),
|
|
139
|
+
add open-pushscan to its `.pre-commit-config.yaml` instead of running `setup` (pre-commit will not install its hooks
|
|
140
|
+
while `setup`'s hooks folder is in use):
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
repos:
|
|
144
|
+
- repo: https://github.com/yu-ken0207/open-pushscan
|
|
145
|
+
rev: v0.3.0
|
|
146
|
+
hooks:
|
|
147
|
+
- id: open-pushscan
|
|
148
|
+
- id: open-pushscan-commit-msg
|
|
149
|
+
- id: open-pushscan-pre-push
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Then run `pre-commit install -t pre-commit -t commit-msg -t pre-push`.
|
|
153
|
+
|
|
154
|
+
**A repository with its own hooks folder.** Some projects set `core.hooksPath` themselves, which hides open-pushscan.
|
|
155
|
+
`open-pushscan status` tells you, and how to connect it.
|
|
156
|
+
|
|
157
|
+
**Letting an AI assistant write code (Claude Code, Codex).** `setup` adds a check to the settings of Claude Code and
|
|
158
|
+
Codex that stops the usual ways around open-pushscan: `--no-verify`, changing `core.hooksPath`, editing the settings folder, and running
|
|
159
|
+
`open-pushscan allow` or `uninstall`. It also adds a short note to their instructions (`CLAUDE.md`, `AGENTS.md`): fix
|
|
160
|
+
what the report says, and ask you when they think something is a false alarm. For Codex, open it once, type `/hooks`
|
|
161
|
+
and trust the open-pushscan check. `open-pushscan status` shows whether they are protected.
|
|
162
|
+
|
|
163
|
+
**Skipping the check once.** `git push --no-verify` skips every hook. Use it only when you are sure.
|
|
164
|
+
|
|
165
|
+
## Your settings
|
|
166
|
+
|
|
167
|
+
Everything stays on your computer (`~/.config/open-pushscan` on Linux and macOS, `%APPDATA%\open-pushscan` on
|
|
168
|
+
Windows), never inside a repository:
|
|
169
|
+
|
|
170
|
+
- `fingerprints.txt`: your fingerprints, the names and network addresses that identify you. Add a line to check one
|
|
171
|
+
more; put `-` in front of a line to stop checking it.
|
|
172
|
+
- `rules.txt`: words or patterns you want checked, same format as team rules.
|
|
173
|
+
- `allowed.json`: items you allowed with `open-pushscan allow`.
|
|
174
|
+
|
|
175
|
+
It goes online for one thing only: asking GitHub whether a repository is public, without signing in to your account.
|
|
176
|
+
|
|
177
|
+
## Requirements
|
|
178
|
+
|
|
179
|
+
Python 3.9 or newer and git. Tested on Linux and Windows; macOS should work too. No other packages are needed.
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
Apache-2.0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "open-pushscan"
|
|
7
|
+
version = "0.3.0"
|
|
8
|
+
description = "Check what you are about to make public: host names, local paths, personal data, keys and AI tool files"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
dependencies = []
|
|
14
|
+
|
|
15
|
+
[project.scripts]
|
|
16
|
+
open-pushscan = "open_pushscan.cli:main"
|
|
17
|
+
|
|
18
|
+
[tool.setuptools.packages.find]
|
|
19
|
+
where = ["src"]
|