From 5ca78f384725dfe3130a968b579138347b5a85cb Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Fri, 12 Mar 2021 08:54:17 +0000 Subject: [PATCH 01/80] Update baseline to 2.282, fixes PCT (detached ssh plugin) (#215) --- pom.xml | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 882722a9..00041867 100644 --- a/pom.xml +++ b/pom.xml @@ -27,9 +27,9 @@ 1.31.6 -SNAPSHOT - 2.222.4 + 2.282 8 - 1.46 + 1.31.0 @@ -102,8 +102,8 @@ io.jenkins.tools.bom - bom-2.204.x - 18 + bom-2.277.x + 26 pom import @@ -118,17 +118,20 @@ org.jenkins-ci.plugins trilead-api - 1.0.13 org.jenkins-ci.plugins credentials - 2.3.14 org.jenkins-ci.plugins ssh-credentials - 1.18.1 + + + org.jenkins-ci.modules + sshd + 3.0.3 + test org.jenkins-ci.test @@ -145,27 +148,12 @@ io.jenkins configuration-as-code - ${configuration-as-code.version} test io.jenkins.configuration-as-code test-harness - ${configuration-as-code.version} test - - - - org.jenkins-ci.tools - maven-hpi-plugin - true - - 1.8 - 1.31.0 - - - - From e5553ea7e6975cc980d38b00e18d0c27cc3ede42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 09:57:09 +0100 Subject: [PATCH 02/80] Bump plugin from 4.15 to 4.16 (#213) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.15 to 4.16. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.15...plugin-4.16) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 00041867..095a66cc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.15 + 4.16 ssh-slaves From 3d24736b564b94dfc4801ede5a2cd2d6fc4c6767 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 13:04:13 +0100 Subject: [PATCH 03/80] Bump plugin from 4.16 to 4.17 (#216) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.16 to 4.17. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.16...plugin-4.17) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 095a66cc..5a7d6773 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.16 + 4.17 ssh-slaves From 57d42b94180ec665f5ba34aa73809a29888144db Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 13 Mar 2021 12:51:58 +0100 Subject: [PATCH 04/80] [maven-release-plugin] prepare release ssh-slaves-1.31.6 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5a7d6773..ddaf8355 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - ${revision}${changelist} + 1.31.6 hpi SSH Build Agents plugin @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ${scmTag} + ssh-slaves-1.31.6 From 81e7bc4ef0dba4787902473cb7945bd35e024dd9 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 13 Mar 2021 12:52:11 +0100 Subject: [PATCH 05/80] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ddaf8355..bd675ee0 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - 1.31.6 + ${revision}${changelist} hpi SSH Build Agents plugin @@ -25,7 +25,7 @@ - 1.31.6 + 1.31.7 -SNAPSHOT 2.282 8 @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ssh-slaves-1.31.6 + ${scmTag} From 79ba0297d66a204f8e456d34ffc4076edcffafda Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Fri, 19 Mar 2021 10:58:17 +0100 Subject: [PATCH 06/80] test: add SSH connections test for several configurations (#206) * test: add SSH connections test for several configurations * fix: typo * fix: run only on linux and mac * fix: run only on linux and mac * fix: increase wait for connection * test: increase timeout * test: speed up the build * test: add retry rule * test: move all containers to use Ubuntu 20.04 and Java 11 * test: bump testcontainers * test: increase timeout, put retries * chore: enable all platforms --- .gitignore | 1 + Jenkinsfile | 2 +- pom.xml | 10 ++ .../sshslaves/agents/AgentConnectionBase.java | 97 +++++++++++++++++++ .../AgentCurve25519Sha256ConnectionTest.java | 44 +++++++++ .../agents/AgentDSAConnectionTest.java | 44 +++++++++ .../agents/AgentECConnectionTest.java | 44 +++++++++ .../AgentECDHSha2Nistp256ConnectionTest.java | 44 +++++++++ .../AgentECDHSha2Nistp384ConnectionTest.java | 44 +++++++++ .../AgentECDHSha2Nistp521ConnectionTest.java | 44 +++++++++ .../agents/AgentED25519ConnectionTest.java | 44 +++++++++ .../agents/AgentHostECConnectionTest.java | 44 +++++++++ .../agents/AgentHostEDConnectionTest.java | 44 +++++++++ .../agents/AgentHostRSAConnectionTest.java | 44 +++++++++ .../agents/AgentRSA256ConnectionTest.java | 44 +++++++++ .../agents/AgentRSA512ConnectionTest.java | 44 +++++++++ .../agents/AgentRSAConnectionTest.java | 44 +++++++++ .../AgentRSA_AES128CBC_ConnectionTest.java | 44 +++++++++ .../AgentRSA_AES192CBC_ConnectionTest.java | 44 +++++++++ .../AgentRSA_AES256CBC_ConnectionTest.java | 44 +++++++++ .../AgentRSA_DESCBC_ConnectionTest.java | 44 +++++++++ .../AgentRSA_DES_EDE3CBC_ConnectionTest.java | 44 +++++++++ .../AgentUbuntu1404RSAConnectionTest.java | 44 +++++++++ .../AgentUbuntu1604RSAConnectionTest.java | 44 +++++++++ .../AgentUbuntu1804RSAConnectionTest.java | 44 +++++++++ .../AgentUbuntu2004RSAConnectionTest.java | 45 +++++++++ .../AgentUserAndPasswordConnectionTest.java | 43 ++++++++ .../sshslaves/categories/AgentSSHTest.java | 10 ++ .../sshslaves/categories/SSHHostKeyTest.java | 10 ++ .../sshslaves/categories/SSHKexTest.java | 10 ++ .../categories/SSHKeyAuthenticationTest.java | 10 ++ .../rules/CheckIsDockerAvailable.java | 36 +++++++ .../sshslaves/rules/CheckIsLinuxOrMac.java | 17 ++++ .../hudson/plugins/sshslaves/rules/Retry.java | 42 ++++++++ .../ssh-agent-curve25519-sha256/Dockerfile | 44 +++++++++ .../ssh/authorized_keys | 1 + .../ssh-agent-curve25519-sha256/ssh/rsa-key | 51 ++++++++++ .../ssh/rsa-key.pub | 1 + .../ssh/sshd_config | 15 +++ .../sshslaves/agents/ssh-agent-dsa/Dockerfile | 44 +++++++++ .../agents/ssh-agent-dsa/ssh/authorized_keys | 2 + .../sshslaves/agents/ssh-agent-dsa/ssh/dsakey | 12 +++ .../agents/ssh-agent-dsa/ssh/dsakey.pub | 1 + .../agents/ssh-agent-dsa/ssh/sshd_config | 16 +++ .../sshslaves/agents/ssh-agent-ec/Dockerfile | 44 +++++++++ .../agents/ssh-agent-ec/ssh/authorized_keys | 2 + .../agents/ssh-agent-ec/ssh/ecdsakey | 7 ++ .../agents/ssh-agent-ec/ssh/ecdsakey.pub | 1 + .../agents/ssh-agent-ec/ssh/sshd_config | 16 +++ .../ssh-agent-ecdh-sha2-nistp256/Dockerfile | 44 +++++++++ .../ssh/authorized_keys | 1 + .../ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key | 51 ++++++++++ .../ssh/rsa-key.pub | 1 + .../ssh/sshd_config | 15 +++ .../ssh-agent-ecdh-sha2-nistp384/Dockerfile | 44 +++++++++ .../ssh/authorized_keys | 1 + .../ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key | 51 ++++++++++ .../ssh/rsa-key.pub | 1 + .../ssh/sshd_config | 15 +++ .../ssh-agent-ecdh-sha2-nistp521/Dockerfile | 44 +++++++++ .../ssh/authorized_keys | 1 + .../ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key | 51 ++++++++++ .../ssh/rsa-key.pub | 1 + .../ssh/sshd_config | 15 +++ .../agents/ssh-agent-ed25519/Dockerfile | 44 +++++++++ .../ssh-agent-ed25519/ssh/authorized_keys | 2 + .../agents/ssh-agent-ed25519/ssh/ed25519key | 7 ++ .../ssh-agent-ed25519/ssh/ed25519key.pub | 1 + .../agents/ssh-agent-ed25519/ssh/sshd_config | 16 +++ .../agents/ssh-agent-host-ec/Dockerfile | 46 +++++++++ .../ssh-agent-host-ec/ssh/authorized_keys | 1 + .../agents/ssh-agent-host-ec/ssh/rsa-key | 51 ++++++++++ .../agents/ssh-agent-host-ec/ssh/rsa-key.pub | 1 + .../agents/ssh-agent-host-ec/ssh/sshd_config | 13 +++ .../agents/ssh-agent-host-ed/Dockerfile | 46 +++++++++ .../ssh-agent-host-ed/ssh/authorized_keys | 1 + .../agents/ssh-agent-host-ed/ssh/rsa-key | 51 ++++++++++ .../agents/ssh-agent-host-ed/ssh/rsa-key.pub | 1 + .../agents/ssh-agent-host-ed/ssh/sshd_config | 13 +++ .../agents/ssh-agent-host-rsa/Dockerfile | 46 +++++++++ .../ssh-agent-host-rsa/ssh/authorized_keys | 1 + .../agents/ssh-agent-host-rsa/ssh/rsa-key | 51 ++++++++++ .../agents/ssh-agent-host-rsa/ssh/rsa-key.pub | 1 + .../agents/ssh-agent-host-rsa/ssh/sshd_config | 13 +++ .../sshslaves/agents/ssh-agent-rsa/Dockerfile | 44 +++++++++ .../agents/ssh-agent-rsa/ssh/authorized_keys | 1 + .../agents/ssh-agent-rsa/ssh/rsa-key | 51 ++++++++++ .../ssh-agent-rsa/ssh/rsa-key-aes128-cbc | 54 +++++++++++ .../ssh-agent-rsa/ssh/rsa-key-aes192-cbc | 54 +++++++++++ .../ssh-agent-rsa/ssh/rsa-key-aes256-cbc | 54 +++++++++++ .../agents/ssh-agent-rsa/ssh/rsa-key-des-cbc | 54 +++++++++++ .../ssh-agent-rsa/ssh/rsa-key-des-ede3-cbc | 54 +++++++++++ .../agents/ssh-agent-rsa/ssh/rsa-key.pub | 1 + .../agents/ssh-agent-rsa/ssh/sshd_config | 16 +++ .../agents/ssh-agent-rsa256/Dockerfile | 44 +++++++++ .../ssh-agent-rsa256/ssh/authorized_keys | 2 + .../agents/ssh-agent-rsa256/ssh/rsa-256-key | 49 ++++++++++ .../ssh-agent-rsa256/ssh/rsa-256-key.pub | 1 + .../agents/ssh-agent-rsa256/ssh/sshd_config | 16 +++ .../agents/ssh-agent-rsa512/Dockerfile | 44 +++++++++ .../ssh-agent-rsa512/ssh/authorized_keys | 2 + .../agents/ssh-agent-rsa512/ssh/rsa-512-key | 49 ++++++++++ .../ssh-agent-rsa512/ssh/rsa-512-key.pub | 1 + .../agents/ssh-agent-rsa512/ssh/sshd_config | 16 +++ .../agents/ssh-agent-ubuntu-14.04/Dockerfile | 42 ++++++++ .../ssh/authorized_keys | 1 + .../agents/ssh-agent-ubuntu-14.04/ssh/rsa-key | 51 ++++++++++ .../ssh-agent-ubuntu-14.04/ssh/rsa-key.pub | 1 + .../ssh-agent-ubuntu-14.04/ssh/sshd_config | 13 +++ .../agents/ssh-agent-ubuntu-16.04/Dockerfile | 42 ++++++++ .../ssh/authorized_keys | 1 + .../agents/ssh-agent-ubuntu-16.04/ssh/rsa-key | 51 ++++++++++ .../ssh-agent-ubuntu-16.04/ssh/rsa-key.pub | 1 + .../ssh-agent-ubuntu-16.04/ssh/sshd_config | 16 +++ .../agents/ssh-agent-ubuntu-18.04/Dockerfile | 42 ++++++++ .../ssh/authorized_keys | 1 + .../agents/ssh-agent-ubuntu-18.04/ssh/rsa-key | 51 ++++++++++ .../ssh-agent-ubuntu-18.04/ssh/rsa-key.pub | 1 + .../ssh-agent-ubuntu-18.04/ssh/sshd_config | 16 +++ .../agents/ssh-agent-ubuntu-20.04/Dockerfile | 44 +++++++++ .../ssh/authorized_keys | 1 + .../agents/ssh-agent-ubuntu-20.04/ssh/rsa-key | 51 ++++++++++ .../ssh-agent-ubuntu-20.04/ssh/rsa-key.pub | 1 + .../ssh-agent-ubuntu-20.04/ssh/sshd_config | 17 ++++ 124 files changed, 3306 insertions(+), 1 deletion(-) create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentCurve25519Sha256ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentECConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp521ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentED25519ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentHostECConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentHostEDConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentHostRSAConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSA512ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSAConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES256CBC_ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/categories/AgentSSHTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/categories/SSHHostKeyTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/categories/SSHKexTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/categories/SSHKeyAuthenticationTest.java create mode 100644 src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java create mode 100644 src/test/java/hudson/plugins/sshslaves/rules/CheckIsLinuxOrMac.java create mode 100644 src/test/java/hudson/plugins/sshslaves/rules/Retry.java create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes128-cbc create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes192-cbc create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes256-cbc create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-cbc create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-ede3-cbc create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/sshd_config create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/Dockerfile create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/authorized_keys create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key.pub create mode 100644 src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/sshd_config diff --git a/.gitignore b/.gitignore index d1a7bef9..31f863d9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ target .settings work bin +.DS_Store diff --git a/Jenkinsfile b/Jenkinsfile index 395c0053..66071b30 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,4 +6,4 @@ def buildConfiguration = [ [platform: 'linux', jdk: '11'], ] -buildPlugin(configurations: buildConfiguration) +buildPlugin(configurations: buildConfiguration, timeout: 90) diff --git a/pom.xml b/pom.xml index bd675ee0..691aa29f 100644 --- a/pom.xml +++ b/pom.xml @@ -111,6 +111,10 @@ org.jenkins-ci.plugins jackson2-api + + org.slf4j + slf4j-api + @@ -155,5 +159,11 @@ test-harness test + + org.testcontainers + testcontainers + 1.15.1 + test + diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java new file mode 100644 index 00000000..6a9bc930 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java @@ -0,0 +1,97 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.concurrent.TimeUnit; + +import hudson.plugins.sshslaves.rules.Retry; +import org.apache.commons.io.IOUtils; +import org.junit.Rule; +import org.junit.rules.Timeout; +import org.jvnet.hudson.test.JenkinsRule; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.SSHLauncher; +import hudson.plugins.sshslaves.rules.CheckIsDockerAvailable; +import hudson.plugins.sshslaves.rules.CheckIsLinuxOrMac; +import hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy; +import hudson.slaves.DumbSlave; +import com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey; +import com.cloudbees.plugins.credentials.CredentialsScope; +import com.cloudbees.plugins.credentials.SystemCredentialsProvider; +import com.cloudbees.plugins.credentials.domains.Domain; +import static org.junit.Assert.assertTrue; + +/** + * Base class to test connections to a remote SSH Agent + * + * @author Kuisathaverat + */ +public class AgentConnectionBase { + public static final String USER = "jenkins"; + public static final String PASSWORD = "password"; + public static final String AGENT_WORK_DIR = "/home/jenkins"; + public static final int SSH_PORT = 22; + public static final String SSH_SSHD_CONFIG = "ssh/sshd_config"; + public static final String DOCKERFILE = "Dockerfile"; + public static final String SSH_AUTHORIZED_KEYS = "ssh/authorized_keys"; + public static final String AGENTS_RESOURCES_PATH = "/hudson/plugins/sshslaves/agents/"; + + @Rule + public CheckIsLinuxOrMac isLinuxOrMac = new CheckIsLinuxOrMac(); + + @Rule + public CheckIsDockerAvailable isDockerAvailable = new CheckIsDockerAvailable(); + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Rule + public Retry retry = new Retry(3); + + @Rule + public Timeout globalTimeout= new Timeout(4, TimeUnit.MINUTES); + + protected boolean isSuccessfullyConnected(Node node) throws IOException, InterruptedException { + boolean ret = false; + int count = 0; + while (count < 30) { + Thread.sleep(1000); + String log = node.toComputer().getLog(); + ret = log.contains("Agent successfully connected and online"); + count++; + } + return ret; + } + + protected void waitForAgentConnected(Node node) throws InterruptedException { + int count = 0; + while (!node.toComputer().isOnline() && count < 150) { + Thread.sleep(1000); + count++; + } + assertTrue(node.toComputer().isOnline()); + } + + protected Node createPermanentAgent(String name, String host, int sshPort, String keyResourcePath, String passphrase) + throws Descriptor.FormException, IOException { + String credId = "sshCredentialsId"; + createSshCredentials(credId, keyResourcePath, passphrase); + final SSHLauncher launcher = new SSHLauncher(host , sshPort, credId); + launcher.setSshHostKeyVerificationStrategy(new NonVerifyingKeyVerificationStrategy()); + DumbSlave agent = new DumbSlave(name, AGENT_WORK_DIR, launcher); + j.jenkins.addNode(agent); + return j.jenkins.getNode(agent.getNodeName()); + } + + private void createSshCredentials(String id, String keyResourcePath, String passphrase) throws IOException { + String privateKey = IOUtils.toString(getClass().getResourceAsStream(keyResourcePath), StandardCharsets.UTF_8); + BasicSSHUserPrivateKey.DirectEntryPrivateKeySource privateKeySource = new BasicSSHUserPrivateKey.DirectEntryPrivateKeySource( + privateKey); + BasicSSHUserPrivateKey credentials = new BasicSSHUserPrivateKey(CredentialsScope.SYSTEM, id, USER, privateKeySource, + passphrase, "Private Key ssh credentials"); + SystemCredentialsProvider.getInstance().getDomainCredentialsMap().put(Domain.global(), + Collections.singletonList(credentials)); + } +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentCurve25519Sha256ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentCurve25519Sha256ConnectionTest.java new file mode 100644 index 00000000..6a1211cc --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentCurve25519Sha256ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKexTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKexTest.class}) +public class AgentCurve25519Sha256ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-curve25519-sha256"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java new file mode 100644 index 00000000..e9184ac7 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentDSAConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-dsa"; + public static final String SSH_KEY_PATH = "ssh/dsakey"; + public static final String SSH_KEY_PUB_PATH = "ssh/dsakey.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentECConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentECConnectionTest.java new file mode 100644 index 00000000..9e6d0747 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentECConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentECConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ec"; + public static final String SSH_KEY_PATH = "ssh/ecdsakey"; + public static final String SSH_KEY_PUB_PATH = "ssh/ecdsakey.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java new file mode 100644 index 00000000..b491c093 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKexTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKexTest.class}) +public class AgentECDHSha2Nistp256ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ecdh-sha2-nistp256"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java new file mode 100644 index 00000000..59666c22 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKexTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKexTest.class}) +public class AgentECDHSha2Nistp384ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ecdh-sha2-nistp384"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp521ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp521ConnectionTest.java new file mode 100644 index 00000000..0f4bba9a --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp521ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKexTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKexTest.class}) +public class AgentECDHSha2Nistp521ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ecdh-sha2-nistp521"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentED25519ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentED25519ConnectionTest.java new file mode 100644 index 00000000..c582abcb --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentED25519ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentED25519ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ed25519"; + public static final String SSH_KEY_PATH = "ssh/ed25519key"; + public static final String SSH_KEY_PUB_PATH = "ssh/ed25519key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentHostECConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentHostECConnectionTest.java new file mode 100644 index 00000000..fbd0b8f3 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentHostECConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHHostKeyTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHHostKeyTest.class}) +public class AgentHostECConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-host-ec"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentHostEDConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentHostEDConnectionTest.java new file mode 100644 index 00000000..8cc95030 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentHostEDConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHHostKeyTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHHostKeyTest.class}) +public class AgentHostEDConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-host-ed"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentHostRSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentHostRSAConnectionTest.java new file mode 100644 index 00000000..cf7f76d2 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentHostRSAConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHHostKeyTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHHostKeyTest.class}) +public class AgentHostRSAConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-host-rsa"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java new file mode 100644 index 00000000..ed66f2a7 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSA256ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa256"; + public static final String SSH_KEY_PATH = "ssh/rsa-256-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-256-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA512ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA512ConnectionTest.java new file mode 100644 index 00000000..012a43a3 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA512ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSA512ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa512"; + public static final String SSH_KEY_PATH = "ssh/rsa-512-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-512-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSAConnectionTest.java new file mode 100644 index 00000000..7998be1a --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSAConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSAConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java new file mode 100644 index 00000000..6c8b64f0 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSA_AES128CBC_ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; + public static final String SSH_KEY_PATH = "ssh/rsa-key-aes128-cbc"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, PASSWORD); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java new file mode 100644 index 00000000..12ad532a --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSA_AES192CBC_ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; + public static final String SSH_KEY_PATH = "ssh/rsa-key-aes192-cbc"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, PASSWORD); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES256CBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES256CBC_ConnectionTest.java new file mode 100644 index 00000000..c000e922 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES256CBC_ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSA_AES256CBC_ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; + public static final String SSH_KEY_PATH = "ssh/rsa-key-aes256-cbc"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, PASSWORD); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java new file mode 100644 index 00000000..3527a87f --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSA_DESCBC_ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; + public static final String SSH_KEY_PATH = "ssh/rsa-key-des-cbc"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, PASSWORD); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java new file mode 100644 index 00000000..7403667a --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentRSA_DES_EDE3CBC_ConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; + public static final String SSH_KEY_PATH = "ssh/rsa-key-des-ede3-cbc"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, PASSWORD); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java new file mode 100644 index 00000000..2f643ff2 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentUbuntu1404RSAConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-14.04"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java new file mode 100644 index 00000000..1793b399 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentUbuntu1604RSAConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-16.04"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java new file mode 100644 index 00000000..73acbab4 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java @@ -0,0 +1,44 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentUbuntu1804RSAConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-18.04"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java new file mode 100644 index 00000000..5151f7de --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java @@ -0,0 +1,45 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; + +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) +public class AgentUbuntu2004RSAConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-20.04"; + public static final String SSH_KEY_PATH = "ssh/rsa-key"; + public static final String SSH_KEY_PUB_PATH = "ssh/rsa-key.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java new file mode 100644 index 00000000..bc5f5128 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java @@ -0,0 +1,43 @@ +package hudson.plugins.sshslaves.agents; + +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import hudson.model.Descriptor; +import hudson.model.Node; +import hudson.plugins.sshslaves.categories.AgentSSHTest; +import static org.junit.Assert.assertTrue; + +/** + * Connect to a remote SSH Agent + * + * @author Kuisathaverat + */ +@Category({ AgentSSHTest.class }) +public class AgentUserAndPasswordConnectionTest extends AgentConnectionBase { + public static final String SSH_AGENT_NAME = "ssh-agent-dsa"; + public static final String SSH_KEY_PATH = "ssh/dsakey"; + public static final String SSH_KEY_PUB_PATH = "ssh/dsakey.pub"; + + @Rule + public GenericContainer agentContainer = new GenericContainer( + new ImageFromDockerfile(SSH_AGENT_NAME, false) + .withFileFromClasspath(SSH_AUTHORIZED_KEYS, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_AUTHORIZED_KEYS) + .withFileFromClasspath(SSH_KEY_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PATH) + .withFileFromClasspath(SSH_KEY_PUB_PATH, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_KEY_PUB_PATH) + .withFileFromClasspath(SSH_SSHD_CONFIG, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + SSH_SSHD_CONFIG) + .withFileFromClasspath(DOCKERFILE, AGENTS_RESOURCES_PATH + "/" + SSH_AGENT_NAME + "/" + DOCKERFILE)) + .withExposedPorts(22); + + @Test + public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), + SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + waitForAgentConnected(node); + assertTrue(isSuccessfullyConnected(node)); + } + +} diff --git a/src/test/java/hudson/plugins/sshslaves/categories/AgentSSHTest.java b/src/test/java/hudson/plugins/sshslaves/categories/AgentSSHTest.java new file mode 100644 index 00000000..ea563b05 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/categories/AgentSSHTest.java @@ -0,0 +1,10 @@ +package hudson.plugins.sshslaves.categories; + +/** + * Category for the SSH Agent tests + * + * @author Kuisathaverat + */ +public interface AgentSSHTest { + /* category marker */ +} diff --git a/src/test/java/hudson/plugins/sshslaves/categories/SSHHostKeyTest.java b/src/test/java/hudson/plugins/sshslaves/categories/SSHHostKeyTest.java new file mode 100644 index 00000000..a2462472 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/categories/SSHHostKeyTest.java @@ -0,0 +1,10 @@ +package hudson.plugins.sshslaves.categories; + +/** + * Category for the SSH Agent tests + * + * @author Kuisathaverat + */ +public interface SSHHostKeyTest { + /* category marker */ +} diff --git a/src/test/java/hudson/plugins/sshslaves/categories/SSHKexTest.java b/src/test/java/hudson/plugins/sshslaves/categories/SSHKexTest.java new file mode 100644 index 00000000..de52d562 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/categories/SSHKexTest.java @@ -0,0 +1,10 @@ +package hudson.plugins.sshslaves.categories; + +/** + * Category for the SSH Agent tests + * + * @author Kuisathaverat + */ +public interface SSHKexTest { + /* category marker */ +} diff --git a/src/test/java/hudson/plugins/sshslaves/categories/SSHKeyAuthenticationTest.java b/src/test/java/hudson/plugins/sshslaves/categories/SSHKeyAuthenticationTest.java new file mode 100644 index 00000000..bea643ba --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/categories/SSHKeyAuthenticationTest.java @@ -0,0 +1,10 @@ +package hudson.plugins.sshslaves.categories; + +/** + * Category for the SSH Agent tests + * + * @author Kuisathaverat + */ +public interface SSHKeyAuthenticationTest { + /* category marker */ +} diff --git a/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java new file mode 100644 index 00000000..4a8bf7d5 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java @@ -0,0 +1,36 @@ +package hudson.plugins.sshslaves.rules; + +import org.apache.commons.lang.SystemUtils; +import org.junit.rules.ExternalResource; +import org.testcontainers.DockerClientFactory; + +import java.io.IOException; + +/** + * Rule to check if Docker is available. + * + * @author Kuisathaverat + */ +public class CheckIsDockerAvailable extends ExternalResource { + @Override + protected void before() { + org.junit.Assume.assumeTrue(isDockerAvailable()); + } + + boolean isDockerAvailable() { + int exitCode = 0; + try { + ProcessBuilder builder = new ProcessBuilder(); + if (SystemUtils.IS_OS_WINDOWS) { + builder.command("cmd.exe", "/c", "docker --version"); + } else { + builder.command("sh", "-c", "docker --version"); + } + Process process = builder.start(); + exitCode = process.waitFor(); + } catch (InterruptedException|IOException e) { + exitCode = 0; + } + return exitCode == 0; + } +} diff --git a/src/test/java/hudson/plugins/sshslaves/rules/CheckIsLinuxOrMac.java b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsLinuxOrMac.java new file mode 100644 index 00000000..6a52aa8d --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsLinuxOrMac.java @@ -0,0 +1,17 @@ +package hudson.plugins.sshslaves.rules; + +import org.apache.commons.lang.SystemUtils; +import org.junit.Assume; +import org.junit.rules.ExternalResource; + +/** + * Rule to check the Operating system where the test run. + * + * @author Kuisathaverat + */ +public class CheckIsLinuxOrMac extends ExternalResource { + @Override + protected void before() throws Throwable { + Assume.assumeTrue(SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_LINUX); + } +} diff --git a/src/test/java/hudson/plugins/sshslaves/rules/Retry.java b/src/test/java/hudson/plugins/sshslaves/rules/Retry.java new file mode 100644 index 00000000..e1f51c06 --- /dev/null +++ b/src/test/java/hudson/plugins/sshslaves/rules/Retry.java @@ -0,0 +1,42 @@ +package hudson.plugins.sshslaves.rules; + +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * https://stackoverflow.com/questions/8295100/how-to-re-run-failed-junit-tests-immediately + */ +public class Retry implements TestRule { + private int retryCount; + + public Retry(int retryCount) { + this.retryCount = retryCount; + } + + public Statement apply(Statement base, Description description) { + return statement(base, description); + } + + private Statement statement(final Statement base, final Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + Throwable caughtThrowable = null; + + // implement retry logic here + for (int i = 0; i < retryCount; i++) { + try { + base.evaluate(); + return; + } catch (Throwable t) { + caughtThrowable = t; + System.err.println(description.getDisplayName() + ": run " + (i+1) + " failed"); + } + } + System.err.println(description.getDisplayName() + ": giving up after " + retryCount + " failures"); + throw caughtThrowable; + } + }; + } + } diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/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+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/sshd_config new file mode 100644 index 00000000..b0980047 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-curve25519-sha256/ssh/sshd_config @@ -0,0 +1,15 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server + +KexAlgorithms curve25519-sha256 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/authorized_keys new file mode 100644 index 00000000..3da53d15 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/authorized_keys @@ -0,0 +1,2 @@ +ssh-dss AAAAB3NzaC1kc3MAAACBALuABB7ZLPgkdljfCza3BVTCuZ2M0QYpx3KuGd7WvSN3bgAq9luTLRpbjoyNEH2dIjk8NtMXY3Yk1MjDeN6OGhyPHHlaVtiBoA2ct62Q/17+FPObLtyXd3B2jb7MRUbW1dGRqinWQGr/wmrkyE4Q9yEes4rcEmRHXwNhP5l5+1qzAAAAFQCoR/mlasRxdgbCZCx2gM8ajSSCEQAAAIBMsluPPDcueeoePBvHnPAGV5o+2Kbd6vvUIfOtuwjtAYFtbEQQdl9wUQq57oRWDfUDeuE4kHNgsVoc5HwsRPY+mF94kC2Q86CraEnmAMXOOvEGdWAkngFJGvRmoyCSt8cVXSZTMF9IXWjArn1/ov1U/KpUEXV62k+Bx3MjYhnzswAAAIBRYcOd6Ng8p/DSTogFFBqAOSqoTvHLxtE9jYmeJISA0c3V396cc0oNHrUrJnOywX5AROjKzx8D5HkQuxQnb4n2vHFgmK4oRlfHtNu4zTWBQfS98Yv6o2Rbi0vlPoOHNnZM1DReGvQdWVinMfgxTDFGqZLmI4+KifnnHYHec9t3NQ== inifc@The-toxic-avenger-II.local +ssh-dss AAAAB3NzaC1kc3MAAACBAIRkGmYClOfQAADnNPWAfdjVcbFgLElXCDslFbn6T8xtCaxOAHDPhmbs9ZHxydRkfe3z+8AHJWs2ZC3OjkPiv90UO4/P9xozHkiBmfJ/340FNuRzhWAjVp5E9McPtQTXxR0dbuoaEHSqaXozGZg3HIeJOH/9t10B811LH0v6ID5tAAAAFQDzrk+j/PB+MLqZAnLjmZiWIufzywAAAIApxlvENHZPB4/q5eji+v2x7VQx2jsTBeVUbeY1dyWKre/nO/YS2ZG2iamt2cgcw17wf3FZ7Kymoatv7PNnhu76Lubjaq4tB7qBA08SwXEddyQLZyWXI5hyiySyBaGpXp/ViveSuNBbzIskr+GRDY7xzI3DoPCXgxwENJKlTFEEsQAAAIEAg11TglZ+DmUu7OtIaNX56vcdFGa14DGNjoUqtnH4s/JFttqqS55aZVKeQh8b+F8tSLptjK/IBS83n76bx+/cu+Ee3WDS0M2jnTGU/twKtL++7mkiQ7AdLH6JXmqoXGVgcfTM4zos8CNDXo+k+2hZuoX3yWrSBK68TPvMzYC4XfE= inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey new file mode 100644 index 00000000..3c88095d --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey @@ -0,0 +1,12 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIBvAIBAAKBgQCEZBpmApTn0AAA5zT1gH3Y1XGxYCxJVwg7JRW5+k/MbQmsTgBw +z4Zm7PWR8cnUZH3t8/vAByVrNmQtzo5D4r/dFDuPz/caMx5IgZnyf9+NBTbkc4Vg +I1aeRPTHD7UE18UdHW7qGhB0qml6MxmYNxyHiTh//bddAfNdSx9L+iA+bQIVAPOu +T6P88H4wupkCcuOZmJYi5/PLAoGAKcZbxDR2TweP6uXo4vr9se1UMdo7EwXlVG3m +NXcliq3v5zv2EtmRtomprdnIHMNe8H9xWeyspqGrb+zzZ4bu+i7m42quLQe6gQNP +EsFxHXckC2cllyOYcosksgWhqV6f1Yr3krjQW8yLJK/hkQ2O8cyNw6Dwl4McBDSS +pUxRBLECgYEAg11TglZ+DmUu7OtIaNX56vcdFGa14DGNjoUqtnH4s/JFttqqS55a +ZVKeQh8b+F8tSLptjK/IBS83n76bx+/cu+Ee3WDS0M2jnTGU/twKtL++7mkiQ7Ad +LH6JXmqoXGVgcfTM4zos8CNDXo+k+2hZuoX3yWrSBK68TPvMzYC4XfECFQCRkPdi +9X5QbN1RF5bD4qgnpOdQTg== +-----END DSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey.pub new file mode 100644 index 00000000..20d6d502 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/dsakey.pub @@ -0,0 +1 @@ +ssh-dss AAAAB3NzaC1kc3MAAACBAIRkGmYClOfQAADnNPWAfdjVcbFgLElXCDslFbn6T8xtCaxOAHDPhmbs9ZHxydRkfe3z+8AHJWs2ZC3OjkPiv90UO4/P9xozHkiBmfJ/340FNuRzhWAjVp5E9McPtQTXxR0dbuoaEHSqaXozGZg3HIeJOH/9t10B811LH0v6ID5tAAAAFQDzrk+j/PB+MLqZAnLjmZiWIufzywAAAIApxlvENHZPB4/q5eji+v2x7VQx2jsTBeVUbeY1dyWKre/nO/YS2ZG2iamt2cgcw17wf3FZ7Kymoatv7PNnhu76Lubjaq4tB7qBA08SwXEddyQLZyWXI5hyiySyBaGpXp/ViveSuNBbzIskr+GRDY7xzI3DoPCXgxwENJKlTFEEsQAAAIEAg11TglZ+DmUu7OtIaNX56vcdFGa14DGNjoUqtnH4s/JFttqqS55aZVKeQh8b+F8tSLptjK/IBS83n76bx+/cu+Ee3WDS0M2jnTGU/twKtL++7mkiQ7AdLH6JXmqoXGVgcfTM4zos8CNDXo+k+2hZuoX3yWrSBK68TPvMzYC4XfE= inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/sshd_config new file mode 100644 index 00000000..2da444aa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-dsa/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes=+ssh-dss +HostbasedAcceptedKeyTypes=+ssh-dss +HostKeyAlgorithms=+ssh-dss diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/authorized_keys new file mode 100644 index 00000000..c4bd7557 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/authorized_keys @@ -0,0 +1,2 @@ +ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAFA6uJvyVvpQ66pJjNJqQVqXJv/IqsmCassTi7hU8H0unm03Lr6Y6oiQzhLzydDIOkUOeFtdWlD0W6m1iPh9e0GZgAOm21/P/rw2K0lM6TOw9+WNOpH08jgNr7ZAi4h9s7j8BC3kAOPtOCveTd56TRMloaraRSboibuHkZHJp3em98m3g== inifc@The-toxic-avenger-II.local +ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBACrCEb4WvC3MpRjVlRQ8t4BaQr0AlORvs7Aoj7o/BGCgkRx67eilJgi/xDa+DNEZU+fquFfcRCNQZC2DXaoE+5llgEVRq5mTb1WjjdKwSRjhPAXuVozy8Cgs4eghkPwMdmIJNTj9EVTpDHJgl+leMUY2PtTMRHkbwFEemlVH9BY7PaLNg== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey new file mode 100644 index 00000000..218b4743 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey @@ -0,0 +1,7 @@ +-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIBeIQ4dghknd6NyyT3NLUxALQoCbtHGoBp9b5E/G5oD3ooBpndp88t +9va2XMMItUVH7XVOt7/Wo9L/OsMdw9neZHGgBwYFK4EEACOhgYkDgYYABACrCEb4 +WvC3MpRjVlRQ8t4BaQr0AlORvs7Aoj7o/BGCgkRx67eilJgi/xDa+DNEZU+fquFf +cRCNQZC2DXaoE+5llgEVRq5mTb1WjjdKwSRjhPAXuVozy8Cgs4eghkPwMdmIJNTj +9EVTpDHJgl+leMUY2PtTMRHkbwFEemlVH9BY7PaLNg== +-----END EC PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey.pub new file mode 100644 index 00000000..edfe248e --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/ecdsakey.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBACrCEb4WvC3MpRjVlRQ8t4BaQr0AlORvs7Aoj7o/BGCgkRx67eilJgi/xDa+DNEZU+fquFfcRCNQZC2DXaoE+5llgEVRq5mTb1WjjdKwSRjhPAXuVozy8Cgs4eghkPwMdmIJNTj9EVTpDHJgl+leMUY2PtTMRHkbwFEemlVH9BY7PaLNg== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/sshd_config new file mode 100644 index 00000000..ed2a3e0b --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ec/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 +HostbasedAcceptedKeyTypes ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 +HostKeyAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXIfuEUtyH8DcV185JYr0OVDy+kMk9YYJef3KZ1YbtsprWBHR/7K +HcN2KcbQ9AkZRU1Xb8b7m2tGde0+gIXiDYF4kaEocvcxTHAozlPgm3ue5++4S5q6 +CinzEVXlWu0dXHil1KvLZjdq6qG46XwCx1k9+G3RASaFxkzuMAqxZTs2Njc+Hj4N +Xb+gqI6aNSAfVzPYTL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VrPTN72NgBqeopc/0olmzgv4X ++VRE0JWaRMUVazmS7z03chDhDgO7GaZP/1do+NPi4z6Q8grdn31zjB55oEzckHP8 +FydrpHEdhFGZHMGCDRvLRvq0xcIGocLRJsvhTGfF/CrHipRc+0oR92xlgxDUcQ/Q +gWUfwcsKg8Gz9OllD76xn6/HyLGwfjV207eNgV9gj0E0H28KhrP8AZPbMHflrGZa +N6JTQ/w5YLTkaaFLHcwm6Kw8WXEl+dFHMQKCAQEAwF2PLHD8FzU/wayOanMlsnxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/sshd_config new file mode 100644 index 00000000..64af33e0 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp256/ssh/sshd_config @@ -0,0 +1,15 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server + +KexAlgorithms ecdh-sha2-nistp256 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAK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VMIE9472tCYIYcVf8fcfs/kU3X1LZleq+CkB +FPEFfhKoVahlEWPN/KTG1AlcGW+hYY/UiRdU6+CmZHc30FCfvKIfqZG8nGNNQE3e +fHycstMB9HUzKwjgSGMGQ6Yfy8IklGFnsjLNMmrvGAgtLGvi2lZ3kjHUvwDrfiAg +QQADHtcImF7JoCC92k0XDTT7Rl8X7uepIwofZNrIRNPDvt7fMDPjEn270GTsbba4 +G+Yj5ESTd1HS1zioMuZI9t3rQu3zKzGi05NErrJCt0Q885uX6inurbdlVDYO8pc0 +nWcAWwKCAQEAsTAkyChxYYVwhBfH7eRy2YZAGEZnHled8inWDMoDNO41PdqBi50t +kZw5Nqz9yTLXtSATZx9soJ9JcjaEhmvsIcXqFnmVrPTN72NgBqeopc/0olmzgv4X ++VRE0JWaRMUVazmS7z03chDhDgO7GaZP/1do+NPi4z6Q8grdn31zjB55oEzckHP8 +FydrpHEdhFGZHMGCDRvLRvq0xcIGocLRJsvhTGfF/CrHipRc+0oR92xlgxDUcQ/Q +gWUfwcsKg8Gz9OllD76xn6/HyLGwfjV207eNgV9gj0E0H28KhrP8AZPbMHflrGZa +N6JTQ/w5YLTkaaFLHcwm6Kw8WXEl+dFHMQKCAQEAwF2PLHD8FzU/wayOanMlsnxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/sshd_config new file mode 100644 index 00000000..31826414 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp384/ssh/sshd_config @@ -0,0 +1,15 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server + +KexAlgorithms ecdh-sha2-nistp384 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXIfuEUtyH8DcV185JYr0OVDy+kMk9YYJef3KZ1YbtsprWBHR/7K +HcN2KcbQ9AkZRU1Xb8b7m2tGde0+gIXiDYF4kaEocvcxTHAozlPgm3ue5++4S5q6 +CinzEVXlWu0dXHil1KvLZjdq6qG46XwCx1k9+G3RASaFxkzuMAqxZTs2Njc+Hj4N +Xb+gqI6aNSAfVzPYTLm8dUGvSa5y/lHPKkJlQoX7OTL/sc0OEN4fwbY8Q3TSr02A +NwOsed3IqzNj8PpuV2GBGwe3NG17x3ClvXHsCOtT7UUVzs+sOyz76J/uPlf3RiGs +F9SYvG8ui4m9dyRGL3hB87vRmUr9tLRIk9r6T5+fb17BnMbLTlwLqQgtRnOSDISH +1yU3pnEvmboDhyYrGc78MHCoMCuHF7PbFpGiC/rKdiurJigvksylxUExrThmIRHZ ++vCJjVTdhJdJ76Yb5f35lY/Zts8Kil0+TPXVW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nxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/sshd_config new file mode 100644 index 00000000..ed4c386f --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ecdh-sha2-nistp521/ssh/sshd_config @@ -0,0 +1,15 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server + +KexAlgorithms ecdh-sha2-nistp521 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/authorized_keys new file mode 100644 index 00000000..d27c439b --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/authorized_keys @@ -0,0 +1,2 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqJQOoriErxxy+uvboaC6ADzZWiyAN/ZERFxt3tHW2z inifc@The-toxic-avenger-II.local +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPRPSAhS3dFyNAlnxKPoewUppNgO5rYXo1YUIlc5rz+q inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key new file mode 100644 index 00000000..8645f826 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACD0T0gIUt3RcjQJZ8Sj6HsFKaTYDua2F6NWFCJXOa8/qgAAAJACR0HzAkdB +8wAAAAtzc2gtZWQyNTUxOQAAACD0T0gIUt3RcjQJZ8Sj6HsFKaTYDua2F6NWFCJXOa8/qg +AAAECIeu3SkXljb1tGkH+kEJNNK2g19QbPz/Vi9lZVU45A+/RPSAhS3dFyNAlnxKPoewUp +pNgO5rYXo1YUIlc5rz+qAAAADWluaWZjQHdhcmhlYWQ= +-----END OPENSSH PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key.pub new file mode 100644 index 00000000..32f47808 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/ed25519key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPRPSAhS3dFyNAlnxKPoewUppNgO5rYXo1YUIlc5rz+q inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/sshd_config new file mode 100644 index 00000000..52bf1b50 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ed25519/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes ssh-ed25519 +HostbasedAcceptedKeyTypes ssh-ed25519 +HostKeyAlgorithms ssh-ed25519 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/Dockerfile new file mode 100644 index 00000000..df485831 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] + +RUN rm /etc/ssh/ssh_host_dsa* /etc/ssh/ssh_host_ed* /etc/ssh/ssh_host_rsa* diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXIfuEUtyH8DcV185JYr0OVDy+kMk9YYJef3KZ1YbtsprWBHR/7K +HcN2KcbQ9AkZRU1Xb8b7m2tGde0+gIXiDYF4kaEocvcxTHAozlPgm3ue5++4S5q6 +CinzEVXlWu0dXHil1KvLZjdq6qG46XwCx1k9+G3RASaFxkzuMAqxZTs2Njc+Hj4N +Xb+gqI6aNSAfVzPYTLm8dUGvSa5y/lHPKkJlQoX7OTL/sc0OEN4fwbY8Q3TSr02A +NwOsed3IqzNj8PpuV2GBGwe3NG17x3ClvXHsCOtT7UUVzs+sOyz76J/uPlf3RiGs +F9SYvG8ui4m9dyRGL3hB87vRmUr9tLRIk9r6T5+fb17BnMbLTlwLqQgtRnOSDISH +1yU3pnEvmboDhyYrGc78MHCoMCuHF7PbFpGiC/rKdiurJigvksylxUExrThmIRHZ ++vCJjVTdhJdJ76Yb5f35lY/Zts8Kil0+TPXVWDrNI0cKv1W4dOCTg+paSwMCAwEA +AQKCAgEAra1i8eXDObgvibh9Skixt66qvi3e0WosAjLVcKx7gMC1ykTFYpgSJ+K8 +2XMA4WLwQQcOjlO5IeWLlBRTM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x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/sshd_config new file mode 100644 index 00000000..3bb2319e --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ec/ssh/sshd_config @@ -0,0 +1,13 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/Dockerfile new file mode 100644 index 00000000..51aff637 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] + +RUN rm /etc/ssh/ssh_host_dsa* /etc/ssh/ssh_host_ec* /etc/ssh/ssh_host_rsa* diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXIfuEUtyH8DcV185JYr0OVDy+kMk9YYJef3KZ1YbtsprWBHR/7K +HcN2KcbQ9AkZRU1Xb8b7m2tGde0+gIXiDYF4kaEocvcxTHAozlPgm3ue5++4S5q6 +CinzEVXlWu0dXHil1KvLZjdq6qG46XwCx1k9+G3RASaFxkzuMAqxZTs2Njc+Hj4N +Xb+gqI6aNSAfVzPYTLm8dUGvSa5y/lHPKkJlQoX7OTL/sc0OEN4fwbY8Q3TSr02A +NwOsed3IqzNj8PpuV2GBGwe3NG17x3ClvXHsCOtT7UUVzs+sOyz76J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RvLRvq0xcIGocLRJsvhTGfF/CrHipRc+0oR92xlgxDUcQ/Q +gWUfwcsKg8Gz9OllD76xn6/HyLGwfjV207eNgV9gj0E0H28KhrP8AZPbMHflrGZa +N6JTQ/w5YLTkaaFLHcwm6Kw8WXEl+dFHMQKCAQEAwF2PLHD8FzU/wayOanMlsnxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/sshd_config new file mode 100644 index 00000000..3bb2319e --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-ed/ssh/sshd_config @@ -0,0 +1,13 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/Dockerfile new file mode 100644 index 00000000..0d3df278 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] + +RUN rm /etc/ssh/ssh_host_dsa* /etc/ssh/ssh_host_ed* /etc/ssh/ssh_host_ec* diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXI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7uepIwofZNrIRNPDvt7fMDPjEn270GTsbba4 +G+Yj5ESTd1HS1zioMuZI9t3rQu3zKzGi05NErrJCt0Q885uX6inurbdlVDYO8pc0 +nWcAWwKCAQEAsTAkyChxYYVwhBfH7eRy2YZAGEZnHled8inWDMoDNO41PdqBi50t +kZw5Nqz9yTLXtSATZx9soJ9JcjaEhmvsIcXqFnmVrPTN72NgBqeopc/0olmzgv4X ++VRE0JWaRMUVazmS7z03chDhDgO7GaZP/1do+NPi4z6Q8grdn31zjB55oEzckHP8 +FydrpHEdhFGZHMGCDRvLRvq0xcIGocLRJsvhTGfF/CrHipRc+0oR92xlgxDUcQ/Q +gWUfwcsKg8Gz9OllD76xn6/HyLGwfjV207eNgV9gj0E0H28KhrP8AZPbMHflrGZa +N6JTQ/w5YLTkaaFLHcwm6Kw8WXEl+dFHMQKCAQEAwF2PLHD8FzU/wayOanMlsnxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/sshd_config new file mode 100644 index 00000000..3bb2319e --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-host-rsa/ssh/sshd_config @@ -0,0 +1,13 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key @@ -0,0 +1,51 @@ +-----B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resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes128-cbc b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes128-cbc new file mode 100644 index 00000000..589f4782 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes128-cbc @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,3931899F8F20CCBDA0692CAF6BA5CE9B + +08ZDNodAC3PvI+nfpt0qQ37CRUH/wR89zWprjV3LFnDM7vFcOuD9BhXpXE8rT9Jj +Nv65JUlUlRhPFApnxaVetmgLnAGyRh1w9j67Ea4Rod2e9ZHYlBhOXOTe8T2LgSs8 +AzODp3hVayD+lHCsQ3MreuyDR+ePDcmJ+koL7xkI1AKqIJlt7H2BgcfK97E46tYk +BGs24e1bIACDXnc7tqEg1b8Sbpdb67d9jLg3V8ch3kCT22ZWTGWGf5tdwogqBUob +YtRkLTcUs6+kp0guruKfZNd8S4BFQg+V7CZ4l+zyNz2y/PAFcThtydPgodVf5e/j +a0X7rb8uDFG0tGEjjb2YV+9O2HlAsQ7P/j+eKNS3P6CVtp3ev942KSmNvSFGp3XJ +353Y5VZoTxhQo4kyX9zuEGHHpnVvAIQlwbuX2OX2dcMlK8YrPPR0TufMpGVC65VA +DqwS8QY+H7WKfDN7i1bl2BROqSxo++ywq5fxQ2RkyCiHyik/NdQ6oIVTkC4TSS9p +OlT5BMGb3wULDDGE1aDgQaYOg4mNZMDtfIPZ1H07rLTfIzdlxLymUP5S3aedscvH +ns9LM2+2HqPz+1btgsfdqhlNbBpo8uuYbgTGDn+0nkiCrX+IbEi+0C7obfuJ0Hhs +uDYxu4MtG7T6iacX2nF9TfLizhAPxD1wVRhytPctPyoaDrwonwutcxQDfhbeQmr0 +1TRrBt4PnDaF8ZIWD9zTiQMlLOtDoW7+9HgowNok3JeMwv4Oh3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Tl4sXbeL7y6rx5/uCyITaemXulm6rRKG7Y +WPOOKoKTRrl1C4rOWmSsVehhZrMFQ768L66zJHEQscvgHftQR6whOBdthd4+aiMN +usgzywsnAOl5OX6oPSJuIga/yTaDT3xSui7W7K3opytwG01LaOW9KvusnT+kGd5R +zU29s/ftdqezsLbVLv7tdk4HNuI+jvMhlrsEw4nb33tu9ScuXFTUGeaa5d1uI9Zm +cGFS2Ty7rAZwzt3ko82TcmUVCBbkYFfTce9cI9GuZv9/0iZIdJZSG7ZzbCLPIn8E +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes192-cbc b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes192-cbc new file mode 100644 index 00000000..694229d1 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes192-cbc @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-192-CBC,160CCC8D8DFD21740AF14F59C43F7B6E + +e+tmJbmIZfIf0aq8Pak6fAYxxrVvOe+4UgT3QGGAZhZXz0T++A06hGQl32cPXvcY +BIx3GzV8FjYWh1nmrrTfWWrZlfLeg3kdFgSovhFrrxSqCH1ey26XEMdNOtJt3wZT +lkF0VPdQ+Dpu5EjoekHc36ewYVdTuNrhJ2rGxsdHOq+tccm7UE+xSFfvY45fE9+b +6JM2s/F9kdvG+hyD/IMlfRVb9wTtbowNUKhAOYNlto83JhuzJvZNFKNnEiD439q/ +PleAVflN4fwXTSDpwxeXrCDwG6K32LgrhOnYj7xwSfcjoPQI9xm086KpOUXhO/Ym +EyD03OS6yv8Yk0EBXHP4y3T7ZI4hKte7Ad5dOBpK5gU7QidfHP8NVmVuKeSTpxxA +xMfSQI0mRqSGq9aLOH3xL7vQYgmFb6FqE+v2nv+5tF0pO3swz3N4ef08B71U4m7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bZWxqt2MdRTvIGXJIP8AD6Vus4Hyv/iqZTd13N3hRj54LwC6 +K/kPfMkAHRIoqIn+NTJx7iKeF5gjDx6ynYz0P+vl9AlZVkQIqMpw72KMAhLQPbJg +/766yzs+fe1UgGmKcKIiGEffONuU4fZV/a01npu2mOqREjS1rIbln83jMH5sVylW +B4aeYyb5Bbz5VVSKs8DfWtCiwP6MvfYX87pzpWAQ6VYlmVuEWE5trTj56sbaMpPY +O6Igmg6EMYFAcvnBQW5SCPVHZ21TEV7q2bCpfmgmC3Ro20MdzLWapCy05Go3TZs/ +1vEbiZ2HfqL5mn5DoDyrBiwCNHEQx3sUTqnc/bWc+8vASrLf5pYKvehxktBWesv+ +R/LVVfBBIEL3v8esKk5z3oR7B8oOBbjmOLAnayvyohz10GysRbqMdr5zhY016v8Y +yQJKokGvJLiWd7oBeVlpKCZ9ZbtcunYlyocf3OcOM+hgyMNIicrtLVuSy/PEGPYR +fTNXNiQyGd8345uvCXXVT1NFxoG2zD2WdcPo7zKxlCPeRJtDFY2mANnPPl9ajRyE +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes256-cbc b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes256-cbc new file mode 100644 index 00000000..24de7e0a --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-aes256-cbc @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,4B27F143A3534B0FD1271F1431962727 + +Ux+/5oY+z0VXnEH9RlocOlLVh7yLyLW8w7HWaDVqzrqvMTNfsYDicsT0ITl/OFVj +kHqnyAp2QEF8QT44uU9QSv8jukf9xF9r4ja4Yl8jziuUFKqIagdybmOnFz7J+1LE +MdvA6EOG/RpK6i1rVMUzX9Q3dyJgvkBmvj93f2AZlKrXUmF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xWXnR4Ta+PnTYifvHPvPHgvtXCno +bzbwCs7Q9FKczckBZffkIjL7rhaeH1LRYrcXd0IYlNW5tWm2CVcW7fgnfh++12RZ +QDUwlvvCQKZIgbLXlRMhoZEFhjbJ2xP7y1iECa/W2310dVTaQ/K0aEew+A9Vu5ps +jn/CDjkz+z4pPgYnfv9y0wfzlSOGV0j8dnDuBqon4pcU0DyKc8W14tIEslJQgKZc +oqR7RX7eTYafGFCrBKOfrBfgCnwjYVP5hDo864VgZ4HQ1SrsZHladQFXLM7bXyWE +LsEltPzoL/5hg8u8fO3ctc/vtOkYUyVkyV78y51xi6//28LRewxLGuCrBT/W8D2E +Q39n1HW8UJmJ2+mLghlBZMT6d3j+aG5J0MmoZE3ZMXO4pzoyimQhN0LZ7Hkwq0Wb +hJc/Skw7sGxOsO6UGpK5iHPxgOgQiUGrQAu3Jj3eYiSyuQEEOktQzViKliBYUnwn +kanBhnW7JiiuY6aRV8ARv4mcajRIsNcLcIPsERLsuFmLHu5M5gwf++5+9dhYhN4Q +gkU0FkUuqUvAmLbuVJY8bqB3xzn7m54XZV1BwtK052VQZpjFn039FCuw3+Z5hx5N +U9syTz6XALjBsxJ7snd3Pxo7Eo6kj5m8aVzwOdZAjTwzIKLbYW5Escvwoql64+sR +b+7b8lkqrrrwMDw16pj4y6CqXUEYLTljnwDLQAIOmYOv2N6bhiSiHmoo9fuhwGFi +kBwZeZoz614g0aSsC2QbiZTnZ7/ASqSYDGhwMQl5HeF4r/ZegPkT3nTHN40B4IvE +AhvhTDfkv8PiajMSGScNeu/VWgAn2jGTDmOvk4/KxQ84q/Q04OVzSJqn5roNnPC4 +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-cbc b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-cbc new file mode 100644 index 00000000..1bbc58a7 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-cbc @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-CBC,41228C5CF14D6ECA + +pY67leTy9afAiZkt5BCN6JmjMDE7BAr5Tn4N89FypcVW1j1JKt6yUlikP7g8e537 +W5U2kzOKn3D0rvj50wrCQsxthqQVNnVTKDPWg2ywQsXQkorrl88N06rcFj+gDjzR +2GGORu3e9Bma7qETuKqVfOjCm465RM+HxsZlOLtTWM3QlK9kr51qjC0gMi1I25a5 +CHol/GdEn80xTdwDh/bTo0jvIPa1MhjwNq/SEwVaxLjOS3EcNbiuDVtQn94C8Pxy +DoZtlyEsKKQKgW06aT839rfyT7ay/05NOEW0SfXHr9WDyupvDJMByVpMR05KcizE +um/bMj4JTQItQX5gP/8yLG7OR3acd1/H3LsJIIXEXMVWgI98OX//YmAIXxzouJRL +c98PGa0IcuqN3dRQvth7MWO0GFze6wYA3DVCb7Vx9FLe6JXZqLwhlA643aTjmgD9 +lDSJ33pEWs+NYSTKCFBm4OuirwrfoMlfb7WLR31BSsMrYxvTqwNxKpSHKTO7Y6PR +vGpwM5n5uJapVN+Dcxd7s1A/qNaCwH/BE82XblTwEwcH0WbXUddnZyHEReyBL+fv +wcryxKnuBkYy5H7TBvtfcXtsy0sxMKY7nvLcYTMCj8D1b9cwu3TlChDkaBoAo5XE +KFGeOI0xoWaAIIK7JPFDKD9RyXkSUCjREl/EUaEXsihK2AwYJt8gNEfPiUwtDhvj +VoPLIoQbJDKPMGI1kZlsLW+5HknAWhSu+uPT+u5LUiPAqruO/N/bszXorv/PzQBi +IvqoRz8+z4yO/Q1m/7d6rIMGZZ4ksnA63aao5nrA0rgFQ7RaAKSW7jMjPNUq+PCc +8EeLqF+vXGChgJmBFZH8PCKw90YAFmIfQX2DNA08bhMNmSxJAtxJkbR83otYyFou +p3MTg+efZ+4OugS9funQxI1+KRIU0ayBVc/8kNgCZcfEuT4oi20/EOzQGm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tWh8y+UOLgizloGJau +pYnOj9U9EmtzNow8+NrVvYWaS07H3aFwWRXkGYBy2KfWEkEotYPbGxFSx+HcFsGE +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-ede3-cbc b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-ede3-cbc new file mode 100644 index 00000000..7baac617 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key-des-ede3-cbc @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,D5A0E38769AB0274 + +LFg86+vfLGCU1H7zoX0rI5wZRjZE5NQKlPHdXug0Bt4F8Tw+xC+2wTC8U/nf1LpE +9J06KqQ5nPJtQ8CzQBvzXteqTXdGlcJBv6nLZpfswSUkk50WB6DX8MH4qCLEFV05 +kNhsTev4FPFACw+D2ZzqM0qnlFod/WG2ZJJilTXkdJbm3OIqlqxmc8T97BQS2qaw +jb2hX8RmQuJPR7x/t+L2/hFMdITMjdBwQcaxlKdZsik2Xyx/ajPCpXiRPFXpWuWV +qSgZ+DYpGMBSbgqP1V781tFwwgJ6XKTZaL6sOiVHrL0NynsUZXqYml2i0NLd8qsT +fPBHUpT8WJY3WGIEZx+gLSX/DXDzPhxY58dWQq+E0VpSmtO3Mgovq2t47I+tf7T4 +J9UDIBd5lVsL+z6GMZFKPRMJvDcuqVfK7Cp/Zl6xGM+pGCYKJ9kL1rKoYJf4Ihnv +h0U9qCx9BgowuZf7MZwS5pnaJrMM9qIEJBu2afvmoyDFiQHw10mX0AAyQJoLnNtG +BAcX4QaDZoiXVfPehIQctoo7vVRQ1BoPAToiDbl2tj9uG29D134GdD5rQIJdUNhL +SWWxLZJyPSoJFtgo50LTSy5IXPk/VS3RC6ZgyM8Ahdhx9L1M8pkhP6Q8BgEFE5N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1GK0+StrRCd4bBCVgTEBCiiWgaQcI5Yoar4bXiuJdTMW/fSty+cwenSawqzpVL +E4QLiq4iB10ql6i8w8giinhLJ2GtNUybJ96jyIfRT44r+0pKDIXdibV3OelVIeYA +0S/SzKEmskSdOO/y96MtWHhHakTO4/rZh65vZyiQzj7ehQv6Sv/8p5joOmA6j+Ai +13FcHX/z35OTTbfAvQdrzShjQXpoBq7cWIdtsSnG6Zvn11jzbBqGI993ibmhN0oM +cX6Qp4gpvKJHKBirPOMIh19b19TXkoijtKRPz2vKSiSSwxvqlPJW+YktEbquvguP +FWzCGcUEBMfyjgFVa36KtwGuWcPDKLkeJtISDY4i4KSvbePzBhNUs3XfEDtGvF33 +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/sshd_config new file mode 100644 index 00000000..c0abd87a --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes ssh-rsa +HostbasedAcceptedKeyTypes ssh-rsa +HostKeyAlgorithms ssh-rsa diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/authorized_keys new file mode 100644 index 00000000..d6af5292 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/authorized_keys @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDW3NDkkJ6P+xWQJxikh6uT+M0havQHM0u0GG7JfyhxSrw2ZUaDOye/Qx5vtV722OJ8RZM+Pqx+R2ykqFu0uGp64dn4Zdgn1tCzcjHBZzT2AD4bu0Z6NnIxEx4I/BR/bIELwbQ0XEgzowO17sDhkROkG4MxQ0Bq6AXv/+3HXJlQ+DgU8ntzQLzqxBNO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aTfzL/w7ogBqd05yQipSKVfJ6zsmN7OT4XB5tFIix4TPimeH4f91BIM4f1F/8Vd6mhZtMdABfeUKCqZIOqxFrFD/fwmTDfMZ+WewGIcSxQ0vlZHlEZJUfu6drlBGJl2FuJhEzkd0L/+wTrkxkjw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key new file mode 100644 index 00000000..cd5cbf77 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key @@ -0,0 +1,49 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn +NhAAAAAwEAAQAAAgEAnc2AlILIeVgmcwEk2p9fh+9nhZraRhHd6pS0pKZun1hhjuTe4D5j +J5reVxoa1493HuZFkQ9ihLHR6G/UAW3HZUdM0suTlO3EX882WHi429DPmlsC5Z+nyOdJqA +SFGpUER+9vZoIhSwAzItXaA4/usVINWei/fKlRAItkEAuu6qpy4JnosXUYuDA1/9oDOVuH +sJjSseGrWyW8n/RmyQsrrpFAjnBs2DpUllnGPQivwXe3ri9c0oVIi/NWzSkiPk1SiiRoB8 +GulTYO/iHhMqTxR5dNU4GljKEbrQHdmAxeHN9TY38fkeULmVkJYo3rfsTgdaAAR8pi8Bmr +p+2RdyWASWlpI7Eyy/CeoXz4aPuEggUxzQzOFC/3oKKsdQ91VU48z0500yEejEf5vcnwOX +IDfERu3smi6BIfCS1sK4Oqh/zpJYp0OST/n7CALVxmro+IA/CcCY47z68xwxGWDyh+ASVi +WWNxmtnNbySj9LeXLvXBuE/17y+g/9jmnOyEf/Z/GoRtDXdYyhyKyyejlWhr8lpKGk38y/ +8O6IAandOckIqUilXyes7Jjezk+FwebRSIseEz4pnh+H/dQSDOH9R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E86/GtW0lBHPStvrRHFqSH1GMDl7Jc4wAB9V6fMXku5N7u540370T1l61BL9yy3QXXZF8 +GTyXgZ2ixlo0EAAAEBAMISX7PvX01v+2MWr4oxDRHpaTGRQKjLukDjGg5hFhi2PwM2hixt +6tEyIhIj/WIHOqfDK8P8Cz1lFNogIoNXvxFmP5wjpC82U3QskmFsxWbkofQjyg5/Pjei3k +QIng6/SZnngvnkXhr3GyomNx0qTTZsNP0M5izlI8UXOmE46BEMMi1V1sFmp8Is1e6nXKdp +mED3CS1MSdFuQd3IO2gNkiKF5AZIUbnfSeqcL0b8i2ZrDRTxiQ7wNp55qbxbFTg7mDhh5n +TUvmbq+rGMlfu4OTV5/tZ0gZWfyfeVBT/pAF3JUjpTmS/heq6zzw4Oa8k0NKqZmMxyOzYa +OedrpZVro88AAAANaW5pZmNAd2FyaGVhZAECAwQFBg== +-----END OPENSSH PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key.pub new file mode 100644 index 00000000..d85eb6de --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/rsa-256-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCdzYCUgsh5WCZzASTan1+H72eFmtpGEd3qlLSkpm6fWGGO5N7gPmMnmt5XGhrXj3ce5kWRD2KEsdHob9QBbcdlR0zSy5OU7cRfzzZYeLjb0M+aWwLln6fI50moBIUalQRH729mgiFLADMi1doDj+6xUg1Z6L98qVEAi2QQC67qqnLgmeixdRi4MDX/2gM5W4ewmNKx4atbJbyf9GbJCyuukUCOcGzYOlSWWcY9CK/Bd7euL1zShUiL81bNKSI+TVKKJGgHwa6VNg7+IeEypPFHl01TgaWMoRutAd2YDF4c31Njfx+R5QuZWQlijet+xOB1oABHymLwGaun7ZF3JYBJaWkjsTLL8J6hfPho+4SCBTHNDM4UL/egoqx1D3VVTjzPTnTTIR6MR/m9yfA5cgN8RG7eyaLoEh8JLWwrg6qH/OklinQ5JP+fsIAtXGauj4gD8JwJjjvPrzHDEZYPKH4BJWJZY3Ga2c1vJKP0t5cu9cG4T/XvL6D/2Oac7IR/9n8ahG0Nd1jKHIrLJ6OVaGvyWkoaTfzL/w7ogBqd05yQipSKVfJ6zsmN7OT4XB5tFIix4TPimeH4f91BIM4f1F/8Vd6mhZtMdABfeUKCqZIOqxFrFD/fwmTDfMZ+WewGIcSxQ0vlZHlEZJUfu6drlBGJl2FuJhEzkd0L/+wTrkxkjw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/sshd_config new file mode 100644 index 00000000..a792fc2e --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa256/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes rsa-sha2-256 +HostbasedAcceptedKeyTypes rsa-sha2-256 +HostKeyAlgorithms rsa-sha2-256 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/authorized_keys new file mode 100644 index 00000000..802ef736 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/authorized_keys @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyEAy6D/jHzFdnm7Zq3WgomqoU3HbZbvA2zNCSr+qHVTeN80c7u+KEt9On9zlUjofqZFHhdvl6nlLlgH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qZCQpI54ZPlGXtnURLwLXNqRb/Gvlb41C68xr4QvmbACgdo7VD4zzK+ohz4WJyXM6pcBYWtwTFb0NHAUSneN9d029FP5/zgoLrWfvD+m3l9Ot+XyPniH/LL4BhWb3MAq4O9MzEKd9AUnsRH1n1NF94YwMnxqAMTnGFe8D0w1R5O4CCFhmEHybTabTyadKLyQViHUfH+Afun0mfqKJtVrqpOedYy21rEEiPRLQ3yUbiqQ/HfhPgoj0Jr3+uiOW40+w== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key new file mode 100644 index 00000000..f65c23ba --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key @@ -0,0 +1,49 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn +NhAAAAAwEAAQAAAgEAnlabqLIcPrvozz7CowGhP38T/kPK1ek0UCztoiBTRpQ3AxW2/yIi +FZPR+F36m6pPT86mQgrcL0028SlWoEBSK+vchCHWidDpkqsnHWD+FV09nGHUfWl9Gev4Ow +wcvNfFQXWBpTRg1bV5rbrrN+KAPUWUTLwRnvxSW/doPnCE/fUBzoMVbNt8zh0qLK/nqIHV +zV6VrEqdo7LVfIrZ33w263ymmHpHBdcS8+8yw9npSJu9Q5Tq1BLVnkY7Fk3JC0+vqWYO/Y +4hPB1RdmAmAUXJ33jrB7DxTnsNgtpxEHktea20cu6bqPz3UEmu0M+Fe2Zyk/y430XgLncT +Bi5VAripQuRoG6Gm73mWaKTZsTVgfvpfiUWnAHRwWkJPGRdF0Pdq8QK+nsZpG5IMgIPpmi +eVAqod2rK7IUgezV1ZzykxZuqmQkKSOeGT5Rl7Z1ES8C1zakW/xr5W+NQuvMa+EL5mwAoH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Ic8Jgssys126yLcU3iLoI08lUUcauARxsZoCf5UtS +jjs/6fBLUUPp5S1YScWBPod5Mf3gW/SIcUUrkPJW3RUvN5vn/M3lgxli+UZl3s6TnZ1H0F +ZuLQZsuoWxWVbqP4uehi3XJQKEyxAosFrG+vdfTsCmSGdsxWS7Qw9iqhrpYK2Otgs1y5It +hBU4TOGcewr+BHAAABAQDIWqE1EE2DL5iDf4H/ds+BqDJnmbmylNJ+I2uXpuk4Nq6pMWCO +WxmVGmr1hUfJKnYbpYg884Li0G6Xr5+ruGUvVP2nSvV/LC1UbHSD1YOByYc/nQeyx9+cWc +DwMbYITHQJ4kjcTQ+c8O6fjjfSc4HxBxbgmgU6dt10bHN5tFBeIvQgX4Na2mW0cTPOgYG/ +a1zsyVnzlW3E8GlB00a+Y8yVd2h0nqSKkboPWhy5ucSrh0mrr2dI6cmK5ebN3TfbTkd+Aj +s+NzKW/PvGc4TwEOnjzru5ZaQyOorDE1ucVxRZo9GeLOFd5q5pLlxdfu7IxBORy+0cfu1d +KtDWfVMULrOtAAAADWluaWZjQHdhcmhlYWQBAgMEBQ== +-----END OPENSSH PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key.pub new file mode 100644 index 00000000..8c88869b --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/rsa-512-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCeVpuoshw+u+jPPsKjAaE/fxP+Q8rV6TRQLO2iIFNGlDcDFbb/IiIVk9H4Xfqbqk9PzqZCCtwvTTbxKVagQFIr69yEIdaJ0OmSqycdYP4VXT2cYdR9aX0Z6/g7DBy818VBdYGlNGDVtXmtuus34oA9RZRMvBGe/FJb92g+cIT99QHOgxVs23zOHSosr+eogdXNXpWsSp2jstV8itnffDbrfKaYekcF1xLz7zLD2elIm71DlOrUEtWeRjsWTckLT6+pZg79jiE8HVF2YCYBRcnfeOsHsPFOew2C2nEQeS15rbRy7puo/PdQSa7Qz4V7ZnKT/LjfReAudxMGLlUCuKlC5GgboabveZZopNmxNWB++l+JRacAdHBaQk8ZF0XQ92rxAr6exmkbkgyAg+maJ5UCqh3asrshSB7NXVnPKTFm6qZCQpI54ZPlGXtnURLwLXNqRb/Gvlb41C68xr4QvmbACgdo7VD4zzK+ohz4WJyXM6pcBYWtwTFb0NHAUSneN9d029FP5/zgoLrWfvD+m3l9Ot+XyPniH/LL4BhWb3MAq4O9MzEKd9AUnsRH1n1NF94YwMnxqAMTnGFe8D0w1R5O4CCFhmEHybTabTyadKLyQViHUfH+Afun0mfqKJtVrqpOedYy21rEEiPRLQ3yUbiqQ/HfhPgoj0Jr3+uiOW40+w== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/sshd_config new file mode 100644 index 00000000..e6efa866 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-rsa512/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes rsa-sha2-512 +HostbasedAcceptedKeyTypes rsa-sha2-512 +HostKeyAlgorithms rsa-sha2-512 diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/Dockerfile new file mode 100644 index 00000000..b321a4b9 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/Dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:14.04 +USER root + +ENV TZ=Etc/UTC +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH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UzKwjgSGMGQ6Yfy8IklGFnsjLNMmrvGAgtLGvi2lZ3kjHUvwDrfiAg +QQADHtcImF7JoCC92k0XDTT7Rl8X7uepIwofZNrIRNPDvt7fMDPjEn270GTsbba4 +G+Yj5ESTd1HS1zioMuZI9t3rQu3zKzGi05NErrJCt0Q885uX6inurbdlVDYO8pc0 +nWcAWwKCAQEAsTAkyChxYYVwhBfH7eRy2YZAGEZnHled8inWDMoDNO41PdqBi50t +kZw5Nqz9yTLXtSATZx9soJ9JcjaEhmvsIcXqFnmVrPTN72NgBqeopc/0olmzgv4X ++VRE0JWaRMUVazmS7z03chDhDgO7GaZP/1do+NPi4z6Q8grdn31zjB55oEzckHP8 +FydrpHEdhFGZHMGCDRvLRvq0xcIGocLRJsvhTGfF/CrHipRc+0oR92xlgxDUcQ/Q +gWUfwcsKg8Gz9OllD76xn6/HyLGwfjV207eNgV9gj0E0H28KhrP8AZPbMHflrGZa +N6JTQ/w5YLTkaaFLHcwm6Kw8WXEl+dFHMQKCAQEAwF2PLHD8FzU/wayOanMlsnxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/sshd_config new file mode 100644 index 00000000..3bb2319e --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-14.04/ssh/sshd_config @@ -0,0 +1,13 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/Dockerfile new file mode 100644 index 00000000..0af98161 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/Dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:16.04 +USER root + +ENV TZ=Etc/UTC +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXIfuEUtyH8DcV185JYr0OVDy+kMk9YYJef3KZ1YbtsprWBHR/7K +HcN2KcbQ9AkZRU1Xb8b7m2tGde0+gIXiDYF4kaEocvcxTHAozlPgm3ue5++4S5q6 +CinzEVXlWu0dXHil1KvLZjdq6qG46XwCx1k9+G3RASaFxkzuMAqxZTs2Njc+Hj4N +Xb+gqI6aNSAfVzPYTLm8dUGvSa5y/lHPKkJlQoX7OTL/sc0OEN4fwbY8Q3TSr02A +NwOsed3IqzNj8PpuV2GBGwe3NG17x3ClvXHsCOtT7UUVzs+sOyz76J/uPlf3RiGs +F9SYvG8ui4m9dyRGL3hB87vRmUr9tLRIk9r6T5+fb17BnMbLTlwLqQgtRnOSDISH +1yU3pnEvmboDhyYrGc78MHCoMCuHF7PbFpGiC/rKdiurJigvksylxUExrThmIRHZ ++vCJjVTdhJdJ76Yb5f35lY/Zts8Kil0+TPXVWDrNI0cKv1W4dOCTg+paSwMCAwEA +AQKCAgEAra1i8eXDObgvibh9Skixt66qvi3e0WosAjLVcKx7gMC1ykTFYpgSJ+K8 +2XMA4WLwQQcOjlO5IeWLlBRTMRJQJT82rHxJR8TfrmHCXv1WCpJwzO9jKpao8lyq +xEbDThqoqgxLT4kOdhLhffaq/cYO0yOgzZjJ7qjShb2KrSkt926/eyVdF9b1sKGa +oGaEyOhB2hWK1EBR7t3tRPj9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ndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/sshd_config new file mode 100644 index 00000000..c0abd87a --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-16.04/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes ssh-rsa +HostbasedAcceptedKeyTypes ssh-rsa +HostKeyAlgorithms ssh-rsa diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/Dockerfile new file mode 100644 index 00000000..9260ed51 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/Dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:18.04 +USER root + +ENV TZ=Etc/UTC +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXIfuEUtyH8DcV185JYr0OVDy+kMk9YYJef3KZ1YbtsprWBHR/7K +HcN2KcbQ9AkZRU1Xb8b7m2tGde0+gIXiDYF4kaEocvcxTHAozlPgm3ue5++4S5q6 +CinzEVXlWu0dXHil1KvLZjdq6qG46XwCx1k9+G3RASaFxkzuMAqxZTs2Njc+Hj4N +Xb+gqI6aNSAfVzPYTLm8dUGvSa5y/lHPKkJlQoX7OTL/sc0OEN4fwbY8Q3TSr02A +NwOsed3IqzNj8PpuV2GBGwe3NG17x3ClvXHsCOtT7UUVzs+sOyz76J/uPlf3RiGs +F9SYvG8ui4m9dyRGL3hB87vRmUr9tLRIk9r6T5+fb17BnMbLTlwLqQgtRnOSDISH +1yU3pnEvmboDhyYrG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28KhrP8AZPbMHflrGZa +N6JTQ/w5YLTkaaFLHcwm6Kw8WXEl+dFHMQKCAQEAwF2PLHD8FzU/wayOanMlsnxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/sshd_config new file mode 100644 index 00000000..c0abd87a --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-18.04/ssh/sshd_config @@ -0,0 +1,16 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server +PubkeyAcceptedKeyTypes ssh-rsa +HostbasedAcceptedKeyTypes ssh-rsa +HostKeyAlgorithms ssh-rsa diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/Dockerfile b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/Dockerfile new file mode 100644 index 00000000..7812a059 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:20.04 +USER root + +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y -qq \ + && apt-get install -y -qq \ + --no-install-recommends \ + openssh-server \ + software-properties-common \ + git \ + make + +RUN add-apt-repository ppa:openjdk-r/ppa -y \ + && apt-get update -y -qq \ + && apt-get install -y -qq \ + openjdk-11-jdk \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd --password password --shell /bin/bash --uid 1000 jenkins \ + && mkdir /home/jenkins \ + && chown -R jenkins:jenkins /home/jenkins + +COPY ssh /home/jenkins/.ssh +RUN chown -R jenkins:jenkins /home/jenkins/ \ + && chmod 700 /home/jenkins/.ssh \ + && chmod 600 /home/jenkins/.ssh/* +COPY ssh /root/.ssh +RUN chown -R root:root /root/ \ + && chmod 700 /root/.ssh \ + && chmod 600 /root/.ssh/* +RUN ssh-keygen -A +COPY ssh/sshd_config /etc/ssh/sshd_config + +RUN mkdir -p /var/run/sshd + +RUN echo "password\npassword" | passwd root \ + && echo "password\npassword" | passwd jenkins + +EXPOSE 22 +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/jre/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin +RUN echo "PATH=${PATH}" >> /etc/environment +ENTRYPOINT [] +CMD [ "/bin/sh", "-c", "/usr/sbin/sshd -e -D -p 22"] diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/authorized_keys b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/authorized_keys new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key new file mode 100644 index 00000000..afe5dc41 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAzxYUc+vnLpK9G3FS780COAE0IblNZ+f9+JRoa8Rdb+Ug0mxj +0Y+uUwCjCQj42QY/snUIubfcVJNkS31lzYmNwajnEjc1xHxpPVG8JtMH9GoFxcMn +VoJkT4pkReiGFjw1J9+brLSOaBNWGEt1HNN553Ti/4qp6A3d00AI1+ghY3PIYOaI +jDGerEpZsirpSXIfuEUtyH8DcV185JYr0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7fMDPjEn270GTsbba4 +G+Yj5ESTd1HS1zioMuZI9t3rQu3zKzGi05NErrJCt0Q885uX6inurbdlVDYO8pc0 +nWcAWwKCAQEAsTAkyChxYYVwhBfH7eRy2YZAGEZnHled8inWDMoDNO41PdqBi50t +kZw5Nqz9yTLXtSATZx9soJ9JcjaEhmvsIcXqFnmVrPTN72NgBqeopc/0olmzgv4X ++VRE0JWaRMUVazmS7z03chDhDgO7GaZP/1do+NPi4z6Q8grdn31zjB55oEzckHP8 +FydrpHEdhFGZHMGCDRvLRvq0xcIGocLRJsvhTGfF/CrHipRc+0oR92xlgxDUcQ/Q +gWUfwcsKg8Gz9OllD76xn6/HyLGwfjV207eNgV9gj0E0H28KhrP8AZPbMHflrGZa +N6JTQ/w5YLTkaaFLHcwm6Kw8WXEl+dFHMQKCAQEAwF2PLHD8FzU/wayOanMlsnxt +TaR4YhhdMW1LIcPHESM69ZhdUUMzq/Y50Mms/DlcLNkgKzn73kYKLV3oR+/p3VhN +HBR710SpkrD1xDovLEe5S8uL+z+Q9Iaxqzgn85xHIn+BWJa+x3doAzpuOptmY7SP +75cQqiIhk/Z4PAXBo0GXiO6qiMzrakx02Q2eB1WQ4INrLEhdkL/ZlRPL/1mX3YAb +OZI78b2iu0Wq6PNsCKo7ptLmB963xxsxJo1e2qqKPvXoHndIrN/bo20AlGG0CNn6 +tFK62J1BWYwPIWOIHQPTq3kqBjHJgUo9dKyJE3/QoU/UIp+Kvwgd6ZVanZ7xPQ== +-----END RSA PRIVATE KEY----- diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key.pub b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key.pub new file mode 100644 index 00000000..a5a1fbfa --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/rsa-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPFhRz6+cukr0bcVLvzQI4ATQhuU1n5/34lGhrxF1v5SDSbGPRj65TAKMJCPjZBj+ydQi5t9xUk2RLfWXNiY3BqOcSNzXEfGk9Ubwm0wf0agXFwydWgmRPimRF6IYWPDUn35ustI5oE1YYS3Uc03nndOL/iqnoDd3TQAjX6CFjc8hg5oiMMZ6sSlmyKulJch+4RS3IfwNxXXzklivQ5UPL6QyT1hgl5/cpnVhu2ymtYEdH/sodw3YpxtD0CRlFTVdvxvuba0Z17T6AheINgXiRoShy9zFMcCjOU+Cbe57n77hLmroKKfMRVeVa7R1ceKXUq8tmN2rqobjpfALHWT34bdEBJoXGTO4wCrFlOzY2Nz4ePg1dv6Cojpo1IB9XM9hMubx1Qa9JrnL+Uc8qQmVChfs5Mv+xzQ4Q3h/BtjxDdNKvTYA3A6x53cirM2Pw+m5XYYEbB7c0bXvHcKW9cewI61PtRRXOz6w7LPvon+4+V/dGIawX1Ji8by6Lib13JEYveEHzu9GZSv20tEiT2vpPn59vXsGcxstOXAupCC1Gc5IMhIfXJTemcS+ZugOHJisZzvwwcKgwK4cXs9sWkaIL+sp2K6smKC+SzKXFQTGtOGYhEdn68ImNVN2El0nvphvl/fmVj9m2zwqKXT5M9dVYOs0jRwq/Vbh04JOD6lpLAw== inifc@warhead diff --git a/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/sshd_config b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/sshd_config new file mode 100644 index 00000000..3b4fc7e7 --- /dev/null +++ b/src/test/resources/hudson/plugins/sshslaves/agents/ssh-agent-ubuntu-20.04/ssh/sshd_config @@ -0,0 +1,17 @@ +ChallengeResponseAuthentication no +LogLevel DEBUG1 +UsePAM yes +X11Forwarding yes +PrintMotd yes +AcceptEnv LANG LC_* +PermitRootLogin no +PasswordAuthentication yes +GSSAPIAuthentication yes +GSSAPICleanupCredentials yes +ClientAliveInterval 600 +ClientAliveCountMax 4 +Subsystem sftp /usr/lib/openssh/sftp-server + +#PubkeyAcceptedKeyTypes ssh-rsa +#HostbasedAcceptedKeyTypes ssh-rsa +#HostKeyAlgorithms ssh-rsa From c51daff6a69891961d0e4e3c7c75f3d4bb38e92a Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Fri, 9 Apr 2021 12:16:16 +0200 Subject: [PATCH 07/80] [JENKINS-65155] The "java is not in the path" warning is show even though java is in the path (#218) * [JENKINS-65155] The "java is not in the path" warning is show even though java is in the path * Update src/main/java/hudson/plugins/sshslaves/SSHLauncher.java * Update src/main/java/hudson/plugins/sshslaves/SSHLauncher.java --- .../plugins/sshslaves/JavaVersionChecker.java | 5 ---- .../hudson/plugins/sshslaves/SSHLauncher.java | 28 +++++++++++++++++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java b/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java index 0205f22a..1eafc579 100644 --- a/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java +++ b/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java @@ -76,11 +76,6 @@ protected String resolveJava() throws InterruptedException, IOException { try { return checkJavaVersion(listener, javaCommand); } catch (IOException e) { - if(!"java".equalsIgnoreCase(javaCommand)){ - LOGGER.log(WARNING, "Java is not in the PATH nor configured with the javaPath setting," - + " Jenkins will try to guess where is Java," - + "this guess will be remove in the future."); - } LOGGER.log(FINE, "Failed to check the Java version",e); // try the next one } diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java index 3b48e24b..a282a1b8 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java @@ -34,7 +34,6 @@ import com.trilead.ssh2.ChannelCondition; import com.trilead.ssh2.Connection; import com.trilead.ssh2.SCPClient; -import com.trilead.ssh2.SFTPv3Client; import com.trilead.ssh2.SFTPv3FileAttributes; import com.trilead.ssh2.ServerHostKeyVerifier; import com.trilead.ssh2.Session; @@ -101,11 +100,11 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import java.util.logging.Level; import java.util.logging.Logger; import static hudson.Util.fixEmpty; +import static java.util.logging.Level.WARNING; /** * A computer launcher that tries to start a linux agent by opening an SSH connection and trying to find java. @@ -448,6 +447,7 @@ public Boolean call() throws InterruptedException { if (StringUtils.isNotBlank(javaPath)) { java = expandExpression(computer, javaPath); } else { + checkJavaIsInPath(listener); //FIXME deprecated on 2020-12-10, it will removed after 2021-09-01 JavaVersionChecker javaVersionChecker = new JavaVersionChecker(computer, listener, getJvmOptions(), connection); @@ -519,7 +519,29 @@ public Boolean call() throws InterruptedException { } } - /** + /** + * try to run the Java command in the PATH ad report its version. + * @param listener lister to print the output of the java command. + */ + private void checkJavaIsInPath(TaskListener listener) { + String msg = "Java is not in the PATH nor configured with the javaPath setting," + + " Jenkins will try to guess where is Java, " + + "this guess will be removed in the future. :" + + getDescriptor().getDisplayName(); + int ret = 0; + try { + listener.getLogger().println("Checking Java version in the PATH"); + ret = connection.exec("java -version", listener.getLogger()); + } catch (Exception e){ + ret = -1; + } + if(ret != 0){ + LOGGER.log(WARNING, msg); + listener.getLogger().println(msg); + } + } + + /** * Called to terminate the SSH connection. Used liberally when we back out from an error. */ private void cleanupConnection(TaskListener listener) { From aabe3c121fae0d5341f433c320c57075b0d3278e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Apr 2021 12:16:32 +0200 Subject: [PATCH 08/80] Bump testcontainers from 1.15.1 to 1.15.2 (#219) Bumps [testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.15.1 to 1.15.2. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.15.1...1.15.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 691aa29f..2090b70f 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ org.testcontainers testcontainers - 1.15.1 + 1.15.2 test From 59a6953a4a7ae102075666f3221b5b496af769c0 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Fri, 9 Apr 2021 12:24:06 +0200 Subject: [PATCH 09/80] [maven-release-plugin] prepare release ssh-slaves-1.31.7 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2090b70f..73a8c766 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - ${revision}${changelist} + 1.31.7 hpi SSH Build Agents plugin @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ${scmTag} + ssh-slaves-1.31.7 From d028f37708c0a6ee3ab7d1627fa0677c3169ef64 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Fri, 9 Apr 2021 12:24:18 +0200 Subject: [PATCH 10/80] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 73a8c766..dbb09135 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - 1.31.7 + ${revision}${changelist} hpi SSH Build Agents plugin @@ -25,7 +25,7 @@ - 1.31.7 + 1.31.8 -SNAPSHOT 2.282 8 @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ssh-slaves-1.31.7 + ${scmTag} From 4fdae334f69bfeddf1fb9095e73cc8e3ceb638c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 May 2021 12:12:06 +0200 Subject: [PATCH 11/80] Bump testcontainers from 1.15.2 to 1.15.3 (#225) Bumps [testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.15.2 to 1.15.3. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.15.2...1.15.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dbb09135..89612e45 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ org.testcontainers testcontainers - 1.15.2 + 1.15.3 test From 5a77c8f7cb531cc4e1271e02e019c2ceaf1801f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 May 2021 12:12:16 +0200 Subject: [PATCH 12/80] Bump bom-2.277.x from 26 to 28 (#224) Bumps [bom-2.277.x](https://github.com/jenkinsci/bom) from 26 to 28. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89612e45..d0e1e45c 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.277.x - 26 + 28 pom import From c3d1bbb3b8f9c3cff1ba6d80d3d2bed985089806 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 May 2021 12:12:23 +0200 Subject: [PATCH 13/80] Bump plugin from 4.17 to 4.18 (#223) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.17 to 4.18. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.17...plugin-4.18) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d0e1e45c..6702ad21 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.17 + 4.18 ssh-slaves From 332a6b226ccbab048c7dd46dc50aae2a76244ab0 Mon Sep 17 00:00:00 2001 From: Peter Becich Date: Sat, 1 May 2021 03:12:55 -0700 Subject: [PATCH 14/80] improve error message for Java missing on agent (#222) --- src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java b/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java index 1eafc579..1f6f2d66 100644 --- a/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java +++ b/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java @@ -81,7 +81,7 @@ protected String resolveJava() throws InterruptedException, IOException { } } } - throw new IOException("Java not found on " + computer + ". Install a Java 8 version on the Agent."); + throw new IOException("Java not found on " + computer + ". Install Java 8 or Java 11 on the Agent."); } @NonNull From 0d620bdbf6b54eaa0b627dd4da72e7ab0b14cfc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 May 2021 12:13:13 +0200 Subject: [PATCH 15/80] Bump docker-fixtures from 1.10 to 1.11 (#221) Bumps [docker-fixtures](https://github.com/jenkinsci/docker-fixtures) from 1.10 to 1.11. - [Release notes](https://github.com/jenkinsci/docker-fixtures/releases) - [Changelog](https://github.com/jenkinsci/docker-fixtures/blob/master/old-changelog.md) - [Commits](https://github.com/jenkinsci/docker-fixtures/compare/docker-fixtures-1.10...docker-fixtures-1.11) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6702ad21..40c98796 100644 --- a/pom.xml +++ b/pom.xml @@ -140,7 +140,7 @@ org.jenkins-ci.test docker-fixtures - 1.10 + 1.11 test From c9602cd8d5bcd8c85a3120859a978f3972d45f5f Mon Sep 17 00:00:00 2001 From: Thierry Wasylczenko Date: Tue, 4 May 2021 18:21:51 +0200 Subject: [PATCH 16/80] [JENKINS-65398] Terminology update (#226) * [JENKINS-65398] Terminology update * Apply suggestions from code review Co-authored-by: Robert Sandell Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> * [JENKINS-65398] Removing what seems to be an outdated section * [JENKINS-65398] Restoring deleted section + typos correction * Update doc/TROUBLESHOOTING.md Co-authored-by: Ivan Fernandez Calvo Co-authored-by: Robert Sandell Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> Co-authored-by: Ivan Fernandez Calvo --- doc/CONFIGURE.md | 4 ++-- doc/TROUBLESHOOTING.md | 9 +++++---- src/main/java/hudson/plugins/sshslaves/JavaProvider.java | 2 +- src/main/java/hudson/plugins/sshslaves/SSHLauncher.java | 2 +- .../hudson/plugins/sshslaves/SSHLauncher/help.properties | 2 +- .../plugins/sshslaves/SSHLauncher/help_de.properties | 2 +- .../KnownHostsFileKeyVerificationStrategy/help.html | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/CONFIGURE.md b/doc/CONFIGURE.md index dd0f1357..dd0bbf2e 100644 --- a/doc/CONFIGURE.md +++ b/doc/CONFIGURE.md @@ -14,7 +14,7 @@ This means that **you have to install a JDK/JRE 8 on your agent** in order to ru The agent should have **enough memory** to run the remoting process and the builds. -**The agent needs to be reachable from the master**, +**The agent needs to be reachable from the Jenkins controller**, You have to be ensure that your Jenkins instance can connect through SSH port to your agent; you can check it from the command line. You will have to supply an account that can log in on the target machine. No root privileges are required. @@ -106,7 +106,7 @@ to see if an entry exists that matches the current connection. It is possible to the Java property `-Dhudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy.known_hosts_file=PATH_TO_FILE` This method does not make any updates to the Known Hosts file, instead using the file as a read-only source and expecting -someone with suitable access to the appropriate user account on the Jenkins master to update the file as required, +someone with suitable access to the appropriate user account on the Jenkins controller to update the file as required, potentially using the ssh hostname command to initiate a connection and update the file appropriately. #### Manually provided key Verification Strategy diff --git a/doc/TROUBLESHOOTING.md b/doc/TROUBLESHOOTING.md index f776d316..9dec1d64 100644 --- a/doc/TROUBLESHOOTING.md +++ b/doc/TROUBLESHOOTING.md @@ -90,7 +90,7 @@ and see [Logging_and_Troubleshooting](https://en.wikibooks.org/wiki/OpenSSH/Logg ### Threads stuck at CredentialsProvider.trackAll -If you detect an adnormal number of threads and the thread dump showed a thread for each offline agent stuck waiting for a lock like this: +If you detect an abnormal number of threads and the thread dump showed a thread for each offline agent stuck waiting for a lock like this: ``` at hudson.XmlFile.write(XmlFile.java:186) @@ -140,7 +140,7 @@ java.lang.NoClassDefFoundError: com/trilead/ssh2/Connection ### After upgrade to ssh-slaves 1.28+ Failed to connect using SSH key credentials from files -The SSH Build Agents Plugin version newer than 1.28 uses ssh-credentials 1.14, this versions deprecated the use of "From the Jenkins master ~/.ssh", and "From a file on Jenkins master" SSH credential types because [SECURITY-440](https://jenkins.io/security/advisory/2018-06-25/#SECURITY-440), the ssh-credentials plugins should migrate these deprecated credentials to "Enter directly" type on restart but seems there are some cases that it fails or it is not possible. +The SSH Build Agents Plugin version newer than 1.28 uses ssh-credentials 1.14, this versions deprecated the use of "From the Jenkins controller ~/.ssh", and "From a file on Jenkins controller" SSH credential types because [SECURITY-440](https://jenkins.io/security/advisory/2018-06-25/#SECURITY-440), the ssh-credentials plugins should migrate these deprecated credentials to "Enter directly" type on restart but seems there are some cases that it fails or it is not possible. The issue is related to ssh-credentials and a deprecated type of credentials, the workaround it is to recreate the credential with the same ID using "Enter directly" for the key, probably if you only save again the credential it will be migrated. @@ -166,7 +166,8 @@ ConversionException: Could not call com.cloudbees.jenkins.plugins.sshcredentials ### Selenium Grid agents failed to connect -On recent versions of Jenkins Core, [Agent - Master Access Control](https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control) was introduced it seems causes an issue with Selenium Grid Agents, to fix this problem you have to disable: "Manage Jenkins" > "Configure Global Security", and check "Enable Agent → Master Access Control" (as it's said in Jenkin documentation) +On Jenkins Core 2.89.3, [Agent - Controller Access Control](https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control) was introduced it can causes an issue with Selenium Grid Agents, to fix this problem you have to disable: "Manage Jenkins" > "Configure Global Security", and check "Enable Agent → Controller Access Control" (as it's said in Jenkins documentation) +you can see more details at [JENKINS-49118](https://issues.jenkins.io/browse/JENKINS-49118) https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control "On the other hand, if all your agents are trusted to the same degree as your master, then it is safe to leave this subsystem off" @@ -194,7 +195,7 @@ Caused by: java.io.EOFException ### Corrupt agent workdir folder -If you experience a immmediate disconnection without any clear trace it could be related with a corrupt file in the agent workdir folder. +If you experience an immediate disconnection without any clear trace it could be related with a corrupt file in the agent workdir folder. ``` Apr 17, 2019 2:16:23 PM INFO hudson.remoting.SynchronousCommandTransport$ReaderThread run diff --git a/src/main/java/hudson/plugins/sshslaves/JavaProvider.java b/src/main/java/hudson/plugins/sshslaves/JavaProvider.java index 95e68ec6..e2d39d84 100644 --- a/src/main/java/hudson/plugins/sshslaves/JavaProvider.java +++ b/src/main/java/hudson/plugins/sshslaves/JavaProvider.java @@ -69,7 +69,7 @@ public static ExtensionList all() { /** * Gets minimal required Java version. * - * @return Minimal Java version required on the master and agent side. + * @return Minimal Java version required on the controller and agent side. * @since TODO * */ diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java index a282a1b8..061925f7 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java @@ -661,7 +661,7 @@ private void startAgent(SlaveComputer computer, final TaskListener listener, Str private void expandChannelBufferSize(Session session, TaskListener listener) { // see hudson.remoting.Channel.PIPE_WINDOW_SIZE for the discussion of why 1MB is in the right ball park - // but this particular session is where all the master/agent communication will happen, so + // but this particular session is where all the controller/agent communication will happen, so // it's worth using a bigger buffer to really better utilize bandwidth even when the latency is even larger // (and since we are draining this pipe very rapidly, it's unlikely that we'll actually accumulate this much data) int sz = 4; diff --git a/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help.properties b/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help.properties index aea3739c..44420a0a 100644 --- a/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help.properties +++ b/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. blurb=Starts an agent by sending commands over a secure SSH connection. \ - The agent needs to be reachable from the master, and you will have to supply an \ + The agent needs to be reachable from the Jenkins controller, and you will have to supply an \ account that can log in on the target machine. No root privileges are required. diff --git a/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help_de.properties b/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help_de.properties index 7c9a56ef..3ca66d2e 100644 --- a/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help_de.properties +++ b/src/main/resources/hudson/plugins/sshslaves/SSHLauncher/help_de.properties @@ -22,6 +22,6 @@ blurb=Startet einen Agent durch Kommandos, die \u00FCber eine gesicherte SSH-Verbindung \ gesendet werden. \ - Der Agent muss dazu vom Master aus erreichbar sein, und Sie m\u00FCssen einen \ + Der Agent muss dazu vom Controller aus erreichbar sein, und Sie m\u00FCssen einen \ Benutzeraccount mit Login-Rechten auf dem Agent angeben. \ Root-Rechte sind f\u00FCr diesen Account nicht erforderlich. diff --git a/src/main/resources/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy/help.html b/src/main/resources/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy/help.html index 86ec8c73..2a7a7d8e 100644 --- a/src/main/resources/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy/help.html +++ b/src/main/resources/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy/help.html @@ -1,2 +1,2 @@

Checks the known_hosts file (~/.ssh/known_hosts) for the user Jenkins is executing under, to see if an entry exists that matches the current connection.

-

This method does not make any updates to the Known Hosts file, instead using the file as a read-only source and expecting someone with suitable access to the appropriate user account on the Jenkins master to update the file as required, potentially using the ssh hostname command to initiate a connection and update the file appropriately.

+

This method does not make any updates to the Known Hosts file, instead using the file as a read-only source and expecting someone with suitable access to the appropriate user account on the Jenkins controller to update the file as required, potentially using the ssh hostname command to initiate a connection and update the file appropriately.

From 5648f3e1fb4956eedab827ee606e564bb7415785 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 May 2021 18:22:10 +0200 Subject: [PATCH 17/80] Bump bom-2.277.x from 28 to 29 (#227) Bumps [bom-2.277.x](https://github.com/jenkinsci/bom) from 28 to 29. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 40c98796..1df4b589 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.277.x - 28 + 29 pom import From ebb3160260bc1b6e0996ae6b83420554c16a4748 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 15 May 2021 14:21:26 +0200 Subject: [PATCH 18/80] Bump bom-2.277.x from 29 to 807.v6d348e44c987 (#229) Bumps [bom-2.277.x](https://github.com/jenkinsci/bom) from 29 to 807.v6d348e44c987. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1df4b589..1c4e76b1 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.277.x - 29 + 807.v6d348e44c987 pom import From b883c7e292ba7eac96832e4c4d18166d0d5f312f Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 15 May 2021 05:21:57 -0700 Subject: [PATCH 19/80] Replace usages of `com.google.common.io.ByteStreams` with usages of `org.apache.commons.io.IOUtils` (#228) --- src/main/java/hudson/plugins/sshslaves/SSHLauncher.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java index 061925f7..c6ff51f8 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java @@ -30,7 +30,6 @@ import com.cloudbees.plugins.credentials.domains.HostnamePortRequirement; import com.cloudbees.plugins.credentials.domains.SchemeRequirement; import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel; -import com.google.common.io.ByteStreams; import com.trilead.ssh2.ChannelCondition; import com.trilead.ssh2.Connection; import com.trilead.ssh2.SCPClient; @@ -794,7 +793,7 @@ static byte[] readInputStreamIntoByteArrayAndClose(InputStream inputStream) thro byte[] bytes = null; try{ - bytes = ByteStreams.toByteArray(inputStream); + bytes = IOUtils.toByteArray(inputStream); }catch(IOException e){ throw e; } finally { From bba7096ea3d4a972425345f76fdf3c0191657281 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 5 Jun 2021 14:28:07 +0200 Subject: [PATCH 20/80] chore: bump version to 1.32.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1c4e76b1..b84d2966 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.31.8 + 1.32.0 -SNAPSHOT 2.282 8 From 918d0f6eeff8dedb93aeba71e764ba4cb23188b7 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 5 Jun 2021 14:29:28 +0200 Subject: [PATCH 21/80] [maven-release-plugin] prepare release ssh-slaves-1.32.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b84d2966..d31c4a38 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - ${revision}${changelist} + 1.32.0 hpi SSH Build Agents plugin @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ${scmTag} + ssh-slaves-1.32.0 From 38ad3f68e3345bb3a4604f5eb15b8c947627ae8b Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 5 Jun 2021 14:29:44 +0200 Subject: [PATCH 22/80] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index d31c4a38..da5516be 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - 1.32.0 + ${revision}${changelist} hpi SSH Build Agents plugin @@ -25,7 +25,7 @@ - 1.32.0 + 1.32.1 -SNAPSHOT 2.282 8 @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ssh-slaves-1.32.0 + ${scmTag} From 22f2e08a627a6300ac673d091febdadf9c4ee618 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Jun 2021 14:25:14 +0200 Subject: [PATCH 23/80] Bump plugin from 4.18 to 4.19 (#231) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.18 to 4.19. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.18...plugin-4.19) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da5516be..2f6236d7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.18 + 4.19 ssh-slaves From 34d997c5266fa5c384268493c86b6e583a1d2351 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 11:00:34 +0200 Subject: [PATCH 24/80] Bump bom-2.277.x from 807.v6d348e44c987 to 887.vae9c8ac09ff7 (#235) Bumps [bom-2.277.x](https://github.com/jenkinsci/bom) from 807.v6d348e44c987 to 887.vae9c8ac09ff7. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.277.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2f6236d7..8413a501 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.277.x - 807.v6d348e44c987 + 887.vae9c8ac09ff7 pom import From 1efd677326b8dffc629c8b245b35fef1718fe7f1 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Fri, 2 Jul 2021 13:58:34 +0200 Subject: [PATCH 25/80] [JENKINS-65929] Detection of docker is unreliable (#236) --- .../rules/CheckIsDockerAvailable.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java index 4a8bf7d5..b2b95b93 100644 --- a/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java +++ b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java @@ -5,6 +5,7 @@ import org.testcontainers.DockerClientFactory; import java.io.IOException; +import static org.junit.Assume.assumeTrue; /** * Rule to check if Docker is available. @@ -14,23 +15,6 @@ public class CheckIsDockerAvailable extends ExternalResource { @Override protected void before() { - org.junit.Assume.assumeTrue(isDockerAvailable()); - } - - boolean isDockerAvailable() { - int exitCode = 0; - try { - ProcessBuilder builder = new ProcessBuilder(); - if (SystemUtils.IS_OS_WINDOWS) { - builder.command("cmd.exe", "/c", "docker --version"); - } else { - builder.command("sh", "-c", "docker --version"); - } - Process process = builder.start(); - exitCode = process.waitFor(); - } catch (InterruptedException|IOException e) { - exitCode = 0; - } - return exitCode == 0; + assumeTrue(DockerClientFactory.instance().isDockerAvailable()); } } From 24c2d1ea23860f07ff62d76fc7a5b9fa78e88fe3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 11 Jul 2021 13:53:20 +0200 Subject: [PATCH 26/80] Bump git-changelist-maven-extension from 1.0-beta-7 to 1.2 (#237) Bumps [git-changelist-maven-extension](https://github.com/jenkinsci/incrementals-tools) from 1.0-beta-7 to 1.2. - [Release notes](https://github.com/jenkinsci/incrementals-tools/releases) - [Commits](https://github.com/jenkinsci/incrementals-tools/commits/parent-1.2) --- updated-dependencies: - dependency-name: io.jenkins.tools.incrementals:git-changelist-maven-extension dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .mvn/extensions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 94863e60..43d62816 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -2,6 +2,6 @@ io.jenkins.tools.incrementals git-changelist-maven-extension - 1.0-beta-7 + 1.2 From eed7f2a7e25912c4bfe762aa01ab6c867fa88c17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 24 Jul 2021 13:47:48 +0200 Subject: [PATCH 27/80] Bump plugin from 4.19 to 4.20 (#239) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.19 to 4.20. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.19...plugin-4.20) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8413a501..cd1aa234 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.19 + 4.20 ssh-slaves From 8ab9baa333f8544a5e04195ff14e51ead89401d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 24 Jul 2021 13:48:01 +0200 Subject: [PATCH 28/80] Bump sshd from 3.0.3 to 3.0.4 (#238) Bumps [sshd](https://github.com/jenkinsci/sshd-plugin) from 3.0.3 to 3.0.4. - [Release notes](https://github.com/jenkinsci/sshd-plugin/releases) - [Changelog](https://github.com/jenkinsci/sshd-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/sshd-plugin/compare/sshd-3.0.3...sshd-3.0.4) --- updated-dependencies: - dependency-name: org.jenkins-ci.modules:sshd dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cd1aa234..8bc96078 100644 --- a/pom.xml +++ b/pom.xml @@ -134,7 +134,7 @@ org.jenkins-ci.modules sshd - 3.0.3 + 3.0.4 test From 506b86870fc96f46f93ddfeb5a2de529775e85a6 Mon Sep 17 00:00:00 2001 From: Carroll Chiou Date: Fri, 20 Aug 2021 02:12:20 -0600 Subject: [PATCH 29/80] update package name for CommandFactory for mina-sshd 2.5.1 (#247) --- .../verifiers/TrustHostKeyActionTest.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java b/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java index 39cf6d6e..2ed2c10d 100644 --- a/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java @@ -53,10 +53,10 @@ import hudson.slaves.SlaveComputer; public class TrustHostKeyActionTest { - + @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @Rule public final JenkinsRule jenkins = new JenkinsRule(); @@ -66,7 +66,7 @@ private static int findPort() throws IOException { return socket.getLocalPort(); } } - + @SuppressWarnings("unchecked") @Test public void testSubmitNotAuthorised() throws Exception { @@ -76,7 +76,7 @@ public void testSubmitNotAuthorised() throws Exception { new UsernamePasswordCredentialsImpl(CredentialsScope.SYSTEM, "dummyCredentialId", null, "user", "pass") ) ); - + final int port = findPort(); try { @@ -109,30 +109,30 @@ public void testSubmitNotAuthorised() throws Exception { DumbSlave agent = new DumbSlave("test-agent", "SSH Test agent", temporaryFolder.newFolder().getAbsolutePath(), "1", Mode.NORMAL, "", launcher, RetentionStrategy.NOOP, Collections.emptyList()); - + jenkins.getInstance().addNode(agent); SlaveComputer computer = (SlaveComputer) jenkins.getInstance().getComputer("test-agent"); try { computer.connect(false).get(); } catch (ExecutionException ex){ - //TODO(oleg_nenashev): "Slave" check is still needed for PCT purposes, but it should be eventually cleaned up + //TODO(oleg_nenashev): "Slave" check is still needed for PCT purposes, but it should be eventually cleaned up if (!ex.getMessage().startsWith("java.io.IOException: Slave failed") && !ex.getMessage().startsWith("java.io.IOException: Agent failed")) { throw ex; } } - + List actions = computer.getActions(TrustHostKeyAction.class); assertEquals(computer.getLog(), 1, actions.size()); assertNull(actions.get(0).getExistingHostKey()); - + HtmlPage p = jenkins.createWebClient().getPage(agent, actions.get(0).getUrlName()); p.getElementByName("Yes").click(); - + assertTrue(actions.get(0).isComplete()); assertEquals(actions.get(0).getExistingHostKey(), actions.get(0).getHostKey()); - - + + } private Object newSshServer() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { @@ -180,7 +180,7 @@ private Object newFactory() throws ClassNotFoundException, NoSuchMethodException } private Class newCommandFactoryClass() throws ClassNotFoundException { - return Class.forName("org.apache.sshd.server.CommandFactory"); + return Class.forName("org.apache.sshd.server.command.CommandFactory"); } private Object newCommandFactory(Class commandFactoryClass) throws ClassNotFoundException, IllegalArgumentException { From ba1d6573512534ce47681136d1c893a3e74a7231 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Aug 2021 15:02:44 +0200 Subject: [PATCH 30/80] Bump plugin from 4.20 to 4.24 (#244) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.20 to 4.24. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.20...plugin-4.24) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8bc96078..83a8ce9d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.20 + 4.24 ssh-slaves From d03bc5db342a2161ca401a5568a3d5ededc923ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Aug 2021 15:03:50 +0200 Subject: [PATCH 31/80] Bump bom-2.277.x from 887.vae9c8ac09ff7 to 924.vda78166e6655 (#246) Bumps [bom-2.277.x](https://github.com/jenkinsci/bom) from 887.vae9c8ac09ff7 to 924.vda78166e6655. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.277.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 83a8ce9d..648b894f 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.277.x - 887.vae9c8ac09ff7 + 924.vda78166e6655 pom import From 8c2bfbe7577d3f52748e2f651abfb7be320b6f20 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Mon, 23 Aug 2021 19:26:25 +0200 Subject: [PATCH 32/80] fix: use user and password intead of DSA key in the test (#248) --- .../sshslaves/agents/AgentConnectionBase.java | 24 +++++++++++++++++-- .../AgentUserAndPasswordConnectionTest.java | 3 +-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java index 6a9bc930..7d6a3e98 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBase.java @@ -20,7 +20,9 @@ import com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey; import com.cloudbees.plugins.credentials.CredentialsScope; import com.cloudbees.plugins.credentials.SystemCredentialsProvider; +import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials; import com.cloudbees.plugins.credentials.domains.Domain; +import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; import static org.junit.Assert.assertTrue; /** @@ -77,7 +79,7 @@ protected void waitForAgentConnected(Node node) throws InterruptedException { protected Node createPermanentAgent(String name, String host, int sshPort, String keyResourcePath, String passphrase) throws Descriptor.FormException, IOException { String credId = "sshCredentialsId"; - createSshCredentials(credId, keyResourcePath, passphrase); + createSshKeyCredentials(credId, keyResourcePath, passphrase); final SSHLauncher launcher = new SSHLauncher(host , sshPort, credId); launcher.setSshHostKeyVerificationStrategy(new NonVerifyingKeyVerificationStrategy()); DumbSlave agent = new DumbSlave(name, AGENT_WORK_DIR, launcher); @@ -85,7 +87,18 @@ protected Node createPermanentAgent(String name, String host, int sshPort, Strin return j.jenkins.getNode(agent.getNodeName()); } - private void createSshCredentials(String id, String keyResourcePath, String passphrase) throws IOException { + protected Node createPermanentAgent(String name, String host, int sshPort) + throws Descriptor.FormException, IOException { + String credId = "sshCredentialsId"; + createSshCredentials(credId); + final SSHLauncher launcher = new SSHLauncher(host , sshPort, credId); + launcher.setSshHostKeyVerificationStrategy(new NonVerifyingKeyVerificationStrategy()); + DumbSlave agent = new DumbSlave(name, AGENT_WORK_DIR, launcher); + j.jenkins.addNode(agent); + return j.jenkins.getNode(agent.getNodeName()); + } + + private void createSshKeyCredentials(String id, String keyResourcePath, String passphrase) throws IOException { String privateKey = IOUtils.toString(getClass().getResourceAsStream(keyResourcePath), StandardCharsets.UTF_8); BasicSSHUserPrivateKey.DirectEntryPrivateKeySource privateKeySource = new BasicSSHUserPrivateKey.DirectEntryPrivateKeySource( privateKey); @@ -94,4 +107,11 @@ private void createSshCredentials(String id, String keyResourcePath, String pass SystemCredentialsProvider.getInstance().getDomainCredentialsMap().put(Domain.global(), Collections.singletonList(credentials)); } + + private void createSshCredentials(String id) throws IOException { + StandardUsernameCredentials credentials = + new UsernamePasswordCredentialsImpl(CredentialsScope.SYSTEM, id, "", USER, PASSWORD); + SystemCredentialsProvider.getInstance().getDomainCredentialsMap().put(Domain.global(), + Collections.singletonList(credentials)); + } } diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java index bc5f5128..de1c8877 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUserAndPasswordConnectionTest.java @@ -34,8 +34,7 @@ public class AgentUserAndPasswordConnectionTest extends AgentConnectionBase { @Test public void connectionTests() throws IOException, InterruptedException, Descriptor.FormException { - Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT), - SSH_AGENT_NAME + "/" + SSH_KEY_PATH, ""); + Node node = createPermanentAgent(SSH_AGENT_NAME, agentContainer.getHost(), agentContainer.getMappedPort(SSH_PORT)); waitForAgentConnected(node); assertTrue(isSuccessfullyConnected(node)); } From 6009893c880c4de072088a82b073f7ab9c0adccb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 19:27:58 +0200 Subject: [PATCH 33/80] Bump testcontainers from 1.15.3 to 1.16.0 (#240) Bumps [testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.15.3 to 1.16.0. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.15.3...1.16.0) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 648b894f..a411779f 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ org.testcontainers testcontainers - 1.15.3 + 1.16.0 test From a48f96018fd692f99ae3aa278292727ef1094004 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Wed, 25 Aug 2021 13:01:14 +0200 Subject: [PATCH 34/80] chore: bump Jenkins core to 1.289.1 LTS version (#250) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a411779f..86fb9ba4 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.32.1 -SNAPSHOT - 2.282 + 2.289.1 8 1.31.0 From 22f5f5fb82149aa9eb0d7e92f7d50788ad482da1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 13:47:07 +0200 Subject: [PATCH 35/80] Bump sshd from 3.0.4 to 3.1.0 (#242) Bumps [sshd](https://github.com/jenkinsci/sshd-plugin) from 3.0.4 to 3.1.0. - [Release notes](https://github.com/jenkinsci/sshd-plugin/releases) - [Changelog](https://github.com/jenkinsci/sshd-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/sshd-plugin/compare/sshd-3.0.4...sshd-3.1) --- updated-dependencies: - dependency-name: org.jenkins-ci.modules:sshd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 86fb9ba4..31fc0e9c 100644 --- a/pom.xml +++ b/pom.xml @@ -134,7 +134,7 @@ org.jenkins-ci.modules sshd - 3.0.4 + 3.1.0 test From 99113ff9b4f4a0277c2006d6a844562418f18035 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Wed, 25 Aug 2021 13:54:26 +0200 Subject: [PATCH 36/80] [maven-release-plugin] prepare release ssh-slaves-1.33.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 31fc0e9c..19ad10d7 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - ${revision}${changelist} + 1.33.0 hpi SSH Build Agents plugin @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ${scmTag} + ssh-slaves-1.33.0 From 21b694bbeab352b37d62f4881a5d46348c9b7c11 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Wed, 25 Aug 2021 13:55:00 +0200 Subject: [PATCH 37/80] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 19ad10d7..6d31432b 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - 1.33.0 + ${revision}${changelist} hpi SSH Build Agents plugin @@ -25,7 +25,7 @@ - 1.32.1 + 1.33.1 -SNAPSHOT 2.289.1 8 @@ -81,7 +81,7 @@ scm:git:git://github.com/jenkinsci/ssh-slaves-plugin.git scm:git:git@github.com:jenkinsci/ssh-slaves-plugin.git https://github.com/jenkinsci/ssh-slaves-plugin - ssh-slaves-1.33.0 + ${scmTag} From 8708c63b538e5c217bb3954e834c67e2e00e749b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 13:31:59 +0200 Subject: [PATCH 38/80] Bump bom-2.277.x from 924.vda78166e6655 to 937.v51fde92016ed (#251) Bumps [bom-2.277.x](https://github.com/jenkinsci/bom) from 924.vda78166e6655 to 937.v51fde92016ed. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.277.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6d31432b..c5774aec 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.277.x - 924.vda78166e6655 + 937.v51fde92016ed pom import From 4b3a02a729f7376a1794920af7d1b661b310339d Mon Sep 17 00:00:00 2001 From: offa Date: Sat, 6 Nov 2021 11:18:10 +0000 Subject: [PATCH 39/80] [JENKINS-42969] Use Computer.addAction() (#261) --- ...anuallyTrustedKeyVerificationStrategy.java | 45 +++++-------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java b/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java index 49adb8e1..1d960663 100644 --- a/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java +++ b/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java @@ -24,21 +24,15 @@ package hudson.plugins.sshslaves.verifiers; import hudson.Extension; -import hudson.model.Action; -import hudson.model.Actionable; -import hudson.model.Computer; import hudson.model.TaskListener; import hudson.plugins.sshslaves.Messages; import hudson.plugins.sshslaves.SSHLauncher; import hudson.slaves.SlaveComputer; import java.io.IOException; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.logging.Level; import java.util.logging.Logger; -import javax.annotation.Nonnull; import org.kohsuke.stapler.DataBoundConstructor; /** @@ -55,29 +49,29 @@ public class ManuallyTrustedKeyVerificationStrategy extends SshHostKeyVerificationStrategy { private static final Logger LOGGER = Logger.getLogger(ManuallyTrustedKeyVerificationStrategy.class.getName()); - + private final boolean requireInitialManualTrust; - + @DataBoundConstructor public ManuallyTrustedKeyVerificationStrategy(boolean requireInitialManualTrust) { super(); this.requireInitialManualTrust = requireInitialManualTrust; } - + public boolean isRequireInitialManualTrust() { return requireInitialManualTrust; } - + @Override public boolean verify(final SlaveComputer computer, HostKey hostKey, TaskListener listener) throws IOException { HostKeyHelper hostManager = HostKeyHelper.getInstance(); - + HostKey existingHostKey = hostManager.getHostKey(computer); if (null == existingHostKey) { if (isRequireInitialManualTrust()) { listener.getLogger().println(Messages.ManualTrustingHostKeyVerifier_KeyNotTrusted(SSHLauncher.getTimestamp())); if (!hasExistingTrustAction(computer, hostKey)) { - addAction(computer, new TrustHostKeyAction(computer, hostKey)); + computer.addAction(new TrustHostKeyAction(computer, hostKey)); } return false; } @@ -90,7 +84,7 @@ public boolean verify(final SlaveComputer computer, HostKey hostKey, TaskListene else if (!existingHostKey.equals(hostKey)) { listener.getLogger().println(Messages.ManualTrustingHostKeyVerifier_KeyNotTrusted(SSHLauncher.getTimestamp())); if (!hasExistingTrustAction(computer, hostKey)) { - addAction(computer, new TrustHostKeyAction(computer, hostKey)); + computer.addAction(new TrustHostKeyAction(computer, hostKey)); } return false; } @@ -118,33 +112,16 @@ public String[] getPreferredKeyAlgorithms(SlaveComputer computer) throws IOExcep return algorithms; } - /** TODO replace with {@link Computer#addAction} after core baseline picks up JENKINS-42969 fix */ - private static void addAction(@Nonnull Computer c, @Nonnull Action a) { - try { - c.addAction(a); - } catch (UnsupportedOperationException x) { - try { - Field actionsF = Actionable.class.getDeclaredField("actions"); - actionsF.setAccessible(true); - @SuppressWarnings("unchecked") - List actions = (List) actionsF.get(c); - actions.add(a); - } catch (Exception x2) { - LOGGER.log(Level.WARNING, null, x2); - } - } - } - private boolean hasExistingTrustAction(SlaveComputer computer, HostKey hostKey) { for (TrustHostKeyAction action : computer.getActions(TrustHostKeyAction.class)) { if (!action.isComplete() && action.getHostKey().equals(hostKey)) { return true; } } - + return false; } - + @Extension public static class ManuallyTrustedKeyVerificationStrategyDescriptor extends SshHostKeyVerificationStrategyDescriptor { @@ -152,7 +129,7 @@ public static class ManuallyTrustedKeyVerificationStrategyDescriptor extends Ssh public String getDisplayName() { return Messages.ManualTrustingHostKeyVerifier_DescriptorDisplayName(); } - + } - + } From d86f588bec1843c079335984a383ac19f9b12dd3 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sat, 6 Nov 2021 05:20:23 -0600 Subject: [PATCH 40/80] [JENKINS-66601] host key allows ed25519 & ecdsa (#256) Add ED-25519 and ECDSA as allowed host key algorithms. Remove DSS because the DSA algorithm has been removed from OpenSSH. See https://security.stackexchange.com/questions/112802/why-openssh-deprecated-dsa-keys --- doc/CONFIGURE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CONFIGURE.md b/doc/CONFIGURE.md index dd0bbf2e..a4cf7930 100644 --- a/doc/CONFIGURE.md +++ b/doc/CONFIGURE.md @@ -116,7 +116,7 @@ potentially using the ssh hostname command to initiate a connection and update t Checks the key provided by the remote host matches the key set by the user who configured this connection. The SSH key expected for this connection. This key should be in the form `algorithm value` -where algorithm is one of ssh-rsa or ssh-dss, and value is the Base 64 encoded content of the key. The keys should be placed in /etc/ssh/.pub +where `algorithm` is one of ssh-rsa, ssh-ed25519, or ecdsa-sha2-nistp256, and `value` is the base 64 encoded content of the key. The public keys for a Linux agent can be read from the agent file system at `/etc/ssh/.pub`. #### Manually trusted key Verification Strategy From b52701eb20a46e8d71f86ed478eca774f99e4dbc Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 6 Nov 2021 12:21:58 +0100 Subject: [PATCH 41/80] Updated Readme ## Notes linkname to 1.31 (#252) The README specifies plugin rename in 1.32 but links to ssh-slaves-1.31.0 tag. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06d42dee..ba58836b 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,4 @@ Provides a means to launch agents via SSH. ## Notes This plugin is formerly known as "SSH Slaves Plugin". -It was renamed in [1.32.0](https://github.com/jenkinsci/ssh-slaves-plugin/releases/tag/ssh-slaves-1.31.0), but the plugin ID was retained as `ssh-slaves` to retain compatibility for the plugin users. +It was renamed in [1.31.0](https://github.com/jenkinsci/ssh-slaves-plugin/releases/tag/ssh-slaves-1.31.0), but the plugin ID was retained as `ssh-slaves` to retain compatibility for the plugin users. From affacf58886a8b11e08819c526dbc9f3c0f7a0ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Nov 2021 12:22:20 +0100 Subject: [PATCH 42/80] Bump bom-2.277.x from 937.v51fde92016ed to 961.vf0c9f6f59827 (#258) Bumps [bom-2.277.x](https://github.com/jenkinsci/bom) from 937.v51fde92016ed to 961.vf0c9f6f59827. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.277.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c5774aec..d28a5f3e 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.277.x - 937.v51fde92016ed + 961.vf0c9f6f59827 pom import From 7b02af147e8c1b4f09237a7b36aa66a37404fcfa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Nov 2021 12:22:30 +0100 Subject: [PATCH 43/80] Bump plugin from 4.24 to 4.29 (#262) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.24 to 4.29. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.24...plugin-4.29) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d28a5f3e..bceb284f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.24 + 4.29 ssh-slaves From 3045a3cab4b30fac11e649cd5fae57d89868ae7e Mon Sep 17 00:00:00 2001 From: offa Date: Sat, 6 Nov 2021 12:04:22 +0000 Subject: [PATCH 44/80] Add missing nullability annotations and replace JSR 305 (#260) Co-authored-by: Ivan Fernandez Calvo --- .../plugins/sshslaves/JavaProvider.java | 10 +++++----- .../plugins/sshslaves/JavaVersionChecker.java | 1 - .../plugins/sshslaves/SSHConnector.java | 4 +++- .../hudson/plugins/sshslaves/SSHLauncher.java | 10 ++++++---- ...KnownHostsFileKeyVerificationStrategy.java | 2 ++ ...nuallyProvidedKeyVerificationStrategy.java | 20 ++++++++++--------- ...anuallyTrustedKeyVerificationStrategy.java | 2 ++ .../NonVerifyingKeyVerificationStrategy.java | 12 ++++++----- .../rules/CheckIsDockerAvailable.java | 2 -- 9 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/main/java/hudson/plugins/sshslaves/JavaProvider.java b/src/main/java/hudson/plugins/sshslaves/JavaProvider.java index e2d39d84..fa738765 100644 --- a/src/main/java/hudson/plugins/sshslaves/JavaProvider.java +++ b/src/main/java/hudson/plugins/sshslaves/JavaProvider.java @@ -24,6 +24,7 @@ package hudson.plugins.sshslaves; import com.trilead.ssh2.Connection; +import edu.umd.cs.findbugs.annotations.NonNull; import hudson.ExtensionList; import hudson.ExtensionPoint; import hudson.slaves.SlaveComputer; @@ -32,13 +33,12 @@ import java.util.List; import java.util.Collections; -import javax.annotation.Nonnull; /** * Guess where Java is. */ public abstract class JavaProvider implements ExtensionPoint { - + private static final VersionNumber JAVA_LEVEL_8 = new VersionNumber("8"); /** @@ -68,12 +68,12 @@ public static ExtensionList all() { /** * Gets minimal required Java version. - * + * * @return Minimal Java version required on the controller and agent side. * @since TODO - * + * */ - @Nonnull + @NonNull public static VersionNumber getMinJavaLevel() { return JAVA_LEVEL_8; } diff --git a/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java b/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java index 1f6f2d66..04a1bbf6 100644 --- a/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java +++ b/src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java @@ -44,7 +44,6 @@ import hudson.slaves.SlaveComputer; import hudson.util.VersionNumber; import static java.util.logging.Level.FINE; -import static java.util.logging.Level.WARNING; /** * class to check if the version of java installed on the agent is a supported one. diff --git a/src/main/java/hudson/plugins/sshslaves/SSHConnector.java b/src/main/java/hudson/plugins/sshslaves/SSHConnector.java index 7e7770b2..d7c5b4b6 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHConnector.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHConnector.java @@ -28,6 +28,7 @@ import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials; import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel; import com.trilead.ssh2.Connection; +import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.model.ItemGroup; import hudson.model.TaskListener; @@ -167,7 +168,7 @@ public SSHConnector(int port, String credentialsId, String jvmOptions, String ja } @Override - public SSHLauncher launch(String host, TaskListener listener) { + public SSHLauncher launch(@NonNull String host, TaskListener listener) { SSHLauncher sshLauncher = new SSHLauncher(host, port, credentialsId, jvmOptions, javaPath, prefixStartSlaveCmd, suffixStartSlaveCmd, launchTimeoutSeconds, maxNumRetries, retryWaitTime, sshHostKeyVerificationStrategy); sshLauncher.setWorkDir(workDir); @@ -283,6 +284,7 @@ public Boolean getTcpNoDelay() { @Extension public static class DescriptorImpl extends ComputerConnectorDescriptor { + @NonNull @Override public String getDisplayName() { return Messages.SSHLauncher_DescriptorDisplayName(); diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java index c6ff51f8..44664078 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java @@ -258,7 +258,8 @@ public boolean verifyServerHostKey(String hostname, int port, String serverHostK */ public SSHLauncher(@NonNull String host, int port, String credentialsId, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd, - Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime, SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy) { + Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime, + @CheckForNull SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy) { setHost(host); setJvmOptions(jvmOptions); setPort(port); @@ -1030,7 +1031,7 @@ SshHostKeyVerificationStrategy getSshHostKeyVerificationStrategyDefaulted() { } @DataBoundSetter - public void setSshHostKeyVerificationStrategy(SshHostKeyVerificationStrategy value) { + public void setSshHostKeyVerificationStrategy(@CheckForNull SshHostKeyVerificationStrategy value) { this.sshHostKeyVerificationStrategy = value; } @@ -1204,6 +1205,7 @@ public static class DescriptorImpl extends Descriptor { /** * {@inheritDoc} */ + @NonNull public String getDisplayName() { return Messages.SSHLauncher_DescriptorDisplayName(); } @@ -1345,12 +1347,12 @@ public void flush() throws IOException { } @Override - public void write(byte[] b) throws IOException { + public void write(@NonNull byte[] b) throws IOException { if (out != null) out.write(b); } @Override - public void write(byte[] b, int off, int len) throws IOException { + public void write(@NonNull byte[] b, int off, int len) throws IOException { if (out != null) out.write(b, off, len); } } diff --git a/src/main/java/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy.java b/src/main/java/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy.java index cf403475..220a00b0 100644 --- a/src/main/java/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy.java +++ b/src/main/java/hudson/plugins/sshslaves/verifiers/KnownHostsFileKeyVerificationStrategy.java @@ -24,6 +24,7 @@ package hudson.plugins.sshslaves.verifiers; import com.trilead.ssh2.KnownHosts; +import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.model.TaskListener; import hudson.plugins.sshslaves.Messages; @@ -117,6 +118,7 @@ public File getKnownHostsFile() { @Extension public static class KnownHostsFileKeyVerificationStrategyDescriptor extends SshHostKeyVerificationStrategyDescriptor { + @NonNull @Override public String getDisplayName() { return Messages.KnownHostsFileHostKeyVerifier_DisplayName(); diff --git a/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyProvidedKeyVerificationStrategy.java b/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyProvidedKeyVerificationStrategy.java index 0f01e65d..14ba2ff1 100644 --- a/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyProvidedKeyVerificationStrategy.java +++ b/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyProvidedKeyVerificationStrategy.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.StringTokenizer; +import edu.umd.cs.findbugs.annotations.NonNull; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; @@ -51,7 +52,7 @@ public class ManuallyProvidedKeyVerificationStrategy extends SshHostKeyVerificationStrategy { private final HostKey key; - + @DataBoundConstructor public ManuallyProvidedKeyVerificationStrategy(String key) { super(); @@ -61,15 +62,15 @@ public ManuallyProvidedKeyVerificationStrategy(String key) { throw new IllegalArgumentException("Invalid key: " + e.getMessage(), e); } } - + public String getKey() { return key.getAlgorithm() + " " + Base64.getEncoder().encodeToString(key.getKey()); } - + public HostKey getParsedKey() { return key; } - + @Override public boolean verify(SlaveComputer computer, HostKey hostKey, TaskListener listener) throws Exception { if (key.equals(hostKey)) { @@ -91,7 +92,7 @@ public String[] getPreferredKeyAlgorithms(SlaveComputer computer) throws IOExcep return sortedAlgorithms.toArray(new String[0]); } - + private static HostKey parseKey(String key) throws KeyParseException { if (!key.contains(" ")) { throw new IllegalArgumentException(Messages.ManualKeyProvidedHostKeyVerifier_TwoPartKey()); @@ -102,18 +103,19 @@ private static HostKey parseKey(String key) throws KeyParseException { if (null == keyValue) { throw new KeyParseException(Messages.ManualKeyProvidedHostKeyVerifier_Base64EncodedKeyValueRequired()); } - + return TrileadVersionSupportManager.getTrileadSupport().parseKey(algorithm, keyValue); } - + @Extension public static class ManuallyProvidedKeyVerificationStrategyDescriptor extends SshHostKeyVerificationStrategyDescriptor { + @NonNull @Override public String getDisplayName() { return Messages.ManualKeyProvidedHostKeyVerifier_DisplayName(); } - + public FormValidation doCheckKey(@QueryParameter String key) { try { ManuallyProvidedKeyVerificationStrategy.parseKey(key); @@ -122,7 +124,7 @@ public FormValidation doCheckKey(@QueryParameter String key) { return FormValidation.error(ex.getMessage()); } } - + } } diff --git a/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java b/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java index 1d960663..d929edff 100644 --- a/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java +++ b/src/main/java/hudson/plugins/sshslaves/verifiers/ManuallyTrustedKeyVerificationStrategy.java @@ -23,6 +23,7 @@ */ package hudson.plugins.sshslaves.verifiers; +import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.model.TaskListener; import hudson.plugins.sshslaves.Messages; @@ -125,6 +126,7 @@ private boolean hasExistingTrustAction(SlaveComputer computer, HostKey hostKey) @Extension public static class ManuallyTrustedKeyVerificationStrategyDescriptor extends SshHostKeyVerificationStrategyDescriptor { + @NonNull @Override public String getDisplayName() { return Messages.ManualTrustingHostKeyVerifier_DescriptorDisplayName(); diff --git a/src/main/java/hudson/plugins/sshslaves/verifiers/NonVerifyingKeyVerificationStrategy.java b/src/main/java/hudson/plugins/sshslaves/verifiers/NonVerifyingKeyVerificationStrategy.java index 5a95097d..56f38317 100644 --- a/src/main/java/hudson/plugins/sshslaves/verifiers/NonVerifyingKeyVerificationStrategy.java +++ b/src/main/java/hudson/plugins/sshslaves/verifiers/NonVerifyingKeyVerificationStrategy.java @@ -23,6 +23,7 @@ */ package hudson.plugins.sshslaves.verifiers; +import edu.umd.cs.findbugs.annotations.NonNull; import org.kohsuke.stapler.DataBoundConstructor; import hudson.Extension; @@ -45,21 +46,22 @@ public class NonVerifyingKeyVerificationStrategy extends SshHostKeyVerificationS public NonVerifyingKeyVerificationStrategy() { super(); } - + @Override public boolean verify(SlaveComputer computer, HostKey hostKey, TaskListener listener) { listener.getLogger().println(Messages.NonVerifyingHostKeyVerifier_NoVerificationWarning(SSHLauncher.getTimestamp())); return true; } - + @Extension public static class NonVerifyingKeyVerificationStrategyDescriptor extends SshHostKeyVerificationStrategyDescriptor { + @NonNull @Override public String getDisplayName() { return Messages.NonVerifyingHostKeyVerifier_DescriptorDisplayName(); } - + } - -} \ No newline at end of file + +} diff --git a/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java index b2b95b93..b28e25cf 100644 --- a/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java +++ b/src/test/java/hudson/plugins/sshslaves/rules/CheckIsDockerAvailable.java @@ -1,10 +1,8 @@ package hudson.plugins.sshslaves.rules; -import org.apache.commons.lang.SystemUtils; import org.junit.rules.ExternalResource; import org.testcontainers.DockerClientFactory; -import java.io.IOException; import static org.junit.Assume.assumeTrue; /** From 1dff6b3cc9dd3eaf3af2f6ce90d131cef9d27c6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 16:25:19 +0100 Subject: [PATCH 45/80] Bump plugin from 4.29 to 4.31 (#264) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.29 to 4.31. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.29...plugin-4.31) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bceb284f..5a198ea0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.29 + 4.31 ssh-slaves From 22bdd5d2b9f429b099400390330bd1801e5467c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 09:48:17 +0100 Subject: [PATCH 46/80] Bump testcontainers from 1.16.0 to 1.16.2 (#263) * Bump testcontainers from 1.16.0 to 1.16.2 Bumps [testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.16.0 to 1.16.2. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.16.0...1.16.2) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * fix: add some exclusions Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivan Fernandez Calvo --- pom.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5a198ea0..580b2177 100644 --- a/pom.xml +++ b/pom.xml @@ -162,8 +162,18 @@ org.testcontainers testcontainers - 1.16.0 + 1.16.2 test + + + org.apache.commons + commons-compress + + + org.slf4j + slf4j-api + + From 964c6038619cd89d52868034059ebc9c4a279faa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jan 2022 20:01:50 +0000 Subject: [PATCH 47/80] Bump git-changelist-maven-extension from 1.2 to 1.3 Bumps [git-changelist-maven-extension](https://github.com/jenkinsci/incrementals-tools) from 1.2 to 1.3. - [Release notes](https://github.com/jenkinsci/incrementals-tools/releases) - [Commits](https://github.com/jenkinsci/incrementals-tools/compare/parent-1.2...parent-1.3) --- updated-dependencies: - dependency-name: io.jenkins.tools.incrementals:git-changelist-maven-extension dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .mvn/extensions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 43d62816..a65d82e1 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -2,6 +2,6 @@ io.jenkins.tools.incrementals git-changelist-maven-extension - 1.2 + 1.3 From bc4dc045e801c3d965759e57db0c5edaef500d00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jan 2022 11:23:49 +0100 Subject: [PATCH 48/80] Bump plugin from 4.31 to 4.33 (#267) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.31 to 4.33. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.31...plugin-4.33) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 580b2177..6aa7cbc0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.31 + 4.33 ssh-slaves From 36c379a07ceff43b080829374a55aa51feb95083 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 26 Feb 2022 14:04:23 +0100 Subject: [PATCH 49/80] Create jenkins-security-scan.yml --- .github/workflows/jenkins-security-scan.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/jenkins-security-scan.yml diff --git a/.github/workflows/jenkins-security-scan.yml b/.github/workflows/jenkins-security-scan.yml new file mode 100644 index 00000000..ae503c1d --- /dev/null +++ b/.github/workflows/jenkins-security-scan.yml @@ -0,0 +1,15 @@ +name: Jenkins Security Scan +on: + push: + branches: + - main + pull_request: + types: [ opened, synchronize, reopened ] + workflow_dispatch: + +jobs: + security-scan: + uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v1 + with: + java-cache: '' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate. + java-version: 11 # What version of Java to set up for the build. From e0fde81d891388488c96c8213d4386d8442aee5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 14:06:55 +0100 Subject: [PATCH 50/80] Bump testcontainers from 1.16.2 to 1.16.3 (#268) Bumps [testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.16.2 to 1.16.3. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.16.2...1.16.3) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6aa7cbc0..34e79dc9 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ org.testcontainers testcontainers - 1.16.2 + 1.16.3 test From ecacc09652535a8ff972dc8dbcad202e919a5012 Mon Sep 17 00:00:00 2001 From: offa Date: Sat, 26 Feb 2022 13:11:32 +0000 Subject: [PATCH 51/80] Replace assertion and use lambda (#270) * Replace assertion * Use lambdas --- .../hudson/plugins/sshslaves/SSHLauncher.java | 104 +++++++++--------- .../plugins/sshslaves/SSHLauncherTest.java | 12 +- .../verifiers/TrustHostKeyActionTest.java | 44 +++----- 3 files changed, 73 insertions(+), 87 deletions(-) diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java index 44664078..7e781f74 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java @@ -419,60 +419,58 @@ public void launch(final SlaveComputer computer, final TaskListener listener) th launcherExecutorService = Executors.newSingleThreadExecutor( new NamingThreadFactory(Executors.defaultThreadFactory(), "SSHLauncher.launch for '" + computer.getName() + "' node")); Set> callables = new HashSet<>(); - callables.add(new Callable() { - public Boolean call() throws InterruptedException { - Boolean rval = Boolean.FALSE; - try { - String[] preferredKeyAlgorithms = getSshHostKeyVerificationStrategyDefaulted().getPreferredKeyAlgorithms(computer); - if (preferredKeyAlgorithms != null && preferredKeyAlgorithms.length > 0) { // JENKINS-44832 - connection.setServerHostKeyAlgorithms(preferredKeyAlgorithms); - } else { - listener.getLogger().println("Warning: no key algorithms provided; JENKINS-42959 disabled"); - } - - listener.getLogger().println(logConfiguration()); - - openConnection(listener, computer); - - verifyNoHeaderJunk(listener); - reportEnvironment(listener); - - final String workingDirectory = getWorkingDirectory(computer); - if (workingDirectory == null) { - listener.error("Cannot get the working directory for " + computer); - return Boolean.FALSE; - } - - String java = null; - if (StringUtils.isNotBlank(javaPath)) { - java = expandExpression(computer, javaPath); - } else { - checkJavaIsInPath(listener); - //FIXME deprecated on 2020-12-10, it will removed after 2021-09-01 - JavaVersionChecker javaVersionChecker = new JavaVersionChecker(computer, listener, getJvmOptions(), - connection); - java = javaVersionChecker.resolveJava(); - } - - copyAgentJar(listener, workingDirectory); - - startAgent(computer, listener, java, workingDirectory); - - PluginImpl.register(connection); - rval = Boolean.TRUE; - } catch (RuntimeException|Error e) { - String msg = Messages.SSHLauncher_UnexpectedError(); - if(StringUtils.isNotBlank(e.getMessage())){ - msg = e.getMessage(); - } - e.printStackTrace(listener.error(msg)); - } catch (AbortException e) { - listener.getLogger().println(e.getMessage()); - } catch (IOException e) { - e.printStackTrace(listener.getLogger()); - } finally { - return rval; + callables.add(() -> { + Boolean rval = Boolean.FALSE; + try { + String[] preferredKeyAlgorithms = getSshHostKeyVerificationStrategyDefaulted().getPreferredKeyAlgorithms(computer); + if (preferredKeyAlgorithms != null && preferredKeyAlgorithms.length > 0) { // JENKINS-44832 + connection.setServerHostKeyAlgorithms(preferredKeyAlgorithms); + } else { + listener.getLogger().println("Warning: no key algorithms provided; JENKINS-42959 disabled"); + } + + listener.getLogger().println(logConfiguration()); + + openConnection(listener, computer); + + verifyNoHeaderJunk(listener); + reportEnvironment(listener); + + final String workingDirectory = getWorkingDirectory(computer); + if (workingDirectory == null) { + listener.error("Cannot get the working directory for " + computer); + return Boolean.FALSE; + } + + String java = null; + if (StringUtils.isNotBlank(javaPath)) { + java = expandExpression(computer, javaPath); + } else { + checkJavaIsInPath(listener); + //FIXME deprecated on 2020-12-10, it will removed after 2021-09-01 + JavaVersionChecker javaVersionChecker = new JavaVersionChecker(computer, listener, getJvmOptions(), + connection); + java = javaVersionChecker.resolveJava(); + } + + copyAgentJar(listener, workingDirectory); + + startAgent(computer, listener, java, workingDirectory); + + PluginImpl.register(connection); + rval = Boolean.TRUE; + } catch (RuntimeException|Error e) { + String msg = Messages.SSHLauncher_UnexpectedError(); + if(StringUtils.isNotBlank(e.getMessage())){ + msg = e.getMessage(); } + e.printStackTrace(listener.error(msg)); + } catch (AbortException e) { + listener.getLogger().println(e.getMessage()); + } catch (IOException e) { + e.printStackTrace(listener.getLogger()); + } finally { + return rval; } }); diff --git a/src/test/java/hudson/plugins/sshslaves/SSHLauncherTest.java b/src/test/java/hudson/plugins/sshslaves/SSHLauncherTest.java index 3d27c7c9..f0b69b31 100644 --- a/src/test/java/hudson/plugins/sshslaves/SSHLauncherTest.java +++ b/src/test/java/hudson/plugins/sshslaves/SSHLauncherTest.java @@ -76,6 +76,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -154,12 +155,7 @@ private static boolean checkSupported(final String testVersionOutput) throws IOE } private static void assertNotSupported(final String testVersionOutput) throws AssertionError { - try { - checkSupported(testVersionOutput); - fail("Expected version " + testVersionOutput + " to be not supported, but it is supported"); - } catch (IOException e) { - // expected - } + assertThrows(IOException.class, () -> checkSupported(testVersionOutput)); } private void checkRoundTrip(String host) throws Exception { @@ -400,7 +396,7 @@ public void getMd5Hash() { try { byte[] bytes = "Leave me alone!".getBytes(); String result = SSHLauncher.getMd5Hash(bytes); - assertTrue("1EB226C8E950BAC1494BE197E84A264C".equals(result)); + assertEquals("1EB226C8E950BAC1494BE197E84A264C", result); } catch (Exception e) { e.printStackTrace(); } @@ -420,7 +416,7 @@ public void readInputStreamIntoByteArrayAndClose() { byte[] bytes = SSHLauncher.readInputStreamIntoByteArrayAndClose(inputStream); assertNotNull(bytes); assertTrue(bytes.length > 0); - assertTrue("Don't change me or add newlines!".equals(new String(bytes))); + assertEquals("Don't change me or add newlines!", new String(bytes)); } catch (Exception e) { e.printStackTrace(); diff --git a/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java b/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java index 2ed2c10d..db177361 100644 --- a/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/verifiers/TrustHostKeyActionTest.java @@ -187,25 +187,21 @@ private Object newCommandFactory(Class commandFactoryClass) throws ClassNotFound return java.lang.reflect.Proxy.newProxyInstance( commandFactoryClass.getClassLoader(), new java.lang.Class[]{commandFactoryClass}, - new java.lang.reflect.InvocationHandler() { + (proxy, method, args) -> { - @Override - public Object invoke(Object proxy, java.lang.reflect.Method method, Object[] args) throws java.lang.Throwable { + if (method.getName().equals("createCommand")) { + Class commandClass; + try { + commandClass = Class.forName("org.apache.sshd.server.command.UnknownCommand"); + } catch (ClassNotFoundException e) { + commandClass = Class.forName("org.apache.sshd.server.scp.UnknownCommand"); + } - if (method.getName().equals("createCommand")) { - Class commandClass; - try { - commandClass = Class.forName("org.apache.sshd.server.command.UnknownCommand"); - } catch (ClassNotFoundException e) { - commandClass = Class.forName("org.apache.sshd.server.scp.UnknownCommand"); - } + return commandClass.getConstructor(String.class).newInstance(args[0]); + } - return commandClass.getConstructor(String.class).newInstance(args[0]); - } - - return null; - } - }); + return null; + }); } private Class newCommandAuthenticatorClass() throws ClassNotFoundException { @@ -223,18 +219,14 @@ private Object newAuthenticator(Class passwordAuthenticatorClass) throws ClassNo return java.lang.reflect.Proxy.newProxyInstance( passwordAuthenticatorClass.getClassLoader(), new java.lang.Class[]{passwordAuthenticatorClass}, - new java.lang.reflect.InvocationHandler() { - - @Override - public Object invoke(Object proxy, java.lang.reflect.Method method, Object[] args) throws java.lang.Throwable { + (proxy, method, args) -> { - if (method.getName().equals("authenticate")) { - return Boolean.TRUE; - } + if (method.getName().equals("authenticate")) { + return Boolean.TRUE; + } - return null; - } - }); + return null; + }); } private Object invoke(Object target, String methodName, Class[] parameterTypes, Object[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { From 2eb371006b0b6cffb775cf107be8376578eea762 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 14:11:55 +0100 Subject: [PATCH 52/80] Bump plugin from 4.33 to 4.35 (#272) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.33 to 4.35. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.33...plugin-4.35) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 34e79dc9..1c980aa5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.33 + 4.35 ssh-slaves From f3105af5e5d3adf9343c74ebae03c08b6c2fafe4 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 26 Feb 2022 14:21:55 +0100 Subject: [PATCH 53/80] Update jenkins-security-scan.yml --- .github/workflows/jenkins-security-scan.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jenkins-security-scan.yml b/.github/workflows/jenkins-security-scan.yml index ae503c1d..17136b16 100644 --- a/.github/workflows/jenkins-security-scan.yml +++ b/.github/workflows/jenkins-security-scan.yml @@ -3,8 +3,9 @@ on: push: branches: - main - pull_request: - types: [ opened, synchronize, reopened ] +# see https://github.com/jenkins-infra/jenkins-security-scan/issues/3 +# pull_request: +# types: [ opened, synchronize, reopened ] workflow_dispatch: jobs: From 4f02481ae75370d5ce9d9c760aac52056c9c9f06 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Tue, 1 Mar 2022 12:59:24 +0100 Subject: [PATCH 54/80] feat: enable continouos delivery (#269) --- .github/dependabot.yml | 6 +++- .github/release-drafter.yml | 6 ++-- .github/workflows/cd.yaml | 59 +++++++++++++++++++++++++++++++++++++ .mvn/maven.config | 1 + pom.xml | 2 +- 5 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/cd.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 04ceb6e8..b7814523 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,4 +3,8 @@ updates: - package-ecosystem: "maven" directory: "/" schedule: - interval: "weekly" + interval: "daily" + - package-ecosystem: "github-actions" + directory: / + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 10fb79a1..bbef3509 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,6 +1,4 @@ # https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc +# https://www.jenkins.io/doc/developer/publishing/releasing-cd/#release-notes _extends: .github -# Semantic versioning is used d=for this plugin: https://semver.org/ -version-template: $MAJOR.$MINOR.$PATCH -tag-template: ssh-slaves-$NEXT_PATCH_VERSION -name-template: $NEXT_PATCH_VERSION + diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 00000000..8dfdb7b9 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,59 @@ +# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins + +name: cd +on: + workflow_dispatch: + check_run: + types: + - completed + +jobs: + validate: + runs-on: ubuntu-latest + outputs: + should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }} + steps: + - name: Verify CI status + uses: jenkins-infra/verify-ci-status-action@v1.2.0 + id: verify-ci-status + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + output_result: true + + - name: Release Drafter + uses: release-drafter/release-drafter@v5 + if: steps.verify-ci-status.outputs.result == 'success' + with: + name: next + tag: next + version: next + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check interesting categories + uses: jenkins-infra/interesting-category-action@v1.0.0 + id: interesting-categories + if: steps.verify-ci-status.outputs.result == 'success' + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + runs-on: ubuntu-latest + needs: [validate] + if: needs.validate.outputs.should_release == 'true' + steps: + - name: Check out + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: 8 + - name: Release + uses: jenkins-infra/jenkins-maven-cd-action@v1.2.0 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} \ No newline at end of file diff --git a/.mvn/maven.config b/.mvn/maven.config index 2a0299c4..f7daf60d 100644 --- a/.mvn/maven.config +++ b/.mvn/maven.config @@ -1,2 +1,3 @@ -Pconsume-incrementals -Pmight-produce-incrementals +-Dchangelist.format=%d.v%s diff --git a/pom.xml b/pom.xml index 1c980aa5..be6e3339 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - ${revision}${changelist} + ${revision}-${changelist} hpi SSH Build Agents plugin From 726b4e1bffb1bbdedcea0bab71ae9b71427898a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 13:52:50 +0100 Subject: [PATCH 55/80] Bump actions/checkout from 2.3.4 to 2.4.0 (#276) Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.4.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.4.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 8dfdb7b9..b2bc2386 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -43,7 +43,7 @@ jobs: if: needs.validate.outputs.should_release == 'true' steps: - name: Check out - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 with: fetch-depth: 0 - name: Set up JDK 8 From f245b0d52b8e17ae2a07dec05bd3df6814208bbf Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Tue, 1 Mar 2022 15:42:36 +0100 Subject: [PATCH 56/80] Changes monitor category (#274) --- .../MissingVerificationStrategyAdministrativeMonitor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/hudson/plugins/sshslaves/verifiers/MissingVerificationStrategyAdministrativeMonitor.java b/src/main/java/hudson/plugins/sshslaves/verifiers/MissingVerificationStrategyAdministrativeMonitor.java index 62994a60..4235400f 100644 --- a/src/main/java/hudson/plugins/sshslaves/verifiers/MissingVerificationStrategyAdministrativeMonitor.java +++ b/src/main/java/hudson/plugins/sshslaves/verifiers/MissingVerificationStrategyAdministrativeMonitor.java @@ -65,6 +65,11 @@ public String getDisplayName() { } public String getAgentNames() { - return agentNames != null ? agentNames.toString() : ""; + return agentNames != null ? agentNames.toString() : ""; + } + + @Override + public boolean isSecurity() { + return true; } } From 66beec1c2e731a1a9a98ec5a00bbb6107a603220 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 15:42:49 +0100 Subject: [PATCH 57/80] Bump plugin from 4.35 to 4.37 (#275) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.35 to 4.37. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.35...plugin-4.37) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be6e3339..b03e32af 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.35 + 4.37 ssh-slaves From ba0d6a21f32229aa2de51f458070b6b7cd75cc5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 10:34:55 +0100 Subject: [PATCH 58/80] Bump actions/checkout from 2.4.0 to 3 (#277) Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index b2bc2386..ce0e8718 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -43,7 +43,7 @@ jobs: if: needs.validate.outputs.should_release == 'true' steps: - name: Check out - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK 8 From 2253cedd3295ed8886eb32552d329d0106608775 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Sat, 5 Mar 2022 11:47:29 +0100 Subject: [PATCH 59/80] chore: change the version number format (#278) change the version number format to a one more accurate --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b03e32af..b6a96bfe 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ssh-slaves - ${revision}-${changelist} + ${revision}.${changelist} hpi SSH Build Agents plugin @@ -25,8 +25,8 @@ - 1.33.1 - -SNAPSHOT + 1 + 999999-SNAPSHOT 2.289.1 8 1.31.0 From 80a9538ba9b0bb6caa049cab9eb4d1ee26d51434 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Mon, 7 Mar 2022 11:09:19 +0100 Subject: [PATCH 60/80] chore: test most common SSH connections (#279) --- .../hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java | 2 ++ .../sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java | 2 ++ .../sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java | 2 ++ .../plugins/sshslaves/agents/AgentRSA256ConnectionTest.java | 2 ++ .../sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java | 2 ++ .../sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java | 2 ++ .../sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java | 2 ++ .../sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java | 2 ++ .../sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java | 2 ++ .../sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java | 2 ++ .../sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java | 2 ++ 11 files changed, 22 insertions(+) diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java index e9184ac7..ff7de11f 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentDSAConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentDSAConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-dsa"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java index b491c093..37a2b09a 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp256ConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKexTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKexTest.class}) public class AgentECDHSha2Nistp256ConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-ecdh-sha2-nistp256"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java index 59666c22..b6a475af 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentECDHSha2Nistp384ConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKexTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKexTest.class}) public class AgentECDHSha2Nistp384ConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-ecdh-sha2-nistp384"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java index ed66f2a7..5bfa655e 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA256ConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentRSA256ConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-rsa256"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java index 6c8b64f0..a12387f9 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES128CBC_ConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentRSA_AES128CBC_ConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java index 12ad532a..ca27295f 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_AES192CBC_ConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentRSA_AES192CBC_ConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java index 3527a87f..4a09361b 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DESCBC_ConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentRSA_DESCBC_ConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java index 7403667a..dcfdea27 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentRSA_DES_EDE3CBC_ConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentRSA_DES_EDE3CBC_ConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-rsa"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java index 2f643ff2..855159f9 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1404RSAConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentUbuntu1404RSAConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-14.04"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java index 1793b399..d73777b5 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1604RSAConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentUbuntu1604RSAConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-16.04"; diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java index 73acbab4..2c0cd94f 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu1804RSAConnectionTest.java @@ -11,12 +11,14 @@ import hudson.plugins.sshslaves.categories.AgentSSHTest; import hudson.plugins.sshslaves.categories.SSHKeyAuthenticationTest; import static org.junit.Assert.assertTrue; +import org.junit.Ignore; /** * Connect to a remote SSH Agent * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentUbuntu1804RSAConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-18.04"; From 2d29533b5ea2c2de4d2a832c570651f3d1f237da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 10:14:42 +0200 Subject: [PATCH 61/80] Bump plugin from 4.37 to 4.40 (#282) Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.37 to 4.40. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.37...plugin-4.40) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b6a96bfe..1a552b80 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.37 + 4.40 ssh-slaves From 1083ce377107424f055b869cdf8d6ede963e873e Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Fri, 8 Apr 2022 13:14:42 +0200 Subject: [PATCH 62/80] chore: update Jenkins Core to 2.319 (#284) * chore: update Jenkins Core to 2.319 * test: disable Ubuntu 20.04 tests * Update pom.xml --- pom.xml | 10 +++------- .../agents/AgentUbuntu2004RSAConnectionTest.java | 2 ++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 1a552b80..39698d47 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1 999999-SNAPSHOT - 2.289.1 + 2.319.1 8 1.31.0 @@ -102,8 +102,8 @@ io.jenkins.tools.bom - bom-2.277.x - 961.vf0c9f6f59827 + bom-2.319.x + 1246.va_b_50630c1d19 pom import @@ -111,10 +111,6 @@ org.jenkins-ci.plugins jackson2-api - - org.slf4j - slf4j-api - diff --git a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java index 5151f7de..c08d9e48 100644 --- a/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java +++ b/src/test/java/hudson/plugins/sshslaves/agents/AgentUbuntu2004RSAConnectionTest.java @@ -1,6 +1,7 @@ package hudson.plugins.sshslaves.agents; import java.io.IOException; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -18,6 +19,7 @@ * * @author Kuisathaverat */ +@Ignore("Only for manual test.") @Category({ AgentSSHTest.class, SSHKeyAuthenticationTest.class}) public class AgentUbuntu2004RSAConnectionTest extends AgentConnectionBase { public static final String SSH_AGENT_NAME = "ssh-agent-ubuntu-20.04"; From fad54aa44a03558951b29a0d142060d1534fc1fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 12:23:46 +0200 Subject: [PATCH 63/80] Bump actions/setup-java from 2 to 3 (#285) Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2 to 3. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index ce0e8718..feb707ce 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -47,7 +47,7 @@ jobs: with: fetch-depth: 0 - name: Set up JDK 8 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: 8 From ab864a8847733d168c6284a82365b2fa7f3782a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 17:21:50 +0200 Subject: [PATCH 64/80] Bump sshd from 3.1.0 to 3.228.v4c9f9e652c86 (#287) Bumps [sshd](https://github.com/jenkinsci/sshd-plugin) from 3.1.0 to 3.228.v4c9f9e652c86. - [Release notes](https://github.com/jenkinsci/sshd-plugin/releases) - [Changelog](https://github.com/jenkinsci/sshd-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/sshd-plugin/compare/sshd-3.1...3.228.v4c9f9e652c86) --- updated-dependencies: - dependency-name: org.jenkins-ci.modules:sshd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 39698d47..9cc94948 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ org.jenkins-ci.modules sshd - 3.1.0 + 3.228.v4c9f9e652c86 test From b9e346efff2d6d442805b470ca85d87201bcb79e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 17:22:06 +0200 Subject: [PATCH 65/80] Bump bom-2.319.x from 1246.va_b_50630c1d19 to 1280.vd669827e38cd (#290) Bumps [bom-2.319.x](https://github.com/jenkinsci/bom) from 1246.va_b_50630c1d19 to 1280.vd669827e38cd. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.319.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9cc94948..a2e22e6d 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.319.x - 1246.va_b_50630c1d19 + 1280.vd669827e38cd pom import From ffaccaa4d710cd9c18e4a473f1ac1d846cfb5c60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 14:42:06 +0200 Subject: [PATCH 66/80] Bump testcontainers from 1.16.3 to 1.17.1 (#289) Bumps [testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.16.3 to 1.17.1. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.16.3...1.17.1) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2e22e6d..8e22dea5 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ org.testcontainers testcontainers - 1.16.3 + 1.17.1 test From c82988f54b105e2c85d113dbaeb89baeb1dda727 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 10:38:09 +0200 Subject: [PATCH 67/80] Bump bom-2.319.x from 1280.vd669827e38cd to 1289.v5c4b_1c43511b_ (#291) Bumps [bom-2.319.x](https://github.com/jenkinsci/bom) from 1280.vd669827e38cd to 1289.v5c4b_1c43511b_. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.319.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8e22dea5..e3772597 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.319.x - 1280.vd669827e38cd + 1289.v5c4b_1c43511b_ pom import From dcc863121f366d34c068b269bb74d97efeeac864 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 10:07:03 +0200 Subject: [PATCH 68/80] Bump bom-2.319.x from 1289.v5c4b_1c43511b_ to 1342.v729ca_3818e88 (#293) Bumps [bom-2.319.x](https://github.com/jenkinsci/bom) from 1289.v5c4b_1c43511b_ to 1342.v729ca_3818e88. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.319.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3772597..579517bf 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.319.x - 1289.v5c4b_1c43511b_ + 1342.v729ca_3818e88 pom import From 2d13263f2986172772120b1b4d6af255c1391f43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 13:30:10 +0200 Subject: [PATCH 69/80] Bump jenkins-infra/jenkins-maven-cd-action from 1.2.0 to 1.3.0 (#296) Bumps [jenkins-infra/jenkins-maven-cd-action](https://github.com/jenkins-infra/jenkins-maven-cd-action) from 1.2.0 to 1.3.0. - [Release notes](https://github.com/jenkins-infra/jenkins-maven-cd-action/releases) - [Commits](https://github.com/jenkins-infra/jenkins-maven-cd-action/compare/v1.2.0...v1.3.0) --- updated-dependencies: - dependency-name: jenkins-infra/jenkins-maven-cd-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index feb707ce..983bf1eb 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -52,7 +52,7 @@ jobs: distribution: 'adopt' java-version: 8 - name: Release - uses: jenkins-infra/jenkins-maven-cd-action@v1.2.0 + uses: jenkins-infra/jenkins-maven-cd-action@v1.3.0 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} From 796376b435b519e60b13f3016ccc2baa4d1019f0 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Mon, 9 May 2022 04:31:35 -0700 Subject: [PATCH 70/80] Update information for Windows OpenSSH agents (#294) This updates the description of the prefix/suffix commands for connecting to agents over SSH when Powershell is the default shell on the remote system. --- doc/CONFIGURE.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/CONFIGURE.md b/doc/CONFIGURE.md index a4cf7930..a63fe304 100644 --- a/doc/CONFIGURE.md +++ b/doc/CONFIGURE.md @@ -226,13 +226,16 @@ See [SSH Build Agents and Cygwin](https://wiki.jenkins.io/display/JENKINS/SSH+sl ### Launch Windows agents using Microsoft OpenSSH -The current version of the plugin does not run directly on PowerShell, you have to use prefix and suffix settings to trick the command and make it works, Windows 10 machines can run as SSH agents with the Microsoft OpenSSH server by using: +The current version of the plugin does not run when Powershell is the default shell for the agent system. To connect to the agent you have to use prefix and suffix settings to trick the command and make it work, Windows 10/11 machines can run as SSH agents with the Microsoft OpenSSH server by using: **Prefix Start Agent Command** ``` powershell -Command "cd C:\J\S ; C:\J\S\jdk\bin\java.exe -jar remoting.jar" ; exit 0 ; rem ' ``` + +`C:\J\S` is the path to the agent work directory on the agent system. If java is in a different directory, you will need to specify that directory instead of `C:\J\S\jdk\bin`. + **Suffix Start Agent Command** ``` From 87a762fdaa2c7e98808f2181f2176ebcf42bb9ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 10:46:19 +0200 Subject: [PATCH 71/80] Bump jenkins-infra/interesting-category-action from 1.0.0 to 1.1.0 (#297) Bumps [jenkins-infra/interesting-category-action](https://github.com/jenkins-infra/interesting-category-action) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/jenkins-infra/interesting-category-action/releases) - [Commits](https://github.com/jenkins-infra/interesting-category-action/compare/v1.0.0...v1.1.0) --- updated-dependencies: - dependency-name: jenkins-infra/interesting-category-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 983bf1eb..9d5dd257 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -31,7 +31,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check interesting categories - uses: jenkins-infra/interesting-category-action@v1.0.0 + uses: jenkins-infra/interesting-category-action@v1.1.0 id: interesting-categories if: steps.verify-ci-status.outputs.result == 'success' with: From 1c7698dda8e12a5dd60523bf04d85ba0b80cb972 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 May 2022 16:39:27 +0200 Subject: [PATCH 72/80] Bump sshd from 3.228.v4c9f9e652c86 to 3.236.ved5e1b_cb_50b_2 (#300) Bumps [sshd](https://github.com/jenkinsci/sshd-plugin) from 3.228.v4c9f9e652c86 to 3.236.ved5e1b_cb_50b_2. - [Release notes](https://github.com/jenkinsci/sshd-plugin/releases) - [Changelog](https://github.com/jenkinsci/sshd-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/sshd-plugin/commits) --- updated-dependencies: - dependency-name: org.jenkins-ci.modules:sshd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 579517bf..6e8075b5 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ org.jenkins-ci.modules sshd - 3.228.v4c9f9e652c86 + 3.236.ved5e1b_cb_50b_2 test From e0badc9e5902a3529edfc3d4e976471878b0fb52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 May 2022 11:49:37 +0200 Subject: [PATCH 73/80] Bump sshd from 3.236.ved5e1b_cb_50b_2 to 3.237.v883d165a_c1d3 (#302) Bumps [sshd](https://github.com/jenkinsci/sshd-plugin) from 3.236.ved5e1b_cb_50b_2 to 3.237.v883d165a_c1d3. - [Release notes](https://github.com/jenkinsci/sshd-plugin/releases) - [Changelog](https://github.com/jenkinsci/sshd-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/sshd-plugin/commits) --- updated-dependencies: - dependency-name: org.jenkins-ci.modules:sshd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6e8075b5..b2de117b 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ org.jenkins-ci.modules sshd - 3.236.ved5e1b_cb_50b_2 + 3.237.v883d165a_c1d3 test From d834f8ac390e346ead9e9776046b14e12d9e9593 Mon Sep 17 00:00:00 2001 From: Tomasz Jarosik Date: Mon, 13 Jun 2022 11:55:18 +0100 Subject: [PATCH 74/80] Fix deadlock when afterDisconnect is called during launch() (#304) Deadlock happens between: (a) https://github.com/jenkinsci/ssh-slaves-plugin/blob/main/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L953 (b) https://github.com/jenkinsci/ssh-slaves-plugin/blob/main/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L413 Launch() is stuck here: https://github.com/jenkinsci/ssh-slaves-plugin/blob/main/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L486 , and `callable` is stuck waiting here: https://github.com/jenkinsci/trilead-ssh2/blob/8e7118e74deacd7ef044df9076fcb9b95280c163/src/com/trilead/ssh2/channel/FifoBuffer.java#L212 After some time `afterDisconnect` is called which initiates tear down process. Teardown process calls launcherExecutorService.shutdown() (here: https://github.com/jenkinsci/ssh-slaves-plugin/blob/main/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L941) and continues to (a). But because there is no writer writing to FifoBuffer, launch() never finishes and is stuck in (b), and because `shutdown()` only prevents new tasks being submitted (https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ExecutorService.html) there is no one to interrupt lock.wait() in FifoBuffer, thus deadlock. The solutions is to use recommended way of shutting down ExecutorService from docs. --- .../hudson/plugins/sshslaves/SSHLauncher.java | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java index 7e781f74..d7f56f14 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java @@ -505,11 +505,7 @@ public void launch(final SlaveComputer computer, final TaskListener listener) th System.out.println(Messages.SSHLauncher_LaunchFailed(getTimestamp(), nodeName, host)); } finally { - ExecutorService srv = launcherExecutorService; - if (srv != null) { - srv.shutdownNow(); - launcherExecutorService = null; - } + shutdownAndAwaitTerminationOfLauncher(); } } if (node != null && getTrackCredentials()) { @@ -934,12 +930,7 @@ public void afterDisconnect(SlaveComputer slaveComputer, final TaskListener list // Nothing to do here, the connection is not established return; } - - ExecutorService srv = launcherExecutorService; - if (srv != null) { - // If the service is still running, shut it down and interrupt the operations if any - srv.shutdown(); - } + shutdownAndAwaitTerminationOfLauncher(); if (tearingDownConnection) { // tear down operation is in progress, do not even try to synchronize the call. @@ -982,6 +973,30 @@ private void tearDownConnectionImpl(@NonNull SlaveComputer slaveComputer, final } } + private void shutdownAndAwaitTerminationOfLauncher() { + ExecutorService srv = launcherExecutorService; + if (srv == null) { + return; + } + srv.shutdown(); // Disable new tasks from being submitted + launcherExecutorService = null; + try { + // Wait a while for existing tasks to terminate + if (!srv.awaitTermination(10, TimeUnit.SECONDS)) { + srv.shutdownNow(); // Cancel currently executing tasks + // Wait a while for tasks to respond to being cancelled + if (!srv.awaitTermination(10, TimeUnit.SECONDS)) { + LOGGER.log(WARNING, "launcherExecutorService thread pool did not terminate cleanly"); + } + } + } catch (InterruptedException ie) { + // (Re-)Cancel if current thread also interrupted + srv.shutdownNow(); + // Preserve interrupt status + Thread.currentThread().interrupt(); + } + } + /** * If the SSH connection as a whole is lost, report that information. */ From 2e09e60bcecee905c2dd2ddfff7ebe683d0b2a5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 10:04:25 +0200 Subject: [PATCH 75/80] Bump jenkins-infra/interesting-category-action from 1.1.0 to 1.2.0 (#305) Bumps [jenkins-infra/interesting-category-action](https://github.com/jenkins-infra/interesting-category-action) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/jenkins-infra/interesting-category-action/releases) - [Commits](https://github.com/jenkins-infra/interesting-category-action/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: jenkins-infra/interesting-category-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 9d5dd257..2d96d859 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -31,7 +31,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check interesting categories - uses: jenkins-infra/interesting-category-action@v1.1.0 + uses: jenkins-infra/interesting-category-action@v1.2.0 id: interesting-categories if: steps.verify-ci-status.outputs.result == 'success' with: From ee139c04bb1706e3ab4c2041cb813f20057f09ea Mon Sep 17 00:00:00 2001 From: Joseph Petersen Date: Wed, 15 Jun 2022 16:55:11 +0200 Subject: [PATCH 76/80] chore: use jenkins infra maven cd reusable workflow (#308) --- .github/workflows/cd.yaml | 54 ++++----------------------------------- 1 file changed, 5 insertions(+), 49 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 2d96d859..0279984d 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -8,52 +8,8 @@ on: - completed jobs: - validate: - runs-on: ubuntu-latest - outputs: - should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }} - steps: - - name: Verify CI status - uses: jenkins-infra/verify-ci-status-action@v1.2.0 - id: verify-ci-status - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - output_result: true - - - name: Release Drafter - uses: release-drafter/release-drafter@v5 - if: steps.verify-ci-status.outputs.result == 'success' - with: - name: next - tag: next - version: next - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check interesting categories - uses: jenkins-infra/interesting-category-action@v1.2.0 - id: interesting-categories - if: steps.verify-ci-status.outputs.result == 'success' - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - release: - runs-on: ubuntu-latest - needs: [validate] - if: needs.validate.outputs.should_release == 'true' - steps: - - name: Check out - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: 8 - - name: Release - uses: jenkins-infra/jenkins-maven-cd-action@v1.3.0 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} \ No newline at end of file + maven-cd: + uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 + secrets: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} From 2e6629b7e1001b55eeec4c31098c686114ef2041 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 16:55:30 +0200 Subject: [PATCH 77/80] Bump testcontainers from 1.17.1 to 1.17.2 (#301) Bumps [testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.17.1 to 1.17.2. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.17.1...1.17.2) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2de117b..f7f17c18 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ org.testcontainers testcontainers - 1.17.1 + 1.17.2 test From a64c6e4f4731c1068d079572f013537d46f03c17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 16:55:40 +0200 Subject: [PATCH 78/80] Bump bom-2.319.x from 1342.v729ca_3818e88 to 1409.v7659b_c072f18 (#303) Bumps [bom-2.319.x](https://github.com/jenkinsci/bom) from 1342.v729ca_3818e88 to 1409.v7659b_c072f18. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.319.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f7f17c18..cfde022b 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ io.jenkins.tools.bom bom-2.319.x - 1342.v729ca_3818e88 + 1409.v7659b_c072f18 pom import From 790b08541ff744f797c79135a4647d203110189f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:40:25 +0200 Subject: [PATCH 79/80] Bump sshd from 3.237.v883d165a_c1d3 to 3.242.va_db_9da_b_26a_c3 (#310) Bumps [sshd](https://github.com/jenkinsci/sshd-plugin) from 3.237.v883d165a_c1d3 to 3.242.va_db_9da_b_26a_c3. - [Release notes](https://github.com/jenkinsci/sshd-plugin/releases) - [Changelog](https://github.com/jenkinsci/sshd-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/sshd-plugin/commits) --- updated-dependencies: - dependency-name: org.jenkins-ci.modules:sshd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cfde022b..30a8e783 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ org.jenkins-ci.modules sshd - 3.237.v883d165a_c1d3 + 3.242.va_db_9da_b_26a_c3 test From 3056dfb46e85374da4dc419fda68f7fb094ec953 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 20:05:56 +0000 Subject: [PATCH 80/80] Bump plugin from 4.40 to 4.41 Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.40 to 4.41. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.40...plugin-4.41) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 30a8e783..0aa459c4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.40 + 4.41 ssh-slaves