perun.proxy.utils 3.3.0__tar.gz → 3.4.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.
Files changed (38) hide show
  1. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/PKG-INFO +120 -4
  2. perun_proxy_utils-3.3.0/perun_proxy_utils.egg-info/PKG-INFO → perun_proxy_utils-3.4.0/README.md +92 -12
  3. perun_proxy_utils-3.4.0/perun/proxy/utils/export_saml_metadata.py +974 -0
  4. perun_proxy_utils-3.3.0/README.md → perun_proxy_utils-3.4.0/perun_proxy_utils.egg-info/PKG-INFO +128 -0
  5. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun_proxy_utils.egg-info/SOURCES.txt +1 -0
  6. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun_proxy_utils.egg-info/entry_points.txt +1 -0
  7. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/setup.cfg +1 -1
  8. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/setup.py +1 -0
  9. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/LICENSE +0 -0
  10. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/__init__.py +0 -0
  11. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/metadata_expiration.py +0 -0
  12. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/__init__.py +0 -0
  13. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_custom_command.py +0 -0
  14. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_dockers.py +0 -0
  15. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_exabgp_propagation.py +0 -0
  16. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_ldap.py +0 -0
  17. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_ldap_syncrepl.py +0 -0
  18. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_mongodb.py +0 -0
  19. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_nginx.py +0 -0
  20. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_oidc_login.py +0 -0
  21. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_oidc_rp.py +0 -0
  22. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_pgsql.py +0 -0
  23. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_php_syntax.py +0 -0
  24. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_privacyidea.py +0 -0
  25. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_rpc_status.py +0 -0
  26. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_saml.py +0 -0
  27. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/check_user_logins.py +0 -0
  28. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/nagios/webserver_availability.py +0 -0
  29. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/oracle2postgresql.py +0 -0
  30. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/print_docker_versions.py +0 -0
  31. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/run_probes.py +0 -0
  32. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/run_version_script.py +0 -0
  33. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/separate_oidc_logs.py +0 -0
  34. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/separate_ssp_logs.py +0 -0
  35. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun/proxy/utils/sync_usable_token_types.py +0 -0
  36. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun_proxy_utils.egg-info/dependency_links.txt +0 -0
  37. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun_proxy_utils.egg-info/requires.txt +0 -0
  38. {perun_proxy_utils-3.3.0 → perun_proxy_utils-3.4.0}/perun_proxy_utils.egg-info/top_level.txt +0 -0
@@ -1,14 +1,38 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: perun_proxy_utils
3
- Version: 3.3.0
3
+ Version: 3.4.0
4
4
  Summary: Utilities and monitoring probes for Perun ProxyIdP
5
5
  Home-page: https://gitlab.ics.muni.cz/perun/perun-proxyidp/perun-proxy-utils.git
6
6
  Requires-Python: >=3.9
7
7
  Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: setuptools
10
+ Requires-Dist: pymongo~=4.3
11
+ Requires-Dist: asyncssh~=2.13
12
+ Requires-Dist: docker~=7.1
13
+ Requires-Dist: beautifulsoup4~=4.12
14
+ Requires-Dist: requests~=2.31
15
+ Requires-Dist: PyYAML<7.0,>=5.4
16
+ Requires-Dist: check_nginx_status~=1.0
17
+ Requires-Dist: pyotp~=2.9
18
+ Requires-Dist: perun.connector~=3.8
19
+ Requires-Dist: privacyidea~=3.9
20
+ Requires-Dist: flask~=1.1
21
+ Requires-Dist: idpyoidc~=2.1
22
+ Requires-Dist: sqlalchemy~=1.4
8
23
  Provides-Extra: ldap
9
- Provides-Extra: oracle
24
+ Requires-Dist: check_syncrepl_extended~=2020.13; extra == "ldap"
25
+ Requires-Dist: ldap3~=2.9.1; extra == "ldap"
10
26
  Provides-Extra: postgresql
11
- License-File: LICENSE
27
+ Requires-Dist: psycopg2-binary~=2.9; extra == "postgresql"
28
+ Provides-Extra: oracle
29
+ Requires-Dist: cx-Oracle~=8.3; extra == "oracle"
30
+ Dynamic: home-page
31
+ Dynamic: license-file
32
+ Dynamic: provides-extra
33
+ Dynamic: requires-dist
34
+ Dynamic: requires-python
35
+ Dynamic: summary
12
36
 
13
37
  # Perun proxy utils
14
38
 
@@ -126,6 +150,98 @@ python3 sync_usable_token_types.py
126
150
  --perun-connector-config-path "/path/to/file"
