My company does Point of Sale Software Development, Consulting, and Managed Services for Retail and Hospitality (Restaurants/Hotels) chains, both large and small-scale, and everything in between. Part of this involves the design and implementation of a slimmed-down Linux or Windows OS Image that has our POS Application and its dependencies baked in so that it can be deployed to hundreds-thousands of Tills easily via PXE Boot, or by some unlucky prick they talked into driving to every store to deploy the image via Flash Drive (We, once, had a customer convince one of their employees to do this to 1.) Retrieve logs and 2.) Deploy patches to our application - Totally ignoring the Central Management Server they paid hundreds of thousands of dollars for that has functions for these tasks built in to allow remote access at the touch of a button.).
I've only been exposed to the OS Creation and implementation aspect recently (Within the last 4 months or so), and have since learned of several
fundamental security flaws in both our Application itself, as well as the original design of our POS OS Image.
For example, we cache all Product, Customer, and Transaction data locally on each machine in an Oracle, DB2, or MySQL database (Depending on customer requirements) to allow Lanes to be up even if the Central Server goes down. Once the server's back up, all Tills will send up their transaction data and the Central Server will send down any updates it received once coming back online. The credentials for this database are stored in
plaintext properties files, which are readable and accessible by the default user (The one that auto-runs the Desktop on startup.) at any time.
But don't worry, they encrypted the credentials in the properties file with DES (Notice I didn't say Triple), and left the DES Encryption Module Class (Which contains a Main() Method, so it can be run at any time by the default user) in a directory 1 level down from the root directory called "encryption". In 3 commands, you can have the Database's credentials and all customer information, and you wouldn't have had to enter a single password that wasn't provided.
And let's not forget that our application is based on Java Applets, which are deprecated and vulnerable as fuck - And we don't Checksum or otherwise validate ANY Classes before they're loaded at startup, so you can tell the application to load whatever custom-compiled classes you want it to and it will without a single complaint.
But what disgusts me the most is that our customers will run a Pentest AFTER they've taken our systems into Production, AND ALL THEY COMPLAIN ABOUT IS THE GODDAMN SSH CONFIGURATION AND JAVA VERSION BEING 2 UPDATES BEHIND? And our own, internal security specialists have the nerve to complain that the customer "ran a Pentest against our system without my involvement or permission." THEY'RE MAKING OUR SYSTEMS RESPONSIBLE FOR THEIR CUSTOMERS' TRANSACTION DATA - OF COURSE THEY'RE PENTESTING IT YOU FUCKING MORON.
I mean, do they just pick security specialists up off the fucking streets? I don't even have a background in Security, and these issues are glaringly obvious to me.
So anyways, I'll be Black-Boxing the entire goddamn application using some Linux-specific tricks of the sudoers file and some other trickery. If I can remove read and write access to all of our application files by adding a new default Desktop user, and only giving them the ability to start our application indirectly via sudo by using sudoer file modifications and black-boxed deployment scripts, I should be able to prevent a System-wide security breach or unintended analysis of our application (Technical details below). Hopefully, we don't end up on the cover of Wired Magazine for the most severe Retail security breach in history before then.
Problem: You have User A and User B. You want User A to run a script owned by User B, but not be able to read the contents of that script for security reasons. Maybe it contains a hardcoded password, or otherwise confidential information that User A should not have access to.
Solution: Remove non-owning Read/Execute from your confidential script (chmod 700). Create a script in /usr/bin that calls the confidential script that you intended to run. Remove write permissions from this Calling script, and make it owned by Root (chmod 755). You can configure the sudoers file (defines restrictions for the use of sudo command) to allow User A to run the calling script as User B (Or root), which triggers the confidential script.
Solution extra steps: A this point, someone could use a Process Analyzer to view the contents of confidential script as you're running it, since by default, users have access to processes owned by other users. In order to prevent this, you'll need to
remount the /proc directory with hidepid level=2.
This solution will be extended for my purposes by having the POS Application user made to be anything but the default Desktop user. A new default user will be created, who will be granted permissions to run a script via sudo that calls the POS Application start script as the POS Application user. And then read access will be removed from virtually everything on the machine for the default user, making them only capable of executing the Graphical Display and the POS Application indirectly.
Cain, or anyone else: Do you have any other recommendations for securing our Image and Application? Or do you think a Black Box designed like above with a LUKS-encrypted harddrive would suffice?