perun.proxy.utils 1.11.0__tar.gz → 2.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.
Files changed (36) hide show
  1. perun.proxy.utils-2.1.0/PKG-INFO +212 -0
  2. perun.proxy.utils-2.1.0/README.md +189 -0
  3. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_saml.py +22 -6
  4. perun.proxy.utils-2.1.0/perun.proxy.utils.egg-info/PKG-INFO +212 -0
  5. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun.proxy.utils.egg-info/entry_points.txt +2 -2
  6. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/setup.cfg +1 -1
  7. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/setup.py +2 -2
  8. perun.proxy.utils-1.11.0/PKG-INFO +0 -143
  9. perun.proxy.utils-1.11.0/README.md +0 -131
  10. perun.proxy.utils-1.11.0/perun.proxy.utils.egg-info/PKG-INFO +0 -143
  11. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/LICENSE +0 -0
  12. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/__init__.py +0 -0
  13. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/metadata_expiration.py +0 -0
  14. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/__init__.py +0 -0
  15. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_custom_command.py +0 -0
  16. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_dockers.py +0 -0
  17. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_exabgp_propagation.py +0 -0
  18. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_ldap.py +0 -0
  19. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_ldap_syncrepl.py +0 -0
  20. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_mongodb.py +0 -0
  21. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_nginx.py +0 -0
  22. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_pgsql.py +0 -0
  23. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_php_syntax.py +0 -0
  24. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_privacyidea.py +0 -0
  25. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_rpc_status.py +0 -0
  26. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/check_user_logins.py +0 -0
  27. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/nagios/webserver_availability.py +0 -0
  28. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/print_docker_versions.py +0 -0
  29. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/run_probes.py +0 -0
  30. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/run_version_script.py +0 -0
  31. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/separate_oidc_logs.py +0 -0
  32. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun/proxy/utils/separate_ssp_logs.py +0 -0
  33. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun.proxy.utils.egg-info/SOURCES.txt +0 -0
  34. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun.proxy.utils.egg-info/dependency_links.txt +0 -0
  35. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun.proxy.utils.egg-info/requires.txt +6 -6
  36. {perun.proxy.utils-1.11.0 → perun.proxy.utils-2.1.0}/perun.proxy.utils.egg-info/top_level.txt +0 -0
