Operation Not Permitted error while trying to access Network Volumes from the Jenkins shell

Hello,

I have a Jenkins shell that tries to cp -R (copy) a directory of a Network Volume to a local space. The return console log gives me Operation Not Permitted. The process should be running off of the main admin user. I have tried the same command in this Mac's Terminal (Screen Share) and it works perfectly. This problem does not occur on Mojave, only Catalina. I have placed the volumes, finder, sh, bash and Terminal in the Full Disk Access (Security & Privacy). When I follow the command in the Console it sends me Sandbox: cp(93535) System Policy: deny(1) file-read-data /Volumes/... I also do not have access to try turning off the SIP.

If you have any advice please let me know!
Thank you!

Mac OS Catalina 10.15.5
Accepted Answer
Update:

I was checking out the Jenkins Launch agent(.plist) that is running on the Build Machine. And Jenkins gives you a snippet of code to run in the Terminal on the BuildMachine to re-run the Launch Agent. It looks something like this:

java -****** -jar agent.jar -jnlpUrl htp://jenkinsserver.studio.net:/...../*****-agent.jnlp -secret *************

After running this command. Then running the Jenkins Job with a simple command in the Jenkins Execute Shell: ls /Volumes/.....

A prompt popped up on the BuildMachine's screen asking for permission for the Java process (LaunchAgent) to access the network volume. The operation had permission!

Make sure to add the necessary applications to Full Disk Access.

Hope this helps!


Operation Not Permitted error while trying to access Network Volumes from the Jenkins shell
 
 
Q