vintar 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.
- vintar-0.1.0/CHANGELOG.md +14 -0
- vintar-0.1.0/LICENSE +202 -0
- vintar-0.1.0/PKG-INFO +375 -0
- vintar-0.1.0/README.md +350 -0
- vintar-0.1.0/pyproject.toml +136 -0
- vintar-0.1.0/pyproject.toml.orig +111 -0
- vintar-0.1.0/src/vintar/__init__.py +2 -0
- vintar-0.1.0/src/vintar/checks/__init__.py +0 -0
- vintar-0.1.0/src/vintar/checks/sqli/__init__.py +0 -0
- vintar-0.1.0/src/vintar/checks/sqli/_errors.py +27 -0
- vintar-0.1.0/src/vintar/checks/sqli/_time_evidence_posix.py +186 -0
- vintar-0.1.0/src/vintar/checks/sqli/analyzer.py +180 -0
- vintar-0.1.0/src/vintar/checks/sqli/confirmation.py +348 -0
- vintar-0.1.0/src/vintar/checks/sqli/confirmation_runner.py +640 -0
- vintar-0.1.0/src/vintar/checks/sqli/cross_phase.py +141 -0
- vintar-0.1.0/src/vintar/checks/sqli/dynamic.py +90 -0
- vintar-0.1.0/src/vintar/checks/sqli/models.py +225 -0
- vintar-0.1.0/src/vintar/checks/sqli/orchestrator.py +194 -0
- vintar-0.1.0/src/vintar/checks/sqli/presets.py +46 -0
- vintar-0.1.0/src/vintar/checks/sqli/report.py +99 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_analyzer.py +477 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_application_quality.py +325 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_cluster_quality.py +286 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence.py +236 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_audit.py +393 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_checkpoint.py +269 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_freshness.py +211 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_governor.py +729 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_lifecycle.py +284 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_loader.py +70 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_process.py +355 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_session.py +292 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_signature.py +297 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_evidence_stream.py +347 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_plan.py +270 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_provenance.py +305 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_quality.py +521 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_research.py +375 -0
- vintar-0.1.0/src/vintar/checks/sqli/time_runner.py +317 -0
- vintar-0.1.0/src/vintar/cli.py +163 -0
- vintar-0.1.0/src/vintar/core/__init__.py +0 -0
- vintar-0.1.0/src/vintar/core/budget.py +43 -0
- vintar-0.1.0/src/vintar/core/executor.py +142 -0
- vintar-0.1.0/src/vintar/core/http.py +88 -0
- vintar-0.1.0/src/vintar/core/injector.py +48 -0
- vintar-0.1.0/src/vintar/core/models.py +14 -0
- vintar-0.1.0/src/vintar/core/rate_limit.py +75 -0
- vintar-0.1.0/src/vintar/core/request.py +36 -0
- vintar-0.1.0/src/vintar/core/scope.py +98 -0
- vintar-0.1.0/src/vintar/core/template.py +120 -0
- vintar-0.1.0/src/vintar/core/transport.py +149 -0
- vintar-0.1.0/src/vintar/discover_cli.py +177 -0
- vintar-0.1.0/src/vintar/materialize_case_cli.py +58 -0
- vintar-0.1.0/src/vintar/regression/__init__.py +51 -0
- vintar-0.1.0/src/vintar/regression/batch.py +202 -0
- vintar-0.1.0/src/vintar/regression/binding.py +93 -0
- vintar-0.1.0/src/vintar/regression/case_materialization.py +406 -0
- vintar-0.1.0/src/vintar/regression/cases.py +503 -0
- vintar-0.1.0/src/vintar/regression/discovery.py +991 -0
- vintar-0.1.0/src/vintar/regression/discovery_drafts.py +161 -0
- vintar-0.1.0/src/vintar/regression/discovery_review.py +312 -0
- vintar-0.1.0/src/vintar/regression/report.py +129 -0
- vintar-0.1.0/src/vintar/regression/runner.py +262 -0
- vintar-0.1.0/src/vintar/regression_cli.py +223 -0
- vintar-0.1.0/src/vintar/review_draft_cli.py +52 -0
- vintar-0.1.0/src/vintar/sqli_cli.py +170 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2026-11-20
|
|
6
|
+
|
|
7
|
+
- Run authorized Boolean SQL injection regression checks on GET query parameters with Schema v1 TOML cases, JSON reports, and CI exit codes.
|
|
8
|
+
- Discover inputs offline from OpenAPI 3.0 and 3.1, review the decisions, and materialize reviewed cases with explicit `string-quoted` or `numeric` preset selection.
|
|
9
|
+
- Report candidate signals as inconclusive and block CI on inconclusive or failed batches.
|
|
10
|
+
- Enforce target origin, request budgets, rate limits, and response size limits during verification.
|
|
11
|
+
- Inspect HTTP responses and run individual Boolean checks from the CLI.
|
|
12
|
+
- Measure candidate-signal reliability with matched SQLite loopback fixtures.
|
|
13
|
+
- Validate batch reports and verify exit contracts against local fixtures in GitHub Actions.
|
|
14
|
+
- Check CLI output and README examples with deterministic golden tests. CI also checks formatting, architecture, strict types, and Git history for committed secrets.
|
vintar-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.
|
vintar-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vintar
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Run authorized web security regression checks in CI with JSON reports and exit codes.
|
|
5
|
+
Keywords: security,sql-injection,regression-testing,ci,openapi
|
|
6
|
+
Author: natori
|
|
7
|
+
Author-email: natori <203920478+natori-hrj@users.noreply.github.com>
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Topic :: Security
|
|
14
|
+
Classifier: Topic :: Software Development :: Testing
|
|
15
|
+
Requires-Dist: cryptography>=46.0.5,<51.0.0
|
|
16
|
+
Requires-Dist: httpx>=0.28.1
|
|
17
|
+
Requires-Dist: pyyaml==6.0.3
|
|
18
|
+
Requires-Dist: rich>=15.0.0
|
|
19
|
+
Requires-Dist: typer>=0.27.3
|
|
20
|
+
Requires-Python: >=3.13
|
|
21
|
+
Project-URL: Homepage, https://github.com/natori-hrj/vintar
|
|
22
|
+
Project-URL: Repository, https://github.com/natori-hrj/vintar
|
|
23
|
+
Project-URL: Issues, https://github.com/natori-hrj/vintar/issues
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Vintar
|
|
27
|
+
|
|
28
|
+
Vintar is a Python tool for running authorized web security regression checks in CI. It runs reviewed cases against a configured target and reports the batch result as JSON and a process exit code.
|
|
29
|
+
|
|
30
|
+
## v0.1.0 Scope
|
|
31
|
+
|
|
32
|
+
Vintar v0.1.0 supports Boolean-based SQL injection regression checks for
|
|
33
|
+
`GET` query parameters. OpenAPI 3.0 and 3.1 discovery, draft review, and case
|
|
34
|
+
materialization run offline. The workflow is
|
|
35
|
+
`discover → review-draft → materialize-case → verify`. Reviewers explicitly
|
|
36
|
+
select the `string-quoted` or `numeric` probe preset when using presets.
|
|
37
|
+
Verification runs against an authorized, configured target.
|
|
38
|
+
|
|
39
|
+
Deferred to v0.2 and later are confirmed `VULNERABLE` verdicts and CLI integration
|
|
40
|
+
of 12-probe confirmation, time-based, error-based, and UNION-based SQL injection
|
|
41
|
+
checks, POST form and JSON body injection, cookie and header injection, and
|
|
42
|
+
authenticated workflows.
|
|
43
|
+
|
|
44
|
+
## Install from PyPI
|
|
45
|
+
|
|
46
|
+
Use Python 3.13 or later. With uv, install Vintar as a CLI tool.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv tool install vintar
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Alternatively, install it in an active virtual environment with pip.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install vintar
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Install from Source
|
|
59
|
+
|
|
60
|
+
For development, clone the repository and install from the lockfile.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/natori-hrj/vintar.git
|
|
64
|
+
cd vintar
|
|
65
|
+
uv sync --locked
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The examples below use `uv run --locked vintar` from a source checkout. With an
|
|
69
|
+
installed CLI, use `vintar` in its place.
|
|
70
|
+
|
|
71
|
+
## Run Your First Regression Batch
|
|
72
|
+
|
|
73
|
+
### Create a TOML Case
|
|
74
|
+
|
|
75
|
+
Save this example as `security/cases/a-case.toml`. It expects a test fixture with an `/ok` endpoint and a `category` query parameter. Adapt the path, parameter, and reviewed probe values to your authorized fixture. `--cases` accepts one TOML file or a directory of TOML files. Directory discovery is nonrecursive.
|
|
76
|
+
|
|
77
|
+
<!-- cli-example: verify-pass/case -->
|
|
78
|
+
```toml
|
|
79
|
+
version = 1
|
|
80
|
+
id = "a-case"
|
|
81
|
+
type = "sqli.boolean"
|
|
82
|
+
expected_verdict = "not_detected"
|
|
83
|
+
|
|
84
|
+
[target]
|
|
85
|
+
url = "http://placeholder.invalid:8000/ok"
|
|
86
|
+
allowed_origin = "http://placeholder.invalid:8000"
|
|
87
|
+
|
|
88
|
+
[[target.params]]
|
|
89
|
+
name = "category"
|
|
90
|
+
value = "Pets"
|
|
91
|
+
|
|
92
|
+
[injection]
|
|
93
|
+
location = "query"
|
|
94
|
+
name = "category"
|
|
95
|
+
occurrence = 0
|
|
96
|
+
mode = "append"
|
|
97
|
+
|
|
98
|
+
[probes]
|
|
99
|
+
true_payload = "true-probe"
|
|
100
|
+
false_payload = "false-probe"
|
|
101
|
+
|
|
102
|
+
[limits]
|
|
103
|
+
max_requests = 6
|
|
104
|
+
requests_per_second = 10.0
|
|
105
|
+
timeout_seconds = 5.0
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Configure the Authorized Target
|
|
109
|
+
|
|
110
|
+
Run verification only against systems you own or have explicit permission to test. `--authorized` is your attestation. Set both `VINTAR_TARGET_ORIGIN` and `VINTAR_ALLOWED_ORIGIN` to the authorized service's exact origin in the trusted CI environment. Vintar replaces the case's placeholder origin with the runtime target and preserves the case path. Keep credentials and secrets out of origins and case files.
|
|
111
|
+
|
|
112
|
+
### Run `vintar verify`
|
|
113
|
+
|
|
114
|
+
Replace `https://staging.example.com` with your authorized fixture origin.
|
|
115
|
+
|
|
116
|
+
<!-- cli-example: verify-pass/command -->
|
|
117
|
+
```bash
|
|
118
|
+
VINTAR_TARGET_ORIGIN=https://staging.example.com \
|
|
119
|
+
VINTAR_ALLOWED_ORIGIN=https://staging.example.com \
|
|
120
|
+
uv run --locked vintar verify \
|
|
121
|
+
--cases security/cases/a-case.toml --max-requests 6 --authorized
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Exit Codes and JSON Reports
|
|
125
|
+
|
|
126
|
+
| Case outcome or batch condition | `verify` exit code | CI meaning |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| `NOT_DETECTED` matches the reviewed expectation for every case in a complete batch | `0` | **PASS.** No Boolean differential was detected under the tested probes and conditions. This does not prove SQL injection is absent. |
|
|
129
|
+
| `INCONCLUSIVE` with reason `boolean_candidate` | `3` | **BLOCK / Review required.** A SQLi-like Boolean response differential was observed. This is a candidate signal and requires independent evidence before anyone can call it a confirmed vulnerability. |
|
|
130
|
+
| Other `INCONCLUSIVE` reasons or an incomplete batch | `3` | **BLOCK / Investigation required.** Verification was insufficient. Check the budget, rate limits, transport or HTTP status, and response stability. |
|
|
131
|
+
| `FAIL` | `1` | **FAIL.** A `NOT_DETECTED` result did not match the reviewed expectation. |
|
|
132
|
+
| `ERROR` | `2` | **ERROR.** Invalid input, configuration, execution, or output prevented a usable result. |
|
|
133
|
+
| Interrupted | `130` | **Interrupted.** A usable report may be absent. |
|
|
134
|
+
|
|
135
|
+
These are batch exit codes. A failed case takes precedence over inconclusive
|
|
136
|
+
outcomes and an incomplete batch. An inconclusive case never passes, even when
|
|
137
|
+
its verdict matches the expectation.
|
|
138
|
+
|
|
139
|
+
`verify` emits one [schema v1 JSON report](schemas/regression-batch-report-v1.schema.json) on stdout for results `0`, `1`, and `3`. Diagnostics go to stderr. Use `--pretty` for indentation. An error or interruption can leave stdout empty or incomplete.
|
|
140
|
+
|
|
141
|
+
This excerpt shows the summary fields of a passing report.
|
|
142
|
+
|
|
143
|
+
<!-- cli-example: verify-pass/report -->
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"schema_version": 1,
|
|
147
|
+
"report_type": "regression_batch",
|
|
148
|
+
"status": "pass",
|
|
149
|
+
"exit_code": 0,
|
|
150
|
+
"complete": true,
|
|
151
|
+
"requests_used": 6
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Integrate with GitHub Actions
|
|
156
|
+
|
|
157
|
+
- **PR loopback checks.** The PR workflow runs lint, architecture checks, and pytest before loopback E2E. The E2E uses a local fixture and verifies the batch exit and report contracts.
|
|
158
|
+
- **Authorized staging verification.** The staging workflow is manually dispatched from `main` using the `security-testing` environment. Configure the trusted origins and add reviewed cases under `security/cases/`.
|
|
159
|
+
- **Report validation and artifacts.** The staging workflow captures the CLI exit code, validates the report against it, and uploads the report only after validation. An absent or invalid report becomes workflow error `2`, including when the CLI was interrupted. Restrict artifact access because case IDs and response metadata can be sensitive.
|
|
160
|
+
|
|
161
|
+
See the [CI integration guide](docs/ci-integration.md) for setup and operational details.
|
|
162
|
+
|
|
163
|
+
## Scope, Request Budgets, and Rate Limits
|
|
164
|
+
|
|
165
|
+
Verification scope is the origin, which consists of scheme, host, and port. Redirects are disabled. The batch preflights its cases against `--max-requests` before sending traffic and shares one request budget and rate limiter across the batch. `--rps`, `--timeout`, and `--max-response-size` set trusted caps. Case settings can tighten the applicable limits.
|
|
166
|
+
|
|
167
|
+
Apply network egress controls in sensitive environments. Origin validation leaves DNS-resolved IPs and individual URL paths outside its enforcement.
|
|
168
|
+
|
|
169
|
+
## Discover Inputs for Review
|
|
170
|
+
|
|
171
|
+
Use `vintar discover` to inventory a single local OpenAPI 3.0 or 3.1 spec in JSON or YAML. The report lists operations, declared inputs, held and ignored items, and source pointers. Discovery performs no HTTP requests. It produces review data that is separate from regression case files.
|
|
172
|
+
|
|
173
|
+
Run discovery with your local `openapi.json` to find stable input IDs. To reproduce this example, copy `tests/fixtures/discovery/openapi30.json` to `openapi.json`. Commit `review.toml` with the IDs a reviewer approved. Omit `--selection` to inventory inputs before review.
|
|
174
|
+
|
|
175
|
+
<!-- cli-example: discover-review/selection -->
|
|
176
|
+
```toml
|
|
177
|
+
version = 1
|
|
178
|
+
approved = ["input-24a9c3cf0c3d01709121ac0d09079903"]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
<!-- cli-example: discover-review/command -->
|
|
182
|
+
```bash
|
|
183
|
+
uv run --locked vintar discover \
|
|
184
|
+
--spec openapi.json --selection review.toml --output inventory.json
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`inventory.json` contains the versioned report. Stdout contains one JSON summary and stderr carries diagnostics. Exit codes are `0` for success, `2` for invalid input or output, and `130` for interruption. Choose an output path separate from the spec and selection.
|
|
188
|
+
|
|
189
|
+
<!-- cli-example: discover-review/report -->
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"schema_version": 1,
|
|
193
|
+
"report_type": "discovery_summary",
|
|
194
|
+
"operations": 3,
|
|
195
|
+
"selected": 1
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Export Review Drafts
|
|
200
|
+
|
|
201
|
+
After reviewing `review.toml`, export one draft per approved input. Run from a directory that contains the spec so the draft can record a relative source path.
|
|
202
|
+
|
|
203
|
+
<!-- cli-example: discover-drafts/command -->
|
|
204
|
+
```bash
|
|
205
|
+
uv run --locked vintar discover \
|
|
206
|
+
--spec openapi.json --selection review.toml --drafts-dir drafts
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
<!-- cli-example: discover-drafts/report -->
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"report_type": "discovery_draft_summary",
|
|
213
|
+
"schema_version": 1,
|
|
214
|
+
"drafts": ["case-24a9c3cf0c3d01709121ac0d09079903.draft.toml"]
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Drafts record declared inputs and decisions still needed. Keep them outside your verification case directory. `vintar verify` rejects them and requires reviewed Schema v1 cases. Reruns leave identical drafts in place. If a file conflicts, review it or select a new destination.
|
|
219
|
+
|
|
220
|
+
Draft export requires a filesystem that supports hard links, such as ext4, APFS, or NTFS. Choose another `--drafts-dir` if your current destination is on exFAT or FAT32.
|
|
221
|
+
|
|
222
|
+
### Record Draft Review Decisions
|
|
223
|
+
|
|
224
|
+
Save the reviewer’s decisions in `answers.json`. Each declared query parameter needs an explicit `value`, a local `pointer` to a declared example, default, or single-value enum, or `{"omit": true}` for an optional parameter. Null and compound values are rejected. Explicit pointers may include `value_sha256` to detect changed values during re-review. The digest uses compact ASCII-escaped JSON with sorted keys. Choose the expected verdict explicitly.
|
|
225
|
+
|
|
226
|
+
<!-- cli-example: draft-review/answers -->
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"version": 1,
|
|
230
|
+
"expected_verdict": "not_detected",
|
|
231
|
+
"parameters": {"q": {"value": "fixture-baseline"}}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
<!-- cli-example: draft-review/command -->
|
|
236
|
+
```bash
|
|
237
|
+
uv run --locked vintar review-draft \
|
|
238
|
+
--spec openapi.json --draft drafts/case-24a9c3cf0c3d01709121ac0d09079903.draft.toml \
|
|
239
|
+
--answers answers.json --output review.json
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
<!-- cli-example: draft-review/report -->
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"schema_version": 1,
|
|
246
|
+
"report_type": "discovery_draft_review_summary"
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The offline report records evidence, omission decisions, and value digests. It contains no raw baseline values. `vintar verify` requires a separately reviewed Schema v1 TOML case. Reruns preserve identical output and refuse to replace conflicting files. The output filesystem must support hard links.
|
|
251
|
+
|
|
252
|
+
### Materialize a Reviewed Case
|
|
253
|
+
|
|
254
|
+
Create an explicit target config for the reviewed input. The target URL is the route that verification will call; it may include a proxy prefix or fixture route and is not inferred from the OpenAPI path. Origins, injection behavior, limits, security expectations, and probe selection are never guessed. Headers, cookies, and credentials are not accepted in this config.
|
|
255
|
+
|
|
256
|
+
<!-- cli-example: materialize-case/config -->
|
|
257
|
+
```toml
|
|
258
|
+
config_version = 1
|
|
259
|
+
input_id = "input-24a9c3cf0c3d01709121ac0d09079903"
|
|
260
|
+
|
|
261
|
+
[target]
|
|
262
|
+
url = "http://cli-fixture.invalid/fixture-route"
|
|
263
|
+
allowed_origin = "http://cli-fixture.invalid"
|
|
264
|
+
|
|
265
|
+
[injection]
|
|
266
|
+
location = "query"
|
|
267
|
+
name = "q"
|
|
268
|
+
occurrence = 0
|
|
269
|
+
mode = "append"
|
|
270
|
+
|
|
271
|
+
[probes]
|
|
272
|
+
selection = "explicit"
|
|
273
|
+
true_payload = "true-probe"
|
|
274
|
+
false_payload = "false-probe"
|
|
275
|
+
|
|
276
|
+
[limits]
|
|
277
|
+
max_requests = 6
|
|
278
|
+
requests_per_second = 10.0
|
|
279
|
+
timeout_seconds = 5.0
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
<!-- cli-example: materialize-case/command -->
|
|
283
|
+
```bash
|
|
284
|
+
uv run --locked vintar materialize-case \
|
|
285
|
+
--spec openapi.json --draft drafts/case-24a9c3cf0c3d01709121ac0d09079903.draft.toml \
|
|
286
|
+
--answers answers.json --review review.json --config case-config.toml \
|
|
287
|
+
--output security/cases/case-24a9c3cf0c3d01709121ac0d09079903.toml
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
<!-- cli-example: materialize-case/report -->
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"case_id": "case-24a9c3cf0c3d01709121ac0d09079903",
|
|
294
|
+
"report_type": "regression_case_materialization_summary",
|
|
295
|
+
"schema_version": 1
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Materialization is offline. It regenerates the draft and review decisions from the current spec and answers, verifies the supplied review report including value SHA-256 digests, and validates the generated TOML with the Schema v1 loader. The case ID comes from the regenerated draft. Optional parameters answered with `{"omit": true}` are absent from `target.params`; an explicit empty string remains `value = ""`. Strings are preserved exactly, while booleans, integers, and finite floats use compact canonical JSON scalar text (`true`, `17`, or `1.25`).
|
|
300
|
+
|
|
301
|
+
The generated case contains the reviewed raw parameter values and explicit probe payloads, so treat it as sensitive review material. Rerunning with byte-identical content is a no-op. Existing conflicting output is preserved, and publishing requires a hard-link-capable filesystem.
|
|
302
|
+
|
|
303
|
+
Instead of supplying explicit payloads, a reviewer may select one reviewed Boolean probe preset:
|
|
304
|
+
|
|
305
|
+
```toml
|
|
306
|
+
[probes]
|
|
307
|
+
selection = "preset"
|
|
308
|
+
preset = "string-quoted"
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The supported presets are `string-quoted` and `numeric`. Materialization expands
|
|
312
|
+
the selected pair into the Schema v1 case. The reviewer must explicitly choose a
|
|
313
|
+
preset for the downstream SQL context. An OpenAPI integer type alone cannot
|
|
314
|
+
establish that context.
|
|
315
|
+
|
|
316
|
+
## Other CLI Commands
|
|
317
|
+
|
|
318
|
+
- `vintar --help` lists commands, and `vintar version` prints the current project version.
|
|
319
|
+
- `vintar http send` inspects a GET or POST response and prints text. It accepts `--body`, `--header`, `--cookie`, repeatable `--param`, and `--timeout`. The response body limit for this command is 1 MiB.
|
|
320
|
+
- `vintar sqli verify` runs a single bounded Boolean check and exits `0` whenever it emits a report, including an `inconclusive` verdict. Use `verify` for a batch gate that distinguishes PASS, FAIL, and INCONCLUSIVE.
|
|
321
|
+
|
|
322
|
+
For the same authorized test fixture, a single-check invocation looks like this.
|
|
323
|
+
|
|
324
|
+
<!-- cli-example: sqli-normal/command -->
|
|
325
|
+
```bash
|
|
326
|
+
uv run --locked vintar sqli verify \
|
|
327
|
+
--url https://staging.example.com/ok --allow-origin https://staging.example.com \
|
|
328
|
+
--param category=Pets --inject-param category --append \
|
|
329
|
+
--true-payload true-probe --false-payload false-probe \
|
|
330
|
+
--authorized
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
<!-- cli-example: sqli-normal/report -->
|
|
334
|
+
```json
|
|
335
|
+
{
|
|
336
|
+
"schema_version": 1,
|
|
337
|
+
"check_type": "sqli_boolean",
|
|
338
|
+
"verdict": "not_detected",
|
|
339
|
+
"reason_code": "no_boolean_difference",
|
|
340
|
+
"request_count": 6
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Current Limitations
|
|
345
|
+
|
|
346
|
+
- Non-SQL middleware can mimic a Boolean response differential. The
|
|
347
|
+
`waf200_mimic` fixture demonstrates a false candidate. Vintar does not claim
|
|
348
|
+
zero false candidates across environments.
|
|
349
|
+
- Matched live loopback evaluation covers ephemeral SQLite twins using the
|
|
350
|
+
corresponding `string-quoted` and `numeric` presets. The observed candidate
|
|
351
|
+
counts were **TP=2, TN=2, FP=0, FN=0** for those fixtures. PostgreSQL and MySQL
|
|
352
|
+
integration tests are opt-in and do not run in default CI.
|
|
353
|
+
- Schema v1 uses placeholder origins. Verification binds the case to the trusted runtime origin.
|
|
354
|
+
- The batch engine has per-request timeouts. The staging workflow supplies the job-level timeout.
|
|
355
|
+
- Schema validation checks the report. Case definitions still require trusted review.
|
|
356
|
+
|
|
357
|
+
## Development and Golden Tests
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
uv run pytest
|
|
361
|
+
uv run ruff check
|
|
362
|
+
uv run ruff format --check
|
|
363
|
+
uv run lint-imports
|
|
364
|
+
uv run python scripts/check_architecture.py
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
The CLI golden tests use deterministic fixtures. After an intentional output change, run `uv run python scripts/update_cli_goldens.py --write` and review the resulting diff. The README examples are checked against the same goldens by pytest.
|
|
368
|
+
|
|
369
|
+
On Linux x86-64, run `uv run python scripts/scan_git_history.py` from a full Git checkout to scan committed secrets. The first run downloads the pinned Gitleaks archive from GitHub. Later scans and pytest reuse the cached archive and verify its SHA-256 before each use. CI warms the same cache in the scan step before pytest. A download or verification failure fails the scan and its tests.
|
|
370
|
+
|
|
371
|
+
See the [security policy](https://github.com/natori-hrj/vintar/blob/main/SECURITY.md) to report a vulnerability privately.
|
|
372
|
+
|
|
373
|
+
## License
|
|
374
|
+
|
|
375
|
+
Vintar is licensed under the [Apache License, Version 2.0](LICENSE).
|