@@ -0,0 +1,212 @@
1
+ Metadata-Version: 2.1
2
+ Name: perun.proxy.utils
3
+ Version: 2.1.0
4
+ Summary: Module with utilities and monitoring probes
5
+ Home-page: https://gitlab.ics.muni.cz/perun-proxy-aai/proxyidp-scripts.git
6
+ Requires-Python: >=3.9
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~=6.0
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
+ Provides-Extra: ldap
19
+ Requires-Dist: ldap3~=2.9.1; extra == "ldap"
20
+ Requires-Dist: check_syncrepl_extended~=2020.13; extra == "ldap"
21
+ Provides-Extra: postgresql
22
+ Requires-Dist: psycopg2-binary~=2.9; extra == "postgresql"
23
+
24
+ # Perun proxy utils
25
+
26
+ Scripts and monitoring probes related to Perun ProxyIdP.
27
+
28
+ ## Installation
29
+
30
+ Install via pip:
31
+
32
+ ```sh
33
+ pip install perun.proxy.utils
34
+ ```
35
+
36
+ There are several extras which are required only for some scripts:
37
+
38
+ - `[ldap]` for check_ldap and check_ldap_syncrepl
39
+ - this also requires
40
+ installing [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)
41
+ - `[postgresql]` for check_pgsql
42
+
43
+ ## Scripts
44
+
45
+ ### run_probes
46
+
47
+ - script designed to execute multiple monitoring probes
48
+ - output is compatible with CheckMK
49
+ - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
50
+
51
+ For usage instructions, run:
52
+
53
+ ```sh
54
+ run_probes
55
+ ```
56
+
57
+ ### separate_ssp_script.py
58
+
59
+ - Script for remove all logs from test accounts from SimpleSAMLlogs
60
+
61
+ - Params:
62
+ - 1 - The file name
63
+
64
+ ### backup_database.sh
65
+
66
+ - Do mysqldump into `/opt/mariadb_backup` and remove all dump file older than 7 days
67
+
68
+ ### separate_oidc_logs.py
69
+
70
+ - Script for remove all logs from test accounts from OIDC logs
71
+
72
+ ### metadata_expiration.py
73
+
74
+ - This script checks whether there are some metadata close to expiration date
75
+
76
+ - Params:
77
+ - 1 - url to a page which prints a time when expires the metadata closest to
78
+ expiration
79
+
80
+ ### print_docker_versions.py
81
+
82
+ - This script collects system info, docker engine info and the versions of running
83
+ containers and then prints it to the stdout in the JSON format
84
+ - A python [docker library](https://pypi.org/project/docker/) is needed to run the
85
+ script
86
+
87
+ - Options:
88
+ - -e,--exclude NAMES - space delimited string of container names to exclude from the
89
+ listing
90
+
91
+ ### run_version_script.py
92
+
93
+ - This scripts runs the print_docker_version.py script on the given machines. The
94
+ collected versions are then printed as a MD table to the stdout
95
+
96
+ - Options:
97
+ - -e,--exclude NAMES - space delimited string of container names to exclude from the
98
+ listing
99
+ - Params:
100
+ - 1... - machines to run the script on in the form of user@adress, the user needs
101
+ root privileges to execute the script
102
+
103
+ ## Nagios probes
104
+
105
+ All nagios scripts are located under `nagios` directory.
106
+
107
+ ### check_mongodb
108
+
109
+ Nagios monitoring probe for mongodb.
110
+
111
+ Tested options:
112
+
113
+ - connect
114
+ - connections
115
+ - replication_lag
116
+ - replset_state
117
+
118
+ (some possible options may not work since there are constructs which are not supported
119
+ by the latest mongodb versions)
120
+
121
+ For usage instructions, run:
122
+
123
+ ```sh
124
+ check_mongodb --help
125
+ ```
126
+
127
+ ### check_saml.py
128
+
129
+ SAML authentication check compatible with SimpleSAMLphp and mitreID.
130
+
131
+ Basic OIDC check can be triggered by adding `--basic-oidc-check` switch. This checks
132
+ for `state` and `code` parameters in the result url after a log in attempt.
133
+
134
+ For more usage instructions, run:
135
+
136
+ ```sh
137
+ check_saml --help
138
+ ```
139
+
140
+ Example:
141
+
142
+ ```sh
143
+ python3 check_saml.py
144
+ --username "my_username"
145
+ --password "my_password"
146
+ --username-field "j_username"
147
+ --password-field "j_password"
148
+ --postlogout-string "Successful logout"
149
+ ```
150
+
151
+ ### check_user_logins.py
152
+
153
+ Check users which login in repeatedly more often than a specified threshold (logins per
154
+ seconds).
155
+
156
+ For usage instructions, run:
157
+
158
+ ```sh
159
+ check_user_logins --help
160
+ ```
161
+
162
+ Example:
163
+
164
+ ```sh
165
+ python3 check_user_logins.py
166
+ -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log
167
+ -l 5
168
+ -s 60
169
+ -r "^(?P<datetime>.{20}).*audit-login.* (?P<userid>[0-9]+)@muni\.cz$"
170
+ -d "%b %d %Y %H:%M:%S"
171
+ ```
172
+
173
+ ### check_ldap
174
+
175
+ Check whether an LDAP server is available.
176
+
177
+ For usage instructions, run:
178
+
179
+ ```sh
180
+ check_ldap --help
181
+ ```
182
+
183
+ ### check_ldap_syncrepl
184
+
185
+ Check whether an LDAP replica is up to date with the provider.
186
+
187
+ #### Usage
188
+
189
+ ```sh
190
+ check_ldap_syncrepl --help
191
+ ```
192
+
193
+ ### check_privacyidea
194
+
195
+ Check whether privacyidea is available by performing TOTP authentication via the API.
196
+ Use caching arguments for avoiding failure when one TOTP code is used two times.
197
+
198
+ For usage instructions, run:
199
+
200
+ ```sh
201
+ check_privacyidea --help
202
+ ```
203
+
204
+ ### check_pgsql
205
+
206
+ Check connection to PostgreSQL using a configurable query.
207
+
208
+ For usage instructions, run:
209
+
210
+ ```sh
211
+ check_pgsql --help
212
+ ```
@@ -0,0 +1,189 @@
1
+ # Perun proxy utils
2
+
3
+ Scripts and monitoring probes related to Perun ProxyIdP.
4
+
5
+ ## Installation
6
+
7
+ Install via pip:
8
+
9
+ ```sh
10
+ pip install perun.proxy.utils
11
+ ```
12
+
13
+ There are several extras which are required only for some scripts:
14
+
15
+ - `[ldap]` for check_ldap and check_ldap_syncrepl
16
+ - this also requires
17
+ installing [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)
18
+ - `[postgresql]` for check_pgsql
19
+
20
+ ## Scripts
21
+
22
+ ### run_probes
23
+
24
+ - script designed to execute multiple monitoring probes
25
+ - output is compatible with CheckMK
26
+ - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
27
+
28
+ For usage instructions, run:
29
+
30
+ ```sh
31
+ run_probes
32
+ ```
33
+
34
+ ### separate_ssp_script.py
35
+
36
+ - Script for remove all logs from test accounts from SimpleSAMLlogs
37
+
38
+ - Params:
39
+ - 1 - The file name
40
+
41
+ ### backup_database.sh
42
+
43
+ - Do mysqldump into `/opt/mariadb_backup` and remove all dump file older than 7 days
44
+
45
+ ### separate_oidc_logs.py
46
+
47
+ - Script for remove all logs from test accounts from OIDC logs
48
+
49
+ ### metadata_expiration.py
50
+
51
+ - This script checks whether there are some metadata close to expiration date
52
+
53
+ - Params:
54
+ - 1 - url to a page which prints a time when expires the metadata closest to
55
+ expiration
56
+
57
+ ### print_docker_versions.py
58
+
59
+ - This script collects system info, docker engine info and the versions of running
60
+ containers and then prints it to the stdout in the JSON format
61
+ - A python [docker library](https://pypi.org/project/docker/) is needed to run the
62
+ script
63
+
64
+ - Options:
65
+ - -e,--exclude NAMES - space delimited string of container names to exclude from the
66
+ listing
67
+
68
+ ### run_version_script.py
69
+
70
+ - This scripts runs the print_docker_version.py script on the given machines. The
71
+ collected versions are then printed as a MD table to the stdout
72
+
73
+ - Options:
74
+ - -e,--exclude NAMES - space delimited string of container names to exclude from the
75
+ listing
76
+ - Params:
77
+ - 1... - machines to run the script on in the form of user@adress, the user needs
78
+ root privileges to execute the script
79
+
80
+ ## Nagios probes
81
+
82
+ All nagios scripts are located under `nagios` directory.
83
+
84
+ ### check_mongodb
85
+
86
+ Nagios monitoring probe for mongodb.
87
+
88
+ Tested options:
89
+
90
+ - connect
91
+ - connections
92
+ - replication_lag
93
+ - replset_state
94
+
95
+ (some possible options may not work since there are constructs which are not supported
96
+ by the latest mongodb versions)
97
+
98
+ For usage instructions, run:
99
+
100
+ ```sh
101
+ check_mongodb --help
102
+ ```
103
+
104
+ ### check_saml.py
105
+
106
+ SAML authentication check compatible with SimpleSAMLphp and mitreID.
107
+
108
+ Basic OIDC check can be triggered by adding `--basic-oidc-check` switch. This checks
109
+ for `state` and `code` parameters in the result url after a log in attempt.
110
+
111
+ For more usage instructions, run:
112
+
113
+ ```sh
114
+ check_saml --help
115
+ ```
116
+
117
+ Example:
118
+
119
+ ```sh
120
+ python3 check_saml.py
121
+ --username "my_username"
122
+ --password "my_password"
123
+ --username-field "j_username"
124
+ --password-field "j_password"
125
+ --postlogout-string "Successful logout"
126
+ ```
127
+
128
+ ### check_user_logins.py
129
+
130
+ Check users which login in repeatedly more often than a specified threshold (logins per
131
+ seconds).
132
+
133
+ For usage instructions, run:
134
+
135
+ ```sh
136
+ check_user_logins --help
137
+ ```
138
+
139
+ Example:
140
+
141
+ ```sh
142
+ python3 check_user_logins.py
143
+ -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log
144
+ -l 5
145
+ -s 60
146
+ -r "^(?P<datetime>.{20}).*audit-login.* (?P<userid>[0-9]+)@muni\.cz$"
147
+ -d "%b %d %Y %H:%M:%S"
148
+ ```
149
+
150
+ ### check_ldap
151
+
152
+ Check whether an LDAP server is available.
153
+
154
+ For usage instructions, run:
155
+
156
+ ```sh
157
+ check_ldap --help
158
+ ```
159
+
160
+ ### check_ldap_syncrepl
161
+
162
+ Check whether an LDAP replica is up to date with the provider.
163
+
164
+ #### Usage
165
+
166
+ ```sh
167
+ check_ldap_syncrepl --help
168
+ ```
169
+
170
+ ### check_privacyidea
171
+
172
+ Check whether privacyidea is available by performing TOTP authentication via the API.
173
+ Use caching arguments for avoiding failure when one TOTP code is used two times.
174
+
175
+ For usage instructions, run:
176
+
177
+ ```sh
178
+ check_privacyidea --help
179
+ ```
180
+
181
+ ### check_pgsql
182
+
183
+ Check connection to PostgreSQL using a configurable query.
184
+
185
+ For usage instructions, run:
186
+
187
+ ```sh
188
+ check_pgsql --help
189
+ ```
@@ -4,21 +4,21 @@
4
4
  make a full roundtrip test for SAML based SSO
5
5
  """
6
6
 
7
+ import argparse
7
8
  import base64
8
9
  import hmac
10
+ import http.cookiejar
9
11
  import os
12
+ import re
13
+ import ssl
10
14
  import struct
11
- import argparse
12
15
  import sys
16
+ import tempfile
13
17
  import time
14
- import urllib.request
15
18
  import urllib.error
16
19
  import urllib.parse
17
- import ssl
18
- import tempfile
19
- import re
20
+ import urllib.request
20
21
  from html.parser import HTMLParser
21
- import http.cookiejar
22
22
 
23
23
  STATUS = {"OK": 0, "WARNING": 1, "CRITICAL": 2, "UNKNOWN": 3}
24
24
 
@@ -197,6 +197,11 @@ def get_args():
197
197
  default="check_saml_cache",
198
198
  help="name of the file used for the cache",
199
199
  )
200
+ parser.add_argument(
201
+ "--basic-oidc-check",
202
+ action="store_true",
203
+ help="check for presence of state and code parameters in the result",
204
+ )
200
205
 
201
206
  return parser.parse_args()
202
207
 
@@ -508,6 +513,17 @@ class SAMLChecker:
508
513
  "WARNING",
509
514
  )
510
515
 
516
+ if self.args.basic_oidc_check:
517
+ mandatory_parameters = ["code=", "state="]
518
+ for param in mandatory_parameters:
519
+ if param not in response_url:
520
+ if self.args.verbose >= 3:
521
+ print(response_url)
522
+ self.finish(
523
+ f"Missing mandatory parameter '{param}' in response url.",
524
+ "CRITICAL",
525
+ )
526
+
511
527
  if not self.args.skip_logout_check:
512
528
  # test logout
513
529
  logout_html, logout_url = self.initial_request(self.args.logout_url)
@@ -0,0 +1,212 @@
1
+ Metadata-Version: 2.1
2
+ Name: perun.proxy.utils
3
+ Version: 2.1.0
4
+ Summary: Module with utilities and monitoring probes
5
+ Home-page: https://gitlab.ics.muni.cz/perun-proxy-aai/proxyidp-scripts.git
6
+ Requires-Python: >=3.9
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~=6.0
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
+ Provides-Extra: ldap
19
+ Requires-Dist: ldap3~=2.9.1; extra == "ldap"
20
+ Requires-Dist: check_syncrepl_extended~=2020.13; extra == "ldap"
21
+ Provides-Extra: postgresql
22
+ Requires-Dist: psycopg2-binary~=2.9; extra == "postgresql"
23
+
24
+ # Perun proxy utils
25
+
26
+ Scripts and monitoring probes related to Perun ProxyIdP.
27
+
28
+ ## Installation
29
+
30
+ Install via pip:
31
+
32
+ ```sh
33
+ pip install perun.proxy.utils
34
+ ```
35
+
36
+ There are several extras which are required only for some scripts:
37
+
38
+ - `[ldap]` for check_ldap and check_ldap_syncrepl
39
+ - this also requires
40
+ installing [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)
41
+ - `[postgresql]` for check_pgsql
42
+
43
+ ## Scripts
44
+
45
+ ### run_probes
46
+
47
+ - script designed to execute multiple monitoring probes
48
+ - output is compatible with CheckMK
49
+ - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
50
+
51
+ For usage instructions, run:
52
+
53
+ ```sh
54
+ run_probes
55
+ ```
56
+
57
+ ### separate_ssp_script.py
58
+
59
+ - Script for remove all logs from test accounts from SimpleSAMLlogs
60
+
61
+ - Params:
62
+ - 1 - The file name
63
+
64
+ ### backup_database.sh
65
+
66
+ - Do mysqldump into `/opt/mariadb_backup` and remove all dump file older than 7 days
67
+
68
+ ### separate_oidc_logs.py
69
+
70
+ - Script for remove all logs from test accounts from OIDC logs
71
+
72
+ ### metadata_expiration.py
73
+
74
+ - This script checks whether there are some metadata close to expiration date
75
+
76
+ - Params:
77
+ - 1 - url to a page which prints a time when expires the metadata closest to
78
+ expiration
79
+
80
+ ### print_docker_versions.py
81
+
82
+ - This script collects system info, docker engine info and the versions of running
83
+ containers and then prints it to the stdout in the JSON format
84
+ - A python [docker library](https://pypi.org/project/docker/) is needed to run the
85
+ script
86
+
87
+ - Options:
88
+ - -e,--exclude NAMES - space delimited string of container names to exclude from the
89
+ listing
90
+
91
+ ### run_version_script.py
92
+
93
+ - This scripts runs the print_docker_version.py script on the given machines. The
94
+ collected versions are then printed as a MD table to the stdout
95
+
96
+ - Options:
97
+ - -e,--exclude NAMES - space delimited string of container names to exclude from the
98
+ listing
99
+ - Params:
100
+ - 1... - machines to run the script on in the form of user@adress, the user needs
101
+ root privileges to execute the script
102
+
103
+ ## Nagios probes
104
+
105
+ All nagios scripts are located under `nagios` directory.
106
+
107
+ ### check_mongodb
108
+
109
+ Nagios monitoring probe for mongodb.
110
+
111
+ Tested options:
112
+
113
+ - connect
114
+ - connections
115
+ - replication_lag
116
+ - replset_state
117
+
118
+ (some possible options may not work since there are constructs which are not supported
119
+ by the latest mongodb versions)
120
+
121
+ For usage instructions, run:
122
+
123
+ ```sh
124
+ check_mongodb --help
125
+ ```
126
+
127
+ ### check_saml.py
128
+
129
+ SAML authentication check compatible with SimpleSAMLphp and mitreID.
130
+
131
+ Basic OIDC check can be triggered by adding `--basic-oidc-check` switch. This checks
132
+ for `state` and `code` parameters in the result url after a log in attempt.
133
+
134
+ For more usage instructions, run:
135
+
136
+ ```sh
137
+ check_saml --help
138
+ ```
139
+
140
+ Example:
141
+
142
+ ```sh
143
+ python3 check_saml.py
144
+ --username "my_username"
145
+ --password "my_password"
146
+ --username-field "j_username"
147
+ --password-field "j_password"
148
+ --postlogout-string "Successful logout"
149
+ ```
150
+
151
+ ### check_user_logins.py
152
+
153
+ Check users which login in repeatedly more often than a specified threshold (logins per
154
+ seconds).
155
+
156
+ For usage instructions, run:
157
+
158
+ ```sh
159
+ check_user_logins --help
160
+ ```
161
+
162
+ Example:
163
+
164
+ ```sh
165
+ python3 check_user_logins.py
166
+ -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log
167
+ -l 5
168
+ -s 60
169
+ -r "^(?P<datetime>.{20}).*audit-login.* (?P<userid>[0-9]+)@muni\.cz$"
170
+ -d "%b %d %Y %H:%M:%S"
171
+ ```
172
+
173
+ ### check_ldap
174
+
175
+ Check whether an LDAP server is available.
176
+
177
+ For usage instructions, run:
178
+
179
+ ```sh
180
+ check_ldap --help
181
+ ```
182
+
183
+ ### check_ldap_syncrepl
184
+
185
+ Check whether an LDAP replica is up to date with the provider.
186
+
187
+ #### Usage
188
+
189
+ ```sh
190
+ check_ldap_syncrepl --help
191
+ ```
192
+
193
+ ### check_privacyidea
194
+
195
+ Check whether privacyidea is available by performing TOTP authentication via the API.
196
+ Use caching arguments for avoiding failure when one TOTP code is used two times.
197
+
198
+ For usage instructions, run:
199
+
200
+ ```sh
201
+ check_privacyidea --help
202
+ ```
203
+
204
+ ### check_pgsql
205
+
206
+ Check connection to PostgreSQL using a configurable query.
207
+
208
+ For usage instructions, run:
209
+
210
+ ```sh
211
+ check_pgsql --help
212
+ ```
@@ -6,16 +6,16 @@ check_ldap = perun.proxy.utils.nagios.check_ldap:main
6
6
  check_ldap_syncrepl = check_syncrepl_extended.check_syncrepl_extended:main
7
7
  check_mongodb = perun.proxy.utils.nagios.check_mongodb:main
8
8
  check_nginx = check_nginx_status.check_nginx_status:main
9
- check_pgsql=perun.proxy.utils.nagios.check_pgsql:mainmetadata_expiration = perun.proxy.utils.metadata_expiration:main
9
+ check_pgsql = perun.proxy.utils.nagios.check_pgsql:main
10
10
  check_php_syntax = perun.proxy.utils.nagios.check_php_syntax:main
11
11
  check_privacyidea = perun.proxy.utils.nagios.check_privacyidea:main
12
12
  check_rpc_status = perun.proxy.utils.nagios.check_rpc_status:main
13
13
  check_saml = perun.proxy.utils.nagios.check_saml:main
14
14
  check_user_logins = perun.proxy.utils.nagios.check_user_logins:main
15
15
  check_webserver_availability = perun.proxy.utils.nagios.webserver_availability:main
16
+ metadata_expiration = perun.proxy.utils.metadata_expiration:main
16
17
  print_docker_versions = perun.proxy.utils.print_docker_versions:main
17
18
  run_probes = perun.proxy.utils.run_probes:main
18
19
  run_version_script = perun.proxy.utils.run_version_script:main
19
20
  separate_oidc_logs = perun.proxy.utils.separate_oidc_logs:main
20
21
  separate_ssp_logs = perun.proxy.utils.separate_ssp_logs:main
21
-
@@ -1,5 +1,5 @@
1
1
  [metadata]
2
- version = 1.11.0
2
+ version = 2.1.0
3
3
  license_files = LICENSE
4
4
  long_description = file: README.md
5
5
  long_description_content_type = text/markdown
@@ -15,13 +15,13 @@ setuptools.setup(
15
15
  "beautifulsoup4~=4.12",
16
16
  "requests~=2.31",
17
17
  "PyYAML>=5.4,<7.0",
18
- "check_syncrepl_extended~=2020.13",
19
18
  "check_nginx_status~=1.0",
20
19
  "pyotp~=2.9",
21
20
  ],
22
21
  extras_require={
23
22
  "ldap": [
24
23
  "ldap3~=2.9.1",
24
+ "check_syncrepl_extended~=2020.13",
25
25
  ],
26
26
  "postgresql": [
27
27
  "psycopg2-binary~=2.9",
@@ -45,7 +45,7 @@ setuptools.setup(
45
45
  "check_webserver_availability="
46
46
  "perun.proxy.utils.nagios.webserver_availability:main",
47
47
  "check_privacyidea=perun.proxy.utils.nagios.check_privacyidea:main",
48
- "check_pgsql=perun.proxy.utils.nagios.check_pgsql:main"
48
+ "check_pgsql=perun.proxy.utils.nagios.check_pgsql:main",
49
49
  "metadata_expiration=perun.proxy.utils.metadata_expiration:main",
50
50
  "print_docker_versions=perun.proxy.utils.print_docker_versions:main",
51
51
  "run_version_script=perun.proxy.utils.run_version_script:main",
@@ -1,143 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: perun.proxy.utils
3
- Version: 1.11.0
4
- Summary: Module with utilities and monitoring probes
5
- Home-page: https://gitlab.ics.muni.cz/perun-proxy-aai/proxyidp-scripts.git
6
- License: UNKNOWN
7
- Description: # Perun proxy utils
8
-
9
- ## Scripts
10
-
11
- ### run_probes.py
12
-
13
- - script designed to execute multiple monitoring probes
14
- - output is compatible with CheckMK
15
- - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
16
- - for usage run: `./run_probes.py` or `python3 -m perun.proxy.utils.run_probes`
17
-
18
- ### separate_ssp_script.py
19
-
20
- - Script for remove all logs from test accounts from SimpleSAMLlogs
21
-
22
- - Params:
23
- - 1 - The file name
24
-
25
- ### backup_database.sh
26
-
27
- - Do mysqldump into `/opt/mariadb_backup` and remove all dump file older than 7 days
28
-
29
- ### separate_oidc_logs.py
30
-
31
- - Script for remove all logs from test accounts from OIDC logs
32
-
33
- ### metadata_expiration.py
34
-
35
- - This script checks whether there are some metadata close to expiration date
36
-
37
- - Params:
38
- - 1 - url to a page which prints a time when expires the metadata closest to expiration
39
-
40
- ### print_docker_versions.py
41
-
42
- - This script collects system info, docker engine info and the versions of running containers and then prints it to the stdout in the JSON format
43
- - A python [docker library](https://pypi.org/project/docker/) is needed to run the script
44
-
45
- - Options:
46
- - -e,--exclude NAMES - space delimited string of container names to exclude from the listing
47
-
48
- ### run_version_script.py
49
-
50
- - This scripts runs the print_docker_version.py script on the given machines. The collected versions are then printed as a MD table to the stdout
51
-
52
- - Options:
53
- - -e,--exclude NAMES - space delimited string of container names to exclude from the listing
54
- - Params:
55
- - 1... - machines to run the script on in the form of user@adress, the user needs root privileges to execute the script
56
-
57
- ## Nagios probes
58
-
59
- All nagios scripts are located under `nagios` directory.
60
-
61
- ### check_mongodb.py
62
-
63
- - nagios monitoring probe for mongodb
64
-
65
- - connect, connections, replication_lag, replset_state monitoring options are tested (some possible options may not work since there are constructs which are not supported by latest mongodb versions)
66
-
67
- - for usage run:
68
- `python3 check_mongodb.py --help`
69
-
70
- ### check_saml.py
71
-
72
- - SAML authentication check
73
-
74
- - for usage run:
75
- `python3 check_saml.py --help`
76
-
77
- ### check_user_logins.py
78
-
79
- - check users which login in repeatedly more often than a specified threshold (logins per seconds)
80
-
81
- - for usage run:
82
- `python3 check_user_logins.py --help`
83
-
84
- - example:
85
-
86
- ```
87
- python3 check_user_logins.py
88
- -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log
89
- -l 5
90
- -s 60
91
- -r "^(?P<datetime>.{20}).*audit-login.* (?P<userid>[0-9]+)@muni\.cz$"
92
- -d "%b %d %Y %H:%M:%S"
93
- ```
94
-
95
- ### check_ldap.py
96
-
97
- - check whether LDAP is available
98
- - to use this check, you must install the ldap extra:
99
-
100
- ```sh
101
- pip install perun.proxy.utils[ldap]
102
- ```
103
-
104
- and the [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)
105
-
106
- - for usage run:
107
-
108
- ```sh
109
- python3 check_ldap.py --help
110
- ```
111
-
112
- ### check_privacyidea.py
113
-
114
- - check whether privacyidea is available
115
- - use caching arguments for avoiding failure when one TOTP code is used two times
116
-
117
- - for usage run:
118
-
119
- ```sh
120
- python3 check_privacyidea.py --help
121
- ```
122
-
123
- ### check_pgsql.py
124
-
125
- - check connection to PostgreSQL
126
- - possible check with configurable query
127
- - to use this check you must include the postgresql extra, which will install [psycopg2-binary](https://pypi.org/project/psycopg2-binary/):
128
-
129
- ```sh
130
- pip install perun.proxy.utils[postgresql]
131
- ```
132
-
133
- - for usage run:
134
-
135
- ```sh
136
- python3 check_pgpsql.py --help
137
- ```
138
-
139
- Platform: UNKNOWN
140
- Requires-Python: >=3.9
141
- Description-Content-Type: text/markdown
142
- Provides-Extra: ldap
143
- Provides-Extra: postgresql
@@ -1,131 +0,0 @@
1
- # Perun proxy utils
2
-
3
- ## Scripts
4
-
5
- ### run_probes.py
6
-
7
- - script designed to execute multiple monitoring probes
8
- - output is compatible with CheckMK
9
- - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
10
- - for usage run: `./run_probes.py` or `python3 -m perun.proxy.utils.run_probes`
11
-
12
- ### separate_ssp_script.py
13
-
14
- - Script for remove all logs from test accounts from SimpleSAMLlogs
15
-
16
- - Params:
17
- - 1 - The file name
18
-
19
- ### backup_database.sh
20
-
21
- - Do mysqldump into `/opt/mariadb_backup` and remove all dump file older than 7 days
22
-
23
- ### separate_oidc_logs.py
24
-
25
- - Script for remove all logs from test accounts from OIDC logs
26
-
27
- ### metadata_expiration.py
28
-
29
- - This script checks whether there are some metadata close to expiration date
30
-
31
- - Params:
32
- - 1 - url to a page which prints a time when expires the metadata closest to expiration
33
-
34
- ### print_docker_versions.py
35
-
36
- - This script collects system info, docker engine info and the versions of running containers and then prints it to the stdout in the JSON format
37
- - A python [docker library](https://pypi.org/project/docker/) is needed to run the script
38
-
39
- - Options:
40
- - -e,--exclude NAMES - space delimited string of container names to exclude from the listing
41
-
42
- ### run_version_script.py
43
-
44
- - This scripts runs the print_docker_version.py script on the given machines. The collected versions are then printed as a MD table to the stdout
45
-
46
- - Options:
47
- - -e,--exclude NAMES - space delimited string of container names to exclude from the listing
48
- - Params:
49
- - 1... - machines to run the script on in the form of user@adress, the user needs root privileges to execute the script
50
-
51
- ## Nagios probes
52
-
53
- All nagios scripts are located under `nagios` directory.
54
-
55
- ### check_mongodb.py
56
-
57
- - nagios monitoring probe for mongodb
58
-
59
- - connect, connections, replication_lag, replset_state monitoring options are tested (some possible options may not work since there are constructs which are not supported by latest mongodb versions)
60
-
61
- - for usage run:
62
- `python3 check_mongodb.py --help`
63
-
64
- ### check_saml.py
65
-
66
- - SAML authentication check
67
-
68
- - for usage run:
69
- `python3 check_saml.py --help`
70
-
71
- ### check_user_logins.py
72
-
73
- - check users which login in repeatedly more often than a specified threshold (logins per seconds)
74
-
75
- - for usage run:
76
- `python3 check_user_logins.py --help`
77
-
78
- - example:
79
-
80
- ```
81
- python3 check_user_logins.py
82
- -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log
83
- -l 5
84
- -s 60
85
- -r "^(?P<datetime>.{20}).*audit-login.* (?P<userid>[0-9]+)@muni\.cz$"
86
- -d "%b %d %Y %H:%M:%S"
87
- ```
88
-
89
- ### check_ldap.py
90
-
91
- - check whether LDAP is available
92
- - to use this check, you must install the ldap extra:
93
-
94
- ```sh
95
- pip install perun.proxy.utils[ldap]
96
- ```
97
-
98
- and the [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)
99
-
100
- - for usage run:
101
-
102
- ```sh
103
- python3 check_ldap.py --help
104
- ```
105
-
106
- ### check_privacyidea.py
107
-
108
- - check whether privacyidea is available
109
- - use caching arguments for avoiding failure when one TOTP code is used two times
110
-
111
- - for usage run:
112
-
113
- ```sh
114
- python3 check_privacyidea.py --help
115
- ```
116
-
117
- ### check_pgsql.py
118
-
119
- - check connection to PostgreSQL
120
- - possible check with configurable query
121
- - to use this check you must include the postgresql extra, which will install [psycopg2-binary](https://pypi.org/project/psycopg2-binary/):
122
-
123
- ```sh
124
- pip install perun.proxy.utils[postgresql]
125
- ```
126
-
127
- - for usage run:
128
-
129
- ```sh
130
- python3 check_pgpsql.py --help
131
- ```
@@ -1,143 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: perun.proxy.utils
3
- Version: 1.11.0
4
- Summary: Module with utilities and monitoring probes
5
- Home-page: https://gitlab.ics.muni.cz/perun-proxy-aai/proxyidp-scripts.git
6
- License: UNKNOWN
7
- Description: # Perun proxy utils
8
-
9
- ## Scripts
10
-
11
- ### run_probes.py
12
-
13
- - script designed to execute multiple monitoring probes
14
- - output is compatible with CheckMK
15
- - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
16
- - for usage run: `./run_probes.py` or `python3 -m perun.proxy.utils.run_probes`
17
-
18
- ### separate_ssp_script.py
19
-
20
- - Script for remove all logs from test accounts from SimpleSAMLlogs
21
-
22
- - Params:
23
- - 1 - The file name
24
-
25
- ### backup_database.sh
26
-
27
- - Do mysqldump into `/opt/mariadb_backup` and remove all dump file older than 7 days
28
-
29
- ### separate_oidc_logs.py
30
-
31
- - Script for remove all logs from test accounts from OIDC logs
32
-
33
- ### metadata_expiration.py
34
-
35
- - This script checks whether there are some metadata close to expiration date
36
-
37
- - Params:
38
- - 1 - url to a page which prints a time when expires the metadata closest to expiration
39
-
40
- ### print_docker_versions.py
41
-
42
- - This script collects system info, docker engine info and the versions of running containers and then prints it to the stdout in the JSON format
43
- - A python [docker library](https://pypi.org/project/docker/) is needed to run the script
44
-
45
- - Options:
46
- - -e,--exclude NAMES - space delimited string of container names to exclude from the listing
47
-
48
- ### run_version_script.py
49
-
50
- - This scripts runs the print_docker_version.py script on the given machines. The collected versions are then printed as a MD table to the stdout
51
-
52
- - Options:
53
- - -e,--exclude NAMES - space delimited string of container names to exclude from the listing
54
- - Params:
55
- - 1... - machines to run the script on in the form of user@adress, the user needs root privileges to execute the script
56
-
57
- ## Nagios probes
58
-
59
- All nagios scripts are located under `nagios` directory.
60
-
61
- ### check_mongodb.py
62
-
63
- - nagios monitoring probe for mongodb
64
-
65
- - connect, connections, replication_lag, replset_state monitoring options are tested (some possible options may not work since there are constructs which are not supported by latest mongodb versions)
66
-
67
- - for usage run:
68
- `python3 check_mongodb.py --help`
69
-
70
- ### check_saml.py
71
-
72
- - SAML authentication check
73
-
74
- - for usage run:
75
- `python3 check_saml.py --help`
76
-
77
- ### check_user_logins.py
78
-
79
- - check users which login in repeatedly more often than a specified threshold (logins per seconds)
80
-
81
- - for usage run:
82
- `python3 check_user_logins.py --help`
83
-
84
- - example:
85
-
86
- ```
87
- python3 check_user_logins.py
88
- -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log
89
- -l 5
90
- -s 60
91
- -r "^(?P<datetime>.{20}).*audit-login.* (?P<userid>[0-9]+)@muni\.cz$"
92
- -d "%b %d %Y %H:%M:%S"
93
- ```
94
-
95
- ### check_ldap.py
96
-
97
- - check whether LDAP is available
98
- - to use this check, you must install the ldap extra:
99
-
100
- ```sh
101
- pip install perun.proxy.utils[ldap]
102
- ```
103
-
104
- and the [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)
105
-
106
- - for usage run:
107
-
108
- ```sh
109
- python3 check_ldap.py --help
110
- ```
111
-
112
- ### check_privacyidea.py
113
-
114
- - check whether privacyidea is available
115
- - use caching arguments for avoiding failure when one TOTP code is used two times
116
-
117
- - for usage run:
118
-
119
- ```sh
120
- python3 check_privacyidea.py --help
121
- ```
122
-
123
- ### check_pgsql.py
124
-
125
- - check connection to PostgreSQL
126
- - possible check with configurable query
127
- - to use this check you must include the postgresql extra, which will install [psycopg2-binary](https://pypi.org/project/psycopg2-binary/):
128
-
129
- ```sh
130
- pip install perun.proxy.utils[postgresql]
131
- ```
132
-
133
- - for usage run:
134
-
135
- ```sh
136
- python3 check_pgpsql.py --help
137
- ```
138
-
139
- Platform: UNKNOWN
140
- Requires-Python: >=3.9
141
- Description-Content-Type: text/markdown
142
- Provides-Extra: ldap
143
- Provides-Extra: postgresql
@@ -1,16 +1,16 @@
1
- PyYAML<7.0,>=5.4
1
+ setuptools
2
+ pymongo~=4.3
2
3
  asyncssh~=2.13
4
+ docker~=6.0
3
5
  beautifulsoup4~=4.12
6
+ requests~=2.31
7
+ PyYAML<7.0,>=5.4
4
8
  check_nginx_status~=1.0
5
- check_syncrepl_extended~=2020.13
6
- docker~=6.0
7
- pymongo~=4.3
8
9
  pyotp~=2.9
9
- requests~=2.31
10
- setuptools
11
10
 
12
11
  [ldap]
13
12
  ldap3~=2.9.1
13
+ check_syncrepl_extended~=2020.13
14
14
 
15
15
  [postgresql]
16
16
  psycopg2-binary~=2.9