pyannotators-patterns 0.6.11__tar.gz → 0.6.15__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.
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/.gitignore +5 -1
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/Jenkinsfile +70 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/PKG-INFO +1 -1
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/src/pyannotators_patterns/__init__.py +1 -1
- pyannotators_patterns-0.6.15/trivy-html-template.tpl +148 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/.bumpversion.cfg +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/.github/workflows/main.yml +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/.pre-commit-config.yaml +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/.readthedocs.yml +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/AUTHORS.md +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/CHANGELOG.md +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/Dockerfile +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/LICENSE +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/MIGRATION.md +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/README.md +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/RELEASE.md +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/bumpversion.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/docs/.gitignore +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/docs/CHANGELOG.md +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/docs/LICENSE +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/docs/_static/.gitkeep +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/docs/_templates/.gitkeep +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/docs/conf.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/docs/index.rst +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/mypy.ini +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/pyproject.toml +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/src/pyannotators_patterns/named_pattern_recognizer.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/src/pyannotators_patterns/patterns.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/assertions.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/data/coords-document.json +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/data/coords.json +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/data/mgrs-document.json +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/data/mgrs.json +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/data/tel-document.json +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/data/tel.json +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/test_annotator.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/test_coords.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/test_credit_cards.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/test_emails.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/test_mgrs.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/test_tel.py +0 -0
- {pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/test_zip.py +0 -0
|
@@ -106,6 +106,7 @@ pipeline {
|
|
|
106
106
|
stages {
|
|
107
107
|
stage('Install dependencies') {
|
|
108
108
|
steps {
|
|
109
|
+
sh 'rm -f uv.lock'
|
|
109
110
|
sh 'pip install uv'
|
|
110
111
|
sh 'uv sync --no-cache --extra test'
|
|
111
112
|
}
|
|
@@ -155,6 +156,75 @@ pipeline {
|
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}
|
|
159
|
+
|
|
160
|
+
stage('Prepare SBOM') {
|
|
161
|
+
when {
|
|
162
|
+
beforeAgent true
|
|
163
|
+
environment name: 'SKIP_JOB', value: '0'
|
|
164
|
+
}
|
|
165
|
+
options {
|
|
166
|
+
timeout(time: 120, unit: 'SECONDS')
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
agent {
|
|
170
|
+
docker {
|
|
171
|
+
image 'alpine:3.19'
|
|
172
|
+
label 'built-in'
|
|
173
|
+
customWorkspace "${PATH_HOME}/${JOB_NAME}"
|
|
174
|
+
args "-u 0"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
stages {
|
|
179
|
+
stage('Generate SBOM') {
|
|
180
|
+
steps {
|
|
181
|
+
sh '''
|
|
182
|
+
apk add --no-cache curl
|
|
183
|
+
|
|
184
|
+
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b . v${SYFT_VERSION}
|
|
185
|
+
|
|
186
|
+
./syft . \
|
|
187
|
+
--exclude '**/syft' \
|
|
188
|
+
--exclude '**/.pytest_cache' \
|
|
189
|
+
--exclude '**/.ruff_cache' \
|
|
190
|
+
--exclude '**/sbom.cdx.json' \
|
|
191
|
+
--exclude '**/sbom.spdx.json' \
|
|
192
|
+
--source-name "${JOB_NAME}" \
|
|
193
|
+
--source-version "${BUILD_NUMBER}" \
|
|
194
|
+
-o cyclonedx-json=sbom.cdx.json \
|
|
195
|
+
-o spdx-json=sbom.spdx.json
|
|
196
|
+
|
|
197
|
+
rm -f ./syft
|
|
198
|
+
'''
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
stage('Analyse SBOM') {
|
|
203
|
+
steps {
|
|
204
|
+
sh '''
|
|
205
|
+
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b . v${TRIVY_VERSION}
|
|
206
|
+
curl -L https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/html.tpl -o trivy-html-template.tpl
|
|
207
|
+
|
|
208
|
+
./trivy sbom --download-db-only
|
|
209
|
+
|
|
210
|
+
./trivy sbom sbom.cdx.json \
|
|
211
|
+
--skip-db-update \
|
|
212
|
+
--format template \
|
|
213
|
+
--template "@trivy-html-template.tpl" \
|
|
214
|
+
-o trivy-report.html
|
|
215
|
+
|
|
216
|
+
rm -f ./trivy
|
|
217
|
+
'''
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
stage('Archive SBOM & analysis') {
|
|
222
|
+
steps {
|
|
223
|
+
archiveArtifacts artifacts: 'sbom*.json, trivy*.html', fingerprint: true
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
158
228
|
}
|
|
159
229
|
|
|
160
230
|
post {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyannotators-patterns
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.15
|
|
4
4
|
Summary: Annotator based on Presidio pattern recognizer
|
|
5
5
|
Project-URL: Homepage, https://github.com/oterrier/pyannotators_patterns/
|
|
6
6
|
Author-email: Olivier Terrier <olivier.terrier@kairntech.com>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
5
|
+
{{- if . }}
|
|
6
|
+
<style>
|
|
7
|
+
* {
|
|
8
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
9
|
+
}
|
|
10
|
+
h1 {
|
|
11
|
+
text-align: center;
|
|
12
|
+
}
|
|
13
|
+
.group-header th {
|
|
14
|
+
font-size: 200%;
|
|
15
|
+
}
|
|
16
|
+
.sub-header th {
|
|
17
|
+
font-size: 150%;
|
|
18
|
+
}
|
|
19
|
+
table, th, td {
|
|
20
|
+
border: 1px solid black;
|
|
21
|
+
border-collapse: collapse;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
padding: .3em;
|
|
24
|
+
}
|
|
25
|
+
table {
|
|
26
|
+
margin: 0 auto;
|
|
27
|
+
}
|
|
28
|
+
.severity {
|
|
29
|
+
text-align: center;
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
color: #fafafa;
|
|
32
|
+
}
|
|
33
|
+
.severity-LOW .severity { background-color: #5fbb31; }
|
|
34
|
+
.severity-MEDIUM .severity { background-color: #e9c600; }
|
|
35
|
+
.severity-HIGH .severity { background-color: #ff8800; }
|
|
36
|
+
.severity-CRITICAL .severity { background-color: #e40000; }
|
|
37
|
+
.severity-UNKNOWN .severity { background-color: #747474; }
|
|
38
|
+
.severity-LOW { background-color: #5fbb3160; }
|
|
39
|
+
.severity-MEDIUM { background-color: #e9c60060; }
|
|
40
|
+
.severity-HIGH { background-color: #ff880060; }
|
|
41
|
+
.severity-CRITICAL { background-color: #e4000060; }
|
|
42
|
+
.severity-UNKNOWN { background-color: #74747460; }
|
|
43
|
+
table tr td:first-of-type {
|
|
44
|
+
font-weight: bold;
|
|
45
|
+
}
|
|
46
|
+
.links a,
|
|
47
|
+
.links[data-more-links=on] a {
|
|
48
|
+
display: block;
|
|
49
|
+
}
|
|
50
|
+
.links[data-more-links=off] a:nth-of-type(1n+5) {
|
|
51
|
+
display: none;
|
|
52
|
+
}
|
|
53
|
+
a.toggle-more-links { cursor: pointer; }
|
|
54
|
+
</style>
|
|
55
|
+
<title>{{- escapeXML ( index . 0 ).Target }} - Trivy Report - {{ now }} </title>
|
|
56
|
+
<script>
|
|
57
|
+
window.onload = function() {
|
|
58
|
+
document.querySelectorAll('td.links').forEach(function(linkCell) {
|
|
59
|
+
var links = [].concat.apply([], linkCell.querySelectorAll('a'));
|
|
60
|
+
[].sort.apply(links, function(a, b) {
|
|
61
|
+
return a.href > b.href ? 1 : -1;
|
|
62
|
+
});
|
|
63
|
+
links.forEach(function(link, idx) {
|
|
64
|
+
if (links.length > 3 && 3 === idx) {
|
|
65
|
+
var toggleLink = document.createElement('a');
|
|
66
|
+
toggleLink.innerText = "Toggle more links";
|
|
67
|
+
toggleLink.href = "#toggleMore";
|
|
68
|
+
toggleLink.setAttribute("class", "toggle-more-links");
|
|
69
|
+
linkCell.appendChild(toggleLink);
|
|
70
|
+
}
|
|
71
|
+
linkCell.appendChild(link);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
document.querySelectorAll('a.toggle-more-links').forEach(function(toggleLink) {
|
|
75
|
+
toggleLink.onclick = function() {
|
|
76
|
+
var expanded = toggleLink.parentElement.getAttribute("data-more-links");
|
|
77
|
+
toggleLink.parentElement.setAttribute("data-more-links", "on" === expanded ? "off" : "on");
|
|
78
|
+
return false;
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
</script>
|
|
83
|
+
</head>
|
|
84
|
+
<body>
|
|
85
|
+
<h1>{{- escapeXML ( index . 0 ).Target }} - Trivy Report - {{ now }}</h1>
|
|
86
|
+
<table>
|
|
87
|
+
{{- range . }}
|
|
88
|
+
<tr class="group-header"><th colspan="6">{{ .Type | toString | escapeXML }}</th></tr>
|
|
89
|
+
{{- if (eq (len .Vulnerabilities) 0) }}
|
|
90
|
+
<tr><th colspan="6">No Vulnerabilities found</th></tr>
|
|
91
|
+
{{- else }}
|
|
92
|
+
<tr class="sub-header">
|
|
93
|
+
<th>Package</th>
|
|
94
|
+
<th>Vulnerability ID</th>
|
|
95
|
+
<th>Severity</th>
|
|
96
|
+
<th>Installed Version</th>
|
|
97
|
+
<th>Fixed Version</th>
|
|
98
|
+
<th>Links</th>
|
|
99
|
+
</tr>
|
|
100
|
+
{{- range .Vulnerabilities }}
|
|
101
|
+
<tr class="severity-{{ escapeXML .Vulnerability.Severity }}">
|
|
102
|
+
<td class="pkg-name">{{ escapeXML .PkgName }}</td>
|
|
103
|
+
<td>{{ escapeXML .VulnerabilityID }}</td>
|
|
104
|
+
<td class="severity">{{ escapeXML .Vulnerability.Severity }}</td>
|
|
105
|
+
<td class="pkg-version">{{ escapeXML .InstalledVersion }}</td>
|
|
106
|
+
<td>{{ escapeXML .FixedVersion }}</td>
|
|
107
|
+
<td class="links" data-more-links="off">
|
|
108
|
+
{{- range .Vulnerability.References }}
|
|
109
|
+
<a href={{ escapeXML . | printf "%q" }}>{{ escapeXML . }}</a>
|
|
110
|
+
{{- end }}
|
|
111
|
+
</td>
|
|
112
|
+
</tr>
|
|
113
|
+
{{- end }}
|
|
114
|
+
{{- end }}
|
|
115
|
+
{{- if (eq (len .Misconfigurations ) 0) }}
|
|
116
|
+
<tr><th colspan="6">No Misconfigurations found</th></tr>
|
|
117
|
+
{{- else }}
|
|
118
|
+
<tr class="sub-header">
|
|
119
|
+
<th>Type</th>
|
|
120
|
+
<th>Misconf ID</th>
|
|
121
|
+
<th>Check</th>
|
|
122
|
+
<th>Severity</th>
|
|
123
|
+
<th>Message</th>
|
|
124
|
+
</tr>
|
|
125
|
+
{{- range .Misconfigurations }}
|
|
126
|
+
<tr class="severity-{{ escapeXML .Severity }}">
|
|
127
|
+
<td class="misconf-type">{{ escapeXML .Type }}</td>
|
|
128
|
+
<td>{{ escapeXML .ID }}</td>
|
|
129
|
+
<td class="misconf-check">{{ escapeXML .Title }}</td>
|
|
130
|
+
<td class="severity">{{ escapeXML .Severity }}</td>
|
|
131
|
+
<td class="link" data-more-links="off" style="white-space:normal;">
|
|
132
|
+
{{ escapeXML .Message }}
|
|
133
|
+
<br>
|
|
134
|
+
<a href={{ escapeXML .PrimaryURL | printf "%q" }}>{{ escapeXML .PrimaryURL }}</a>
|
|
135
|
+
</br>
|
|
136
|
+
</td>
|
|
137
|
+
</tr>
|
|
138
|
+
{{- end }}
|
|
139
|
+
{{- end }}
|
|
140
|
+
{{- end }}
|
|
141
|
+
</table>
|
|
142
|
+
{{- else }}
|
|
143
|
+
</head>
|
|
144
|
+
<body>
|
|
145
|
+
<h1>Trivy Returned Empty Report</h1>
|
|
146
|
+
{{- end }}
|
|
147
|
+
</body>
|
|
148
|
+
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/src/pyannotators_patterns/patterns.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyannotators_patterns-0.6.11 → pyannotators_patterns-0.6.15}/tests/data/coords-document.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|