How to limit ⎕CMD in a timeshare environment

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

How to limit ⎕CMD in a timeshare environment

Postby woody on Mon Feb 18, 2019 11:39 pm

Greetings!

I would like to run a BIG server (Windows or Linux) and run MULTIPLE INSTANCES of DyalogAPL and MiServer on the same server with each instance of MiServer bound to a unique PORT# (8xxx).

I have all of this working quite well under Windows ...

BUT, I have a potential problem with one of the MiServer instances ... where a programmer might accidently enter the command

⎕CMD 'DELETE C:' or something to that effect.

How can I protect the host server from the DyalogAPL so it can not run damaging commands or PowerShell scripts that might destroy or crash the host server.

I can get CLOSE by scanning through the Namespaces ... looking for ⎕CMD but this is hit or miss.

Can I somehow restrict this powerful ⎕CMD command (and maybe 1 or 2 other similar power commands) so I can run dozens of parallel instances of Dyalog APL under MiServer web hosting on one big server and know that APL can not delete or hack system files ?

Thoughts?

Thanks in advance,

//W
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 144
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: How to limit ⎕CMD in a timeshare environment

Postby Morten|Dyalog on Tue Feb 19, 2019 7:56 am

I don't believe there is a general way to limit the power of ⎕CMD - certainly not under Windows - other than perhaps running each user in a Docker Container or similar sandbox, which you simply delete and recycle for each session. I don't think that hosting multiple developers in a single MiServer instance is a safe way to go, they will be able to see and interfere with each other and there is no way to create barriers that will stop a determined hacker. Each user will need a separate execution environment if you are going to prevent them from doing harm to each other.
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm

Re: How to limit ⎕CMD in a timeshare environment

Postby woody on Tue Feb 19, 2019 1:39 pm

I see your point.

APL was born to "own the computer OS" ... which is one of its strong points (system and data integration).

With Virtual servers so cheap now ...

I'll work in the direction of setting up each APL+Miserver instance on its own dedicated (Windows or Linux) server. This is the easiest to configure and manage.

Thanks for the reply.

//W
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 144
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: How to limit ⎕CMD in a timeshare environment

Postby Morten|Dyalog on Wed Feb 20, 2019 8:55 am

I don't think this is anything to do with APL as such. Most programming languages offer a way to make "shell calls" in the same way that you can with ⎕SH or ⎕CMD in APL, and they all suffer from exactly the same problem.
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest