Suspicious deletion of a project on Jenkins


We noticed today that our project files are deleted from Jenkins setup. We started running build as usual but job was failed with this console output:

[Pipeline] Start of Pipeline [Pipeline] node Running on [Jenkins](http://xxxxxx/computer/(master)/) in /../workspace/..aProject [Pipeline] { [Pipeline] stage (Checkout) Using the ‘stage’ step without a block argument is deprecated Entering stage Checkout Proceeding [Pipeline] sh + pwd /../workspace/..aProject [Pipeline] sh + ls [Pipeline] sh + git status fatal: not a git repository (or any of the parent directories): .git [Pipeline] sh /../workspace/..aProject@tmp/durable-45f1db06/ 1: Bad substitution /../workspace/..aProject@tmp/durable-45f1db06/ 1: Bad substitution [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code 2 Finished: FAILURE

Upon further digging into Jenkins logs we noticed these lines which we never saw this deleting…line before.

sudo cat Workspace\ clean-up.log
[sudo] password for ....u: 
Started at Sun Oct 17 12:10:16 UTC 2021
Checking ..aProject
Finished at Sun Oct 17 12:10:16 UTC 2021. 1ms
Started at Mon Oct 18 12:10:16 UTC 2021
Checking ...aProject
**Deleting /../workspace/..aProject on Jenkins**
Finished at Mon Oct 18 12:10:18 UTC 2021. 2463ms

We were using Jenkins version 2.227 on Ubuntu : Ubuntu 20.04 (LTS) x64, but we just upgraded Jenkins version to 2.316 assuming that some vulnerability caused the above issue.

Could someone let me know what could cause the project files deletion?

Best regards,

Looks like a normal workspace cleanup ( workspace != project source!)

The workspace is typically populated by a checkout from a (remote)repository and should be assumed exclusivly managed and used by jenkins.