127
151
  ```
128
152
 
153
+ ### export_saml_metadata.py
154
+
155
+ Exports SAML 2.0 entity metadata for facilities whose `isSamlFacility` attribute is set,
156
+ one XML file per facility, using the configuration supplied with `-c`:
157
+
158
+ ```sh
159
+ export_saml_metadata -c /etc/perun-proxy-utils/export_saml_metadata_cfg.yaml
160
+ ```
161
+
162
+ The script's `SAML_FIELDS` map defines which Perun facility attribute supplies each metadata
163
+ field. The configuration selects the fields to export, the output directory, the Perun
164
+ credentials, and how schema-invalid entities should be handled:
165
+
166
+ ```yaml
167
+ output_dir: "/etc/perun-proxy-utils/saml_metadata"
168
+ schema_policy: "skip"
169
+ attribute_names:
170
+ uid: "urn:oid:0.9.2342.19200300.100.1.1"
171
+ displayName: "urn:oid:2.16.840.1.113730.3.1.241"
172
+ fields:
173
+ entity_id:
174
+ assertion_consumer_service:
175
+ service_name:
176
+ ```
177
+
178
+ Each facility is written to its own file in the output directory, named after the facility
179
+ with characters unsafe for the file system replaced by underscores.
180
+
181
+ `schema_policy` controls what happens when the generated entity would violate a known SAML
182
+ metadata schema requirement:
183
+
184
+ * `skip` omits the affected entity from the generated metadata and reports the reason in
185
+ the log.
186
+ * `keep` keeps the entity in the generated metadata and reports the problem as a warning.
187
+
188
+ The default is `skip`.
189
+
190
+ `attribute_names` optionally maps the names of `required_attributes` to SAML attribute
191
+ URIs in `md:RequestedAttribute`. Names are matched case-insensitively, either in full
192
+ or as the part after the last `:` (so `core:uid` matches the `uid` entry); names
193
+ without an entry are written as-is. The configuration template ends with a ready-made
194
+ map based on SimpleSAMLphp's `name2oid`.
195
+
196
+ Fields may also be specified as a list or as a space-separated string:
197
+
198
+ ```yaml
199
+ fields: [entity_id, assertion_consumer_service, service_name]
200
+ fields: "entity_id assertion_consumer_service service_name"
201
+ ```
202
+
203
+ By default, each field reads the attribute defined by `SAML_FIELDS`. A field can override
204
+ the attribute with `attr`, or select an endpoint binding with `binding`:
205
+
206
+ ```yaml
207
+ fields:
208
+ entity_id:
209
+ service_name:
210
+ attr: "def:displayName"
211
+ assertion_consumer_service:
212
+ binding: "post"
213
+ required_attributes:
214
+ ```
215
+
216
+ Attributes must be named as `<definition-type>:<friendly-name>`, for example
217
+ `def:displayName`, `virt:identification`, or `opt:notificationFrom`. Valid definition types
218
+ are `core`, `opt`, `virt`, and `def`. The script prepends
219
+ `urn:perun:facility:attribute-def:`; full URNs are therefore not used in the configuration.
220
+ Invalid or unknown attribute names, options, and bindings produce warnings and are ignored.
221
+
222
+ Missing field values omit that field from the generated entity. Otherwise, values are
223
+ exported as follows:
224
+
225
+ * Multilingual text is exported only for `en` and `cs`; other languages produce warnings.
226
+ Text without a language is treated as English.
227
+ * Endpoint fields produce one element per SAML binding. A configured `binding` overrides
228
+ the binding supplied by the endpoint attribute. The first assertion consumer service is
229
+ marked `isDefault`.
230
+ * Certificates are normalized to their base64 body, regardless of whether they are supplied
231
+ as PEM-style lines, a single line, or a JSON list from a multi-valued attribute.
232
+ * Known schema-invalid values or structures produce warnings. With `schema_policy: skip`,
233
+ the affected entity is omitted; with `schema_policy: keep`, it remains in the metadata.
234
+ This includes problems such as invalid certificates, invalid URLs, missing required
235
+ `AssertionConsumerService` elements, incomplete `AttributeConsumingService` blocks, and
236
+ incomplete organizations.
237
+ * Facilities without an `entityID` are not exported because their entity would have no name;
238
+ they are reported once after the export.
239
+
240
+ All selected facilities and their requested attributes are fetched in a single
241
+ `getFacilitiesByAttributeWithAttributes` call. Invalid Perun credentials stop the export
242
+ immediately because no metadata can be read.
243
+
244
+
129
245
  ### oracle2postgresql.py
130
246
  Synchronizes data from Oracle db to PostgreSQL db.
131
247
 
@@ -1,15 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: perun-proxy-utils
3
- Version: 3.3.0
4
- Summary: Utilities and monitoring probes for Perun ProxyIdP
5
- Home-page: https://gitlab.ics.muni.cz/perun/perun-proxyidp/perun-proxy-utils.git
6
- Requires-Python: >=3.9
7
- Description-Content-Type: text/markdown
8
- Provides-Extra: ldap
9
- Provides-Extra: oracle
10
- Provides-Extra: postgresql
11
- License-File: LICENSE
12
-
13
1
  # Perun proxy utils
14
2
 
15
3
  Scripts and monitoring probes related to Perun ProxyIdP.
@@ -126,6 +114,98 @@ python3 sync_usable_token_types.py
126
114
  --perun-connector-config-path "/path/to/file"
127
115
  ```
