You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run ssh-audit version 3.2.0 with the -P and the -T parameter.
Observed behavior
$ ssh-audit -jj -P policy.txt -T ips.txt
[Traceback (most recent call last):
File "/XXX/virtualenv/keycheck/bin/ssh-audit", line 8, in <module>
sys.exit(main())
^^^^^^
File "/XXX/virtualenv/keycheck/lib/python3.11/site-packages/ssh_audit/ssh_audit.py", line 1603, in main
worker_ret, worker_output = future.result()
^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/XXX/virtualenv/keycheck/lib/python3.11/site-packages/ssh_audit/ssh_audit.py", line 1442, in target_worker_thread
my_aconf = copy.deepcopy(shared_aconf)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 146, in deepcopy
y = copier(x, memo)
^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 146, in deepcopy
y = copier(x, memo)
^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/copy.py", line 161, in deepcopy
rv = reductor(4)
^^^^^^^^^^^
TypeError: cannot pickle '_io.TextIOWrapper' object
Additional context
A deep copy of a configuration object is created in ssh_audit.py:1442. This object itself refers to a Policy object which has a property _warning_target set to either sys.stderr (JSON mode) or sys.stdout (normal mode). This object cannot be deep-copied as it contains a non-serializable state (e.g. file position pointer).
The text was updated successfully, but these errors were encountered:
How to reproduce
Run
ssh-audit
version 3.2.0 with the-P
and the-T
parameter.Observed behavior
Additional context
A deep copy of a configuration object is created in
ssh_audit.py:1442
. This object itself refers to aPolicy
object which has a property_warning_target
set to eithersys.stderr
(JSON mode) orsys.stdout
(normal mode). This object cannot be deep-copied as it contains a non-serializable state (e.g. file position pointer).The text was updated successfully, but these errors were encountered: