deepsecrets 2.2.0__tar.gz → 2.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.
- deepsecrets-2.3.0/LICENSE +235 -0
- deepsecrets-2.3.0/NOTICE +10 -0
- deepsecrets-2.2.0/README.md → deepsecrets-2.3.0/PKG-INFO +101 -20
- deepsecrets-2.2.0/PKG-INFO → deepsecrets-2.3.0/README.md +53 -52
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/cli.py +151 -128
- deepsecrets-2.3.0/deepsecrets/config.py +181 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/engines/regex.py +2 -0
- deepsecrets-2.3.0/deepsecrets/core/engines/semantic.py +131 -0
- deepsecrets-2.3.0/deepsecrets/core/helpers/finding_tags.py +113 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/helpers/regex_candidate_evaluator.py +9 -3
- deepsecrets-2.3.0/deepsecrets/core/helpers/value_shape.py +74 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/helpers/variable_evaluator.py +9 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/finding.py +46 -46
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/regex_candidate.py +3 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/response/dojo_sarif.py +24 -8
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/regex_candidate_scoring.py +5 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/variable_scoring.py +5 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/semantic.py +4 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/modes/iscan_mode.py +120 -110
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/semantic/language.py +2 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/semantic/var_detection/rules.py +17 -0
- deepsecrets-2.3.0/deepsecrets/core/utils/lexer_finder.py +148 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/rules/regex_candidate_scoring_rules.json +26 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/rules/regexes.json +111 -5
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/rules/variable_scoring_rules.json +55 -0
- deepsecrets-2.3.0/pyproject.toml +119 -0
- deepsecrets-2.2.0/LICENSE +0 -21
- deepsecrets-2.2.0/deepsecrets/config.py +0 -170
- deepsecrets-2.2.0/deepsecrets/core/engines/semantic.py +0 -127
- deepsecrets-2.2.0/deepsecrets/core/utils/lexer_finder.py +0 -131
- deepsecrets-2.2.0/pyproject.toml +0 -96
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/__main__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/engines/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/engines/hashed_secret.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/engines/iengine.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/helpers/confidence.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/helpers/content_analyzer.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/helpers/encoding.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/helpers/entropy.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/helpers/naturalness_scorer.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/file.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/internal/processing.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/response/base.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/response/builtin.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/exlcuded_path.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/false_finding.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/hashed_secret.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/hashing.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/regex.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/rules/rule.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/token.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/model/tokenized_region.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/rulesets/excluded_paths.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/rulesets/false_findings.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/rulesets/hashed_secrets.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/rulesets/ibuilder.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/rulesets/regex.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/rulesets/regex_candidate_scoring.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/rulesets/variable_scoring.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/cheap_var_search.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/full_content.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/cheap_var_search/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/semantic/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/semantic/deep_analyzer.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/semantic/var_detection/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/semantic/var_detection/detector.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/single_token_improver.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/subfile_regions_helper.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/token_table.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/helpers/type_stream.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/itokenizer.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/lexer.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/per_line.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/tokenizers/per_word.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/ui/floating_header.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/ui/progress_bar.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/ui/time_remaining_column.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/__init__.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/cpu.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/environment.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/exceptions.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/file_analyzer.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/finding_merger.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/fs.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/gc_freeze.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/guess_filetype.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/hashing.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/lifecycle_hooks.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/log.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/multiprocessing_setup.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/progress.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/core/utils/string.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/rules/excluded_bundles.json +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/rules/excluded_paths.json +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/rules/value_scoring_model.json +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/scan_modes/cli.py +0 -0
- {deepsecrets-2.2.0 → deepsecrets-2.3.0}/deepsecrets/utils.py +0 -0
|
@@ -0,0 +1,235 @@
|
|
|
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.
|
|
203
|
+
|
|
204
|
+
--------------------------------------------------------------------------------
|
|
205
|
+
|
|
206
|
+
PORTIONS UNDER THE MIT LICENSE
|
|
207
|
+
|
|
208
|
+
DeepSecrets was first released at https://github.com/avito-tech/deepsecrets
|
|
209
|
+
under the MIT License below. Code from that release, and contributions made
|
|
210
|
+
to the project under the MIT License before version 2.3.0, remain available
|
|
211
|
+
under it; the rest of DeepSecrets is licensed under the Apache License,
|
|
212
|
+
Version 2.0, above. See NOTICE.
|
|
213
|
+
|
|
214
|
+
MIT License
|
|
215
|
+
|
|
216
|
+
Copyright (c) 2023 Avito
|
|
217
|
+
Copyright (c) 2023-2026 Nikolai Khechumov
|
|
218
|
+
|
|
219
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
220
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
221
|
+
in the Software without restriction, including without limitation the rights
|
|
222
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
223
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
224
|
+
furnished to do so, subject to the following conditions:
|
|
225
|
+
|
|
226
|
+
The above copyright notice and this permission notice shall be included in all
|
|
227
|
+
copies or substantial portions of the Software.
|
|
228
|
+
|
|
229
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
230
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
231
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
232
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
233
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
234
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
235
|
+
SOFTWARE.
|
deepsecrets-2.3.0/NOTICE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
DeepSecrets
|
|
2
|
+
Copyright 2023-2026 Nikolai Khechumov
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0, from version 2.3.0; see LICENSE.
|
|
5
|
+
|
|
6
|
+
This product includes software written by Nikolai Khechumov at Avito and first
|
|
7
|
+
released at https://github.com/avito-tech/deepsecrets, Copyright (c) 2023 Avito,
|
|
8
|
+
and contributions made to the project before version 2.3.0. Those portions are
|
|
9
|
+
licensed under the MIT License, whose text is at the end of LICENSE. Releases up
|
|
10
|
+
to and including 2.2.0 were published under the MIT License alone.
|
|
@@ -1,3 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deepsecrets
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: Offline secrets scanner that understands code: credentials found by variable names, entropy and provider formats, with confidence tiers, tags and SARIF output
|
|
5
|
+
License-Expression: Apache-2.0 AND MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
License-File: NOTICE
|
|
8
|
+
Keywords: secrets,secret-scanning,secrets-detection,credentials,api-keys,passwords,leak-detection,security,appsec,devsecops,sast,static-analysis,sarif,owasp
|
|
9
|
+
Author: Nikolai Khechumov
|
|
10
|
+
Author-email: khechumov@gmail.com
|
|
11
|
+
Maintainer: Nikolai Khechumov
|
|
12
|
+
Maintainer-email: khechumov@gmail.com
|
|
13
|
+
Requires-Python: >=3.11,<4.0.0
|
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Information Technology
|
|
18
|
+
Classifier: Intended Audience :: System Administrators
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
+
Classifier: Topic :: Security
|
|
27
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
28
|
+
Requires-Dist: aenum (==3.1.17)
|
|
29
|
+
Requires-Dist: jschema-to-python (==1.2.3)
|
|
30
|
+
Requires-Dist: mmh3 (==5.3.0)
|
|
31
|
+
Requires-Dist: ordered-set (==4.1.0)
|
|
32
|
+
Requires-Dist: puppetparser (==0.2.14)
|
|
33
|
+
Requires-Dist: pydantic (==2.13.5)
|
|
34
|
+
Requires-Dist: pygments (==2.21.0)
|
|
35
|
+
Requires-Dist: pyyaml (==6.0.3)
|
|
36
|
+
Requires-Dist: regex (==2026.9.3)
|
|
37
|
+
Requires-Dist: rich (==15.0.0)
|
|
38
|
+
Requires-Dist: sarif-om (==1.0.4)
|
|
39
|
+
Project-URL: Changelog, https://github.com/ntoskernel/deepsecrets/releases
|
|
40
|
+
Project-URL: Documentation, https://github.com/ntoskernel/deepsecrets#readme
|
|
41
|
+
Project-URL: Docker image, https://hub.docker.com/r/ntoskernel/deepsecrets
|
|
42
|
+
Project-URL: Homepage, https://owasp.org/projects/deepsecrets
|
|
43
|
+
Project-URL: Issues, https://github.com/ntoskernel/deepsecrets/issues
|
|
44
|
+
Project-URL: Source, https://github.com/ntoskernel/deepsecrets
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
1
47
|
# [OWASP](https://owasp.org/projects/deepsecrets) DeepSecrets — a better tool for secrets scanning
|
|
2
48
|
|
|
3
49
|
|
|
@@ -14,19 +60,36 @@ In our LLM-hype era, DeepSecrets still runs entirely on your machine — giving
|
|
|
14
60
|
Most existing scanners don't actually "understand" code. Instead, they just parse texts and have bad coverage.
|
|
15
61
|
|
|
16
62
|
DeepSecrets bridges the gap between classic regex scanners and full-scale commercial SAST tools. It extends the classic regex-based scanning strategy by heavily relying on semantic code analysis, dangerous variable detection, and context-aware entropy analysis.
|
|
17
|
-
|
|
63
|
+
Secret candidates come from what the code says, its names, assignments and calls, not from text alone. DeepSecrets reads code with lexers for about 600 languages and formats (Pygments), and finds variables with detection rules for 14 languages and a generic rule for the rest.
|
|
18
64
|
|
|
19
65
|
DeepSecrets also introduces a new way to find credentials with zero knowledge: the HashedSecret Engine. Just provide the hashed values of your known production secrets, and the tool will find them exposed in plain text within your code.
|
|
20
66
|
|
|
21
67
|
### Performance & Benchmarks (SecretBench)
|
|
22
68
|
|
|
23
|
-
DeepSecrets
|
|
69
|
+
DeepSecrets 2.3 was evaluated (November 2026) on the **SecretBench** benchmark: every file scanned, every labelled row counted.
|
|
70
|
+
|
|
71
|
+
* **93% Recall** and **91% Precision** (2.2: 93% and 86%)
|
|
72
|
+
* **1.6% False Positive Rate** on SecretBench scope (2.2: 2.7%)
|
|
73
|
+
* About **2,000 more secrets** that SecretBench does not label, among its findings outside the labels
|
|
74
|
+
|
|
75
|
+
Counted the way the June 2026 evaluation counted, on its own set of rows, 2.3 has 94% recall and 85% precision (2.0 in June 2026: 93% and 67%).
|
|
76
|
+
|
|
77
|
+
#### Reproduce these numbers
|
|
78
|
+
|
|
79
|
+
The figures come from [dsbench](https://github.com/ntoskernel/dsbench), an open-source benchmark harness that runs a scanner as a black box over a labelled corpus and counts what it reports. With SecretBench (available from [its authors](https://github.com/setu1421/SecretBench) on request) and dsbench, anyone can reproduce the per-row figures above and the comparison below:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
dsbench prepare # load SecretBench's labels and the corpus listing
|
|
83
|
+
dsbench run --tool-ref v2.3.0 # DeepSecrets 2.3.0 from its tag, in a venv from its own poetry.lock
|
|
84
|
+
dsbench tools fetch # the pinned gitleaks and Betterleaks releases, checked by SHA-256
|
|
85
|
+
dsbench run --tool gitleaks
|
|
86
|
+
dsbench run --tool betterleaks
|
|
87
|
+
dsbench compare RUN RUN ... # side by side, with 95% intervals
|
|
88
|
+
```
|
|
24
89
|
|
|
25
|
-
|
|
26
|
-
* **8% False Positive Rate** on SecretBench scope
|
|
27
|
-
* **~9K Extra Findings** *outside* the SecretBench scope
|
|
90
|
+
Every run scans every file, with each tool's path exclusions turned off. The June-way figures also need the June 2026 evaluation's table of rows, and the count of secrets beyond the labels needs our judged verdicts; neither is published, because both point at leaked credentials.
|
|
28
91
|
|
|
29
|
-
*(You can read the full under-the-hood story and benchmark breakdown in my HackerNoon article [here]())*
|
|
92
|
+
*(You can read the full under-the-hood story and benchmark breakdown in my HackerNoon article [here](https://hackernoon.com/deepsecrets-20-catching-93percent-of-secretbenchs-valids-while-filtering-92percent-of-noise-and-10k-extra))*
|
|
30
93
|
|
|
31
94
|
|
|
32
95
|
# Quick Start Guide
|
|
@@ -68,7 +131,9 @@ The `--help` command is always ready to guide you, but here are the key flags yo
|
|
|
68
131
|
* `--excluded-paths /path/to/exclusions.json`: Override or extend the default paths ignored during scanning.
|
|
69
132
|
* `--deep-max-size BYTES`: Files larger than this (default 250,000 bytes) get the fast analysis: the regex rules and the variable search, without the language lexer. Big files are mostly generated or minified, the lexer costs most of the scan time on them and rarely finds more there. `0` gives every file the full analysis.
|
|
70
133
|
* `--skip-bundles`: Skip minified JavaScript, source maps and bundles (`*.min.js`, `*.map`, `*.bundle.js`) entirely, on top of the other path exclusions.
|
|
71
|
-
* `--confidence-level {all,low,medium,high,very-high}`: The lowest confidence to report (default `low`, every finding). `medium`, `high` and `very-high` keep confidence
|
|
134
|
+
* `--confidence-level {all,low,medium,high,very-high}`: The lowest confidence to report (default `low`, every finding). `medium`, `high` and `very-high` keep confidence 5, 6 and 9 or more, the findings of the SARIF tiers of the same names and above; `all` also reports the regex matches the scanner judged not to be secrets (placeholders, examples), with an `-INFO` rule id.
|
|
135
|
+
* `--min-confidence N`: Report findings of confidence `N` or more, `N` from 0 to 10: any cut, where `--confidence-level` offers the floors of the tiers. Like every level but `all`, it leaves out the regex matches judged not to be secrets. Use one flag or the other, not both.
|
|
136
|
+
* `--exclude-tags TAG [TAG ...]`: Leave out the findings that carry any of these tags. A tag says what sort of secret a finding is, where its confidence says how likely it is one: `weak-password` (a weak value under a password-like name), `publishable` (a key made to ship to clients: reCAPTCHA and other site keys, Stripe `pk_` keys, Mapbox `pk.` tokens, player, analytics and maps keys), `test-context` (a test, spec, fixture, mock, example or sample path, relative to the target directory), `recorded-traffic` (VCR cassettes, session recordings, HAR files), `identifier` (an AWS id of a user, role or policy, which grants nothing) and `web-page` (an HTML page). Every finding is still reported by default; e.g. `--exclude-tags test-context` when you hunt live secrets.
|
|
72
137
|
* `--report-diagnostics`: Add every file found under the target to the SARIF report, with its status, scan time, skip reason and analysis depth.
|
|
73
138
|
* `--regex-candidate-scoring-rules /path/to/rules.json`: Supply your own rules for judging regex matches before they are reported. Give the flag no value to report regex matches unjudged.
|
|
74
139
|
* `--multiprocessing-context {forkserver,spawn,fork}`: How worker processes start. The default is `forkserver` where the platform has it (Linux, macOS): workers share the scanner already loaded in a server process. Windows uses `spawn`. All three give the same findings.
|
|
@@ -94,7 +159,7 @@ jobs:
|
|
|
94
159
|
- name: Set up Python
|
|
95
160
|
uses: actions/setup-python@v5
|
|
96
161
|
with:
|
|
97
|
-
python-version: '3.
|
|
162
|
+
python-version: '3.14'
|
|
98
163
|
|
|
99
164
|
- name: Install DeepSecrets
|
|
100
165
|
run: pip install deepsecrets
|
|
@@ -122,10 +187,12 @@ Masking doesn't break the deduplication logic of downstream platforms (like Gith
|
|
|
122
187
|
|
|
123
188
|
Every finding gets a confidence score. However, different security platforms parse SARIF metrics differently. To ensure compatibility across modern ASPM dashboards, DeepSecrets does the following:
|
|
124
189
|
|
|
125
|
-
* **Virtual Subrules (`rules[]`)**: Dynamically generates rules by confidence tier, from `S105-LOW` through `-MEDIUM` and `-HIGH` to `S105-VERY-HIGH` (and `-INFO` for the rejected matches `--confidence-level all` reports
|
|
190
|
+
* **Virtual Subrules (`rules[]`)**: Dynamically generates rules by confidence tier, from `S105-LOW` (confidence 0 to 4) through `-MEDIUM` (5) and `-HIGH` (6 to 8) to `S105-VERY-HIGH` (9 and 10), and `-INFO` for the rejected matches `--confidence-level all` reports. This forces GitHub Security and DefectDojo to map semantic precision variance properly without breaking native parsers.
|
|
126
191
|
|
|
127
192
|
* **Deterministic Result Level**: The tool always explicitly sets `level: error` in the `results[]` model. This acts as a universal fallback for CI/CD pipelines and older SAST parsers, ensuring that exposed secrets reliably break builds or block Pull Requests regardless of individual rule interpretations.
|
|
128
193
|
|
|
194
|
+
* **Tags**: Each result carries its tags, if it has any, in SARIF's standard `properties.tags` array (`weak-password`, `publishable`, `test-context`, `recorded-traffic`, `identifier`, `web-page`). Rule ids, severity and fingerprints do not depend on them.
|
|
195
|
+
|
|
129
196
|
* **Contextual Messages**: Injects the raw numeric confidence score natively into `result.message.text` so security analysts see it immediately on their dashboards.
|
|
130
197
|
|
|
131
198
|
|
|
@@ -174,21 +241,23 @@ While other tools scan only what they know, DeepSecrets leverages lexers. This a
|
|
|
174
241
|
|
|
175
242
|
#### Tool comparison based on SecretBench Results
|
|
176
243
|
|
|
177
|
-
| Feature / Capability | **DeepSecrets 2.
|
|
178
|
-
| :--- | :---: | :---: | :---: | :---: |
|
|
179
|
-
| **SecretBench Accuracy** | **93% Recall<br>
|
|
180
|
-
| **Price & Licensing** | **Free / Open-Source** | Free / Open-Source | Free / Open-Source | Commercial / Paid |
|
|
181
|
-
| **Analysis Type** | **Semantic / Regex** | Flat-text Regex / Entropy | Flat-text Regex / Entropy | Semantic |
|
|
182
|
-
| **Language Support** | **
|
|
183
|
-
| **Pre-hashed Validation** | **Yes (via Hashed Engine)** | No | No | No |
|
|
184
|
-
| **Context-Aware Entropy**| **Yes (Assigned values)** | No (Entire file text) | No (Entire file text) | Yes |
|
|
185
|
-
| **Advanced SARIF Output**| **Yes (
|
|
244
|
+
| Feature / Capability | **DeepSecrets 2.3** | **Gitleaks 8.30** | **Betterleaks 1.8** | **TruffleHog** | **Semgrep Secrets** |
|
|
245
|
+
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
246
|
+
| **SecretBench Accuracy** | **93% Recall<br>91% Precision** | 85% Recall<br>70% Precision | 85% Recall<br>61% Precision | *Not re-measured* | *Not Evaluated* |
|
|
247
|
+
| **Price & Licensing** | **Free / Open-Source** | Free / Open-Source | Free / Open-Source | Free / Open-Source | Commercial / Paid |
|
|
248
|
+
| **Analysis Type** | **Semantic / Regex** | Flat-text Regex / Entropy | Flat-text Regex / Entropy | Flat-text Regex / Entropy | Semantic |
|
|
249
|
+
| **Language Support** | **~600 lexed<br>(variables in 14)** | Context-agnostic (Text) | Context-agnostic (Text) | Context-agnostic (Text) | Limited subset |
|
|
250
|
+
| **Pre-hashed Validation** | **Yes (via Hashed Engine)** | No | No | No | No |
|
|
251
|
+
| **Context-Aware Entropy**| **Yes (Assigned values)** | No (Entire file text) | No (Entire file text) | No (Entire file text) | Yes |
|
|
252
|
+
| **Advanced SARIF Output**| **Yes (Confidence tiers and tags)** | Basic | Basic | Basic | Yes |
|
|
253
|
+
|
|
254
|
+
_SecretBench, every file scanned, every labelled row counted, with [dsbench](https://github.com/ntoskernel/dsbench) (see [Reproduce these numbers](#reproduce-these-numbers)). DeepSecrets 2.3, Gitleaks 8.30.1 and Betterleaks 1.8.1 measured on the same harness in October and November 2026, Gitleaks and Betterleaks with their default rules and their global path allowlist removed so that every file is scanned, as for DeepSecrets. TruffleHog was measured in June 2026 by another method (52% recall, 6% precision) and not since._
|
|
186
255
|
|
|
187
256
|
|
|
188
257
|
|
|
189
258
|
> Why don't you build true abstract syntax trees? It's academically more correct!
|
|
190
259
|
|
|
191
|
-
DeepSecrets tries to keep a balance between complexity and effectiveness. Building a true AST across
|
|
260
|
+
DeepSecrets tries to keep a balance between complexity and effectiveness. Building a true AST across hundreds of languages is incredibly complex and simply overkill for the secrets detection. The tool follows the generic SAST approach to code analysis but optimizes the AST stage for maximum speed and width.
|
|
192
261
|
|
|
193
262
|
> I'd like to build my own semantic rules. How do I do that?
|
|
194
263
|
|
|
@@ -254,4 +323,16 @@ Steps:
|
|
|
254
323
|
1. Clone the repository
|
|
255
324
|
2. Open the cloned folder with VSCode
|
|
256
325
|
3. Select "Reopen in Container" when prompted
|
|
257
|
-
4. Wait for the automated environment build to complete. You are ready to develop.
|
|
326
|
+
4. Wait for the automated environment build to complete. You are ready to develop.
|
|
327
|
+
|
|
328
|
+
## History and license
|
|
329
|
+
|
|
330
|
+
DeepSecrets was created by Nikolai Khechumov at Avito in 2022 and open-sourced in April 2023 at
|
|
331
|
+
[avito-tech/deepsecrets](https://github.com/avito-tech/deepsecrets). It has been an OWASP project since 2023 and has
|
|
332
|
+
been developed in this repository since November 2023.
|
|
333
|
+
|
|
334
|
+
From version 2.3.0 DeepSecrets is licensed under the [Apache License 2.0](LICENSE). Code from the original release
|
|
335
|
+
and contributions made before 2.3.0 remain available under the MIT License, whose text is at the end of
|
|
336
|
+
[LICENSE](LICENSE); [NOTICE](NOTICE) says which is which. Releases up to and including 2.2.0 were published under the
|
|
337
|
+
MIT License.
|
|
338
|
+
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: deepsecrets
|
|
3
|
-
Version: 2.2.0
|
|
4
|
-
Summary: A better tool for secrets scanning
|
|
5
|
-
License: MIT
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Keywords: security,secrets,credentials,scanning,appsec,code,search
|
|
8
|
-
Author: Nikolai Khechumov
|
|
9
|
-
Author-email: khechumov@gmail.com
|
|
10
|
-
Maintainer: Nikolai Khechumov
|
|
11
|
-
Maintainer-email: khechumov@gmail.com
|
|
12
|
-
Requires-Python: >=3.11,<4.0.0
|
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
-
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Environment :: Console
|
|
17
|
-
Classifier: Topic :: Security
|
|
18
|
-
Requires-Dist: aenum (==3.1.17)
|
|
19
|
-
Requires-Dist: jschema-to-python (==1.2.3)
|
|
20
|
-
Requires-Dist: mmh3 (==5.3.0)
|
|
21
|
-
Requires-Dist: ordered-set (==4.1.0)
|
|
22
|
-
Requires-Dist: puppetparser (==0.2.14)
|
|
23
|
-
Requires-Dist: pydantic (==2.13.5)
|
|
24
|
-
Requires-Dist: pygments (==2.21.0)
|
|
25
|
-
Requires-Dist: pyyaml (==6.0.3)
|
|
26
|
-
Requires-Dist: regex (==2026.9.3)
|
|
27
|
-
Requires-Dist: rich (==15.0.0)
|
|
28
|
-
Requires-Dist: sarif-om (==1.0.4)
|
|
29
|
-
Project-URL: Bug Tracker, https://github.com/ntoskernel/deepsecrets/issues
|
|
30
|
-
Project-URL: Homepage, https://owasp.org/projects/deepsecrets
|
|
31
|
-
Project-URL: Repository, https://github.com/ntoskernel/deepsecrets
|
|
32
|
-
Description-Content-Type: text/markdown
|
|
33
|
-
|
|
34
1
|
# [OWASP](https://owasp.org/projects/deepsecrets) DeepSecrets — a better tool for secrets scanning
|
|
35
2
|
|
|
36
3
|
|
|
@@ -47,19 +14,36 @@ In our LLM-hype era, DeepSecrets still runs entirely on your machine — giving
|
|
|
47
14
|
Most existing scanners don't actually "understand" code. Instead, they just parse texts and have bad coverage.
|
|
48
15
|
|
|
49
16
|
DeepSecrets bridges the gap between classic regex scanners and full-scale commercial SAST tools. It extends the classic regex-based scanning strategy by heavily relying on semantic code analysis, dangerous variable detection, and context-aware entropy analysis.
|
|
50
|
-
|
|
17
|
+
Secret candidates come from what the code says, its names, assignments and calls, not from text alone. DeepSecrets reads code with lexers for about 600 languages and formats (Pygments), and finds variables with detection rules for 14 languages and a generic rule for the rest.
|
|
51
18
|
|
|
52
19
|
DeepSecrets also introduces a new way to find credentials with zero knowledge: the HashedSecret Engine. Just provide the hashed values of your known production secrets, and the tool will find them exposed in plain text within your code.
|
|
53
20
|
|
|
54
21
|
### Performance & Benchmarks (SecretBench)
|
|
55
22
|
|
|
56
|
-
DeepSecrets
|
|
23
|
+
DeepSecrets 2.3 was evaluated (November 2026) on the **SecretBench** benchmark: every file scanned, every labelled row counted.
|
|
24
|
+
|
|
25
|
+
* **93% Recall** and **91% Precision** (2.2: 93% and 86%)
|
|
26
|
+
* **1.6% False Positive Rate** on SecretBench scope (2.2: 2.7%)
|
|
27
|
+
* About **2,000 more secrets** that SecretBench does not label, among its findings outside the labels
|
|
28
|
+
|
|
29
|
+
Counted the way the June 2026 evaluation counted, on its own set of rows, 2.3 has 94% recall and 85% precision (2.0 in June 2026: 93% and 67%).
|
|
30
|
+
|
|
31
|
+
#### Reproduce these numbers
|
|
57
32
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
33
|
+
The figures come from [dsbench](https://github.com/ntoskernel/dsbench), an open-source benchmark harness that runs a scanner as a black box over a labelled corpus and counts what it reports. With SecretBench (available from [its authors](https://github.com/setu1421/SecretBench) on request) and dsbench, anyone can reproduce the per-row figures above and the comparison below:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
dsbench prepare # load SecretBench's labels and the corpus listing
|
|
37
|
+
dsbench run --tool-ref v2.3.0 # DeepSecrets 2.3.0 from its tag, in a venv from its own poetry.lock
|
|
38
|
+
dsbench tools fetch # the pinned gitleaks and Betterleaks releases, checked by SHA-256
|
|
39
|
+
dsbench run --tool gitleaks
|
|
40
|
+
dsbench run --tool betterleaks
|
|
41
|
+
dsbench compare RUN RUN ... # side by side, with 95% intervals
|
|
42
|
+
```
|
|
61
43
|
|
|
62
|
-
|
|
44
|
+
Every run scans every file, with each tool's path exclusions turned off. The June-way figures also need the June 2026 evaluation's table of rows, and the count of secrets beyond the labels needs our judged verdicts; neither is published, because both point at leaked credentials.
|
|
45
|
+
|
|
46
|
+
*(You can read the full under-the-hood story and benchmark breakdown in my HackerNoon article [here](https://hackernoon.com/deepsecrets-20-catching-93percent-of-secretbenchs-valids-while-filtering-92percent-of-noise-and-10k-extra))*
|
|
63
47
|
|
|
64
48
|
|
|
65
49
|
# Quick Start Guide
|
|
@@ -101,7 +85,9 @@ The `--help` command is always ready to guide you, but here are the key flags yo
|
|
|
101
85
|
* `--excluded-paths /path/to/exclusions.json`: Override or extend the default paths ignored during scanning.
|
|
102
86
|
* `--deep-max-size BYTES`: Files larger than this (default 250,000 bytes) get the fast analysis: the regex rules and the variable search, without the language lexer. Big files are mostly generated or minified, the lexer costs most of the scan time on them and rarely finds more there. `0` gives every file the full analysis.
|
|
103
87
|
* `--skip-bundles`: Skip minified JavaScript, source maps and bundles (`*.min.js`, `*.map`, `*.bundle.js`) entirely, on top of the other path exclusions.
|
|
104
|
-
* `--confidence-level {all,low,medium,high,very-high}`: The lowest confidence to report (default `low`, every finding). `medium`, `high` and `very-high` keep confidence
|
|
88
|
+
* `--confidence-level {all,low,medium,high,very-high}`: The lowest confidence to report (default `low`, every finding). `medium`, `high` and `very-high` keep confidence 5, 6 and 9 or more, the findings of the SARIF tiers of the same names and above; `all` also reports the regex matches the scanner judged not to be secrets (placeholders, examples), with an `-INFO` rule id.
|
|
89
|
+
* `--min-confidence N`: Report findings of confidence `N` or more, `N` from 0 to 10: any cut, where `--confidence-level` offers the floors of the tiers. Like every level but `all`, it leaves out the regex matches judged not to be secrets. Use one flag or the other, not both.
|
|
90
|
+
* `--exclude-tags TAG [TAG ...]`: Leave out the findings that carry any of these tags. A tag says what sort of secret a finding is, where its confidence says how likely it is one: `weak-password` (a weak value under a password-like name), `publishable` (a key made to ship to clients: reCAPTCHA and other site keys, Stripe `pk_` keys, Mapbox `pk.` tokens, player, analytics and maps keys), `test-context` (a test, spec, fixture, mock, example or sample path, relative to the target directory), `recorded-traffic` (VCR cassettes, session recordings, HAR files), `identifier` (an AWS id of a user, role or policy, which grants nothing) and `web-page` (an HTML page). Every finding is still reported by default; e.g. `--exclude-tags test-context` when you hunt live secrets.
|
|
105
91
|
* `--report-diagnostics`: Add every file found under the target to the SARIF report, with its status, scan time, skip reason and analysis depth.
|
|
106
92
|
* `--regex-candidate-scoring-rules /path/to/rules.json`: Supply your own rules for judging regex matches before they are reported. Give the flag no value to report regex matches unjudged.
|
|
107
93
|
* `--multiprocessing-context {forkserver,spawn,fork}`: How worker processes start. The default is `forkserver` where the platform has it (Linux, macOS): workers share the scanner already loaded in a server process. Windows uses `spawn`. All three give the same findings.
|
|
@@ -127,7 +113,7 @@ jobs:
|
|
|
127
113
|
- name: Set up Python
|
|
128
114
|
uses: actions/setup-python@v5
|
|
129
115
|
with:
|
|
130
|
-
python-version: '3.
|
|
116
|
+
python-version: '3.14'
|
|
131
117
|
|
|
132
118
|
- name: Install DeepSecrets
|
|
133
119
|
run: pip install deepsecrets
|
|
@@ -155,10 +141,12 @@ Masking doesn't break the deduplication logic of downstream platforms (like Gith
|
|
|
155
141
|
|
|
156
142
|
Every finding gets a confidence score. However, different security platforms parse SARIF metrics differently. To ensure compatibility across modern ASPM dashboards, DeepSecrets does the following:
|
|
157
143
|
|
|
158
|
-
* **Virtual Subrules (`rules[]`)**: Dynamically generates rules by confidence tier, from `S105-LOW` through `-MEDIUM` and `-HIGH` to `S105-VERY-HIGH` (and `-INFO` for the rejected matches `--confidence-level all` reports
|
|
144
|
+
* **Virtual Subrules (`rules[]`)**: Dynamically generates rules by confidence tier, from `S105-LOW` (confidence 0 to 4) through `-MEDIUM` (5) and `-HIGH` (6 to 8) to `S105-VERY-HIGH` (9 and 10), and `-INFO` for the rejected matches `--confidence-level all` reports. This forces GitHub Security and DefectDojo to map semantic precision variance properly without breaking native parsers.
|
|
159
145
|
|
|
160
146
|
* **Deterministic Result Level**: The tool always explicitly sets `level: error` in the `results[]` model. This acts as a universal fallback for CI/CD pipelines and older SAST parsers, ensuring that exposed secrets reliably break builds or block Pull Requests regardless of individual rule interpretations.
|
|
161
147
|
|
|
148
|
+
* **Tags**: Each result carries its tags, if it has any, in SARIF's standard `properties.tags` array (`weak-password`, `publishable`, `test-context`, `recorded-traffic`, `identifier`, `web-page`). Rule ids, severity and fingerprints do not depend on them.
|
|
149
|
+
|
|
162
150
|
* **Contextual Messages**: Injects the raw numeric confidence score natively into `result.message.text` so security analysts see it immediately on their dashboards.
|
|
163
151
|
|
|
164
152
|
|
|
@@ -207,21 +195,23 @@ While other tools scan only what they know, DeepSecrets leverages lexers. This a
|
|
|
207
195
|
|
|
208
196
|
#### Tool comparison based on SecretBench Results
|
|
209
197
|
|
|
210
|
-
| Feature / Capability | **DeepSecrets 2.
|
|
211
|
-
| :--- | :---: | :---: | :---: | :---: |
|
|
212
|
-
| **SecretBench Accuracy** | **93% Recall<br>
|
|
213
|
-
| **Price & Licensing** | **Free / Open-Source** | Free / Open-Source | Free / Open-Source | Commercial / Paid |
|
|
214
|
-
| **Analysis Type** | **Semantic / Regex** | Flat-text Regex / Entropy | Flat-text Regex / Entropy | Semantic |
|
|
215
|
-
| **Language Support** | **
|
|
216
|
-
| **Pre-hashed Validation** | **Yes (via Hashed Engine)** | No | No | No |
|
|
217
|
-
| **Context-Aware Entropy**| **Yes (Assigned values)** | No (Entire file text) | No (Entire file text) | Yes |
|
|
218
|
-
| **Advanced SARIF Output**| **Yes (
|
|
198
|
+
| Feature / Capability | **DeepSecrets 2.3** | **Gitleaks 8.30** | **Betterleaks 1.8** | **TruffleHog** | **Semgrep Secrets** |
|
|
199
|
+
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
200
|
+
| **SecretBench Accuracy** | **93% Recall<br>91% Precision** | 85% Recall<br>70% Precision | 85% Recall<br>61% Precision | *Not re-measured* | *Not Evaluated* |
|
|
201
|
+
| **Price & Licensing** | **Free / Open-Source** | Free / Open-Source | Free / Open-Source | Free / Open-Source | Commercial / Paid |
|
|
202
|
+
| **Analysis Type** | **Semantic / Regex** | Flat-text Regex / Entropy | Flat-text Regex / Entropy | Flat-text Regex / Entropy | Semantic |
|
|
203
|
+
| **Language Support** | **~600 lexed<br>(variables in 14)** | Context-agnostic (Text) | Context-agnostic (Text) | Context-agnostic (Text) | Limited subset |
|
|
204
|
+
| **Pre-hashed Validation** | **Yes (via Hashed Engine)** | No | No | No | No |
|
|
205
|
+
| **Context-Aware Entropy**| **Yes (Assigned values)** | No (Entire file text) | No (Entire file text) | No (Entire file text) | Yes |
|
|
206
|
+
| **Advanced SARIF Output**| **Yes (Confidence tiers and tags)** | Basic | Basic | Basic | Yes |
|
|
207
|
+
|
|
208
|
+
_SecretBench, every file scanned, every labelled row counted, with [dsbench](https://github.com/ntoskernel/dsbench) (see [Reproduce these numbers](#reproduce-these-numbers)). DeepSecrets 2.3, Gitleaks 8.30.1 and Betterleaks 1.8.1 measured on the same harness in October and November 2026, Gitleaks and Betterleaks with their default rules and their global path allowlist removed so that every file is scanned, as for DeepSecrets. TruffleHog was measured in June 2026 by another method (52% recall, 6% precision) and not since._
|
|
219
209
|
|
|
220
210
|
|
|
221
211
|
|
|
222
212
|
> Why don't you build true abstract syntax trees? It's academically more correct!
|
|
223
213
|
|
|
224
|
-
DeepSecrets tries to keep a balance between complexity and effectiveness. Building a true AST across
|
|
214
|
+
DeepSecrets tries to keep a balance between complexity and effectiveness. Building a true AST across hundreds of languages is incredibly complex and simply overkill for the secrets detection. The tool follows the generic SAST approach to code analysis but optimizes the AST stage for maximum speed and width.
|
|
225
215
|
|
|
226
216
|
> I'd like to build my own semantic rules. How do I do that?
|
|
227
217
|
|
|
@@ -288,3 +278,14 @@ Steps:
|
|
|
288
278
|
2. Open the cloned folder with VSCode
|
|
289
279
|
3. Select "Reopen in Container" when prompted
|
|
290
280
|
4. Wait for the automated environment build to complete. You are ready to develop.
|
|
281
|
+
|
|
282
|
+
## History and license
|
|
283
|
+
|
|
284
|
+
DeepSecrets was created by Nikolai Khechumov at Avito in 2022 and open-sourced in April 2023 at
|
|
285
|
+
[avito-tech/deepsecrets](https://github.com/avito-tech/deepsecrets). It has been an OWASP project since 2023 and has
|
|
286
|
+
been developed in this repository since November 2023.
|
|
287
|
+
|
|
288
|
+
From version 2.3.0 DeepSecrets is licensed under the [Apache License 2.0](LICENSE). Code from the original release
|
|
289
|
+
and contributions made before 2.3.0 remain available under the MIT License, whose text is at the end of
|
|
290
|
+
[LICENSE](LICENSE); [NOTICE](NOTICE) says which is which. Releases up to and including 2.2.0 were published under the
|
|
291
|
+
MIT License.
|