128
116
 
117
+ ### export_saml_metadata.py
118
+
119
+ Exports SAML 2.0 entity metadata for facilities whose `isSamlFacility` attribute is set,
120
+ one XML file per facility, using the configuration supplied with `-c`:
121
+
122
+ ```sh
123
+ export_saml_metadata -c /etc/perun-proxy-utils/export_saml_metadata_cfg.yaml
124
+ ```
125
+
126
+ The script's `SAML_FIELDS` map defines which Perun facility attribute supplies each metadata
127
+ field. The configuration selects the fields to export, the output directory, the Perun
128
+ credentials, and how schema-invalid entities should be handled:
129
+
130
+ ```yaml
131
+ output_dir: "/etc/perun-proxy-utils/saml_metadata"
132
+ schema_policy: "skip"
133
+ attribute_names:
134
+ uid: "urn:oid:0.9.2342.19200300.100.1.1"
135
+ displayName: "urn:oid:2.16.840.1.113730.3.1.241"
136
+ fields:
137
+ entity_id:
138
+ assertion_consumer_service:
139
+ service_name:
140
+ ```
141
+
142
+ Each facility is written to its own file in the output directory, named after the facility
143
+ with characters unsafe for the file system replaced by underscores.
144
+
145
+ `schema_policy` controls what happens when the generated entity would violate a known SAML
146
+ metadata schema requirement:
147
+
148
+ * `skip` omits the affected entity from the generated metadata and reports the reason in
149
+ the log.
150
+ * `keep` keeps the entity in the generated metadata and reports the problem as a warning.
151
+
152
+ The default is `skip`.
153
+
154
+ `attribute_names` optionally maps the names of `required_attributes` to SAML attribute
155
+ URIs in `md:RequestedAttribute`. Names are matched case-insensitively, either in full
156
+ or as the part after the last `:` (so `core:uid` matches the `uid` entry); names
157
+ without an entry are written as-is. The configuration template ends with a ready-made
158
+ map based on SimpleSAMLphp's `name2oid`.
159
+
160
+ Fields may also be specified as a list or as a space-separated string:
161
+
162
+ ```yaml
163
+ fields: [entity_id, assertion_consumer_service, service_name]
164
+ fields: "entity_id assertion_consumer_service service_name"
165
+ ```
166
+
167
+ By default, each field reads the attribute defined by `SAML_FIELDS`. A field can override
168
+ the attribute with `attr`, or select an endpoint binding with `binding`:
169
+
170
+ ```yaml
171
+ fields:
172
+ entity_id:
173
+ service_name:
174
+ attr: "def:displayName"
175
+ assertion_consumer_service:
176
+ binding: "post"
177
+ required_attributes:
178
+ ```
179
+
180
+ Attributes must be named as `<definition-type>:<friendly-name>`, for example
181
+ `def:displayName`, `virt:identification`, or `opt:notificationFrom`. Valid definition types
182
+ are `core`, `opt`, `virt`, and `def`. The script prepends
183
+ `urn:perun:facility:attribute-def:`; full URNs are therefore not used in the configuration.
184
+ Invalid or unknown attribute names, options, and bindings produce warnings and are ignored.
185
+
186
+ Missing field values omit that field from the generated entity. Otherwise, values are
187
+ exported as follows:
188
+
189
+ * Multilingual text is exported only for `en` and `cs`; other languages produce warnings.
190
+ Text without a language is treated as English.
191
+ * Endpoint fields produce one element per SAML binding. A configured `binding` overrides
192
+ the binding supplied by the endpoint attribute. The first assertion consumer service is
193
+ marked `isDefault`.
194
+ * Certificates are normalized to their base64 body, regardless of whether they are supplied
195
+ as PEM-style lines, a single line, or a JSON list from a multi-valued attribute.
196
+ * Known schema-invalid values or structures produce warnings. With `schema_policy: skip`,
197
+ the affected entity is omitted; with `schema_policy: keep`, it remains in the metadata.
198
+ This includes problems such as invalid certificates, invalid URLs, missing required
199
+ `AssertionConsumerService` elements, incomplete `AttributeConsumingService` blocks, and
200
+ incomplete organizations.
201
+ * Facilities without an `entityID` are not exported because their entity would have no name;
202
+ they are reported once after the export.
203
+
204
+ All selected facilities and their requested attributes are fetched in a single
205
+ `getFacilitiesByAttributeWithAttributes` call. Invalid Perun credentials stop the export
206
+ immediately because no metadata can be read.
207
+
208
+
129
209
  ### oracle2postgresql.py
130
210
  Synchronizes data from Oracle db to PostgreSQL db.
131
211