How do I create a web application where I do not have access to the data?

Premise: The requirements for an upcoming project include the fact that no one except for authorized users have access to certain data. This is usually fine, but this circumstance is not usual. The requirements state that there be no way for even the programmer or any other IT employee be able to access this information. (They want me to store it without being able to see it, ever.)

In all of the scenarios I've come up with, I can always find a way to access the data. Let me describe some of them.

Scenario I: Restrict the table on the live database so that only the SQL Admin can access it directly. Hack 1: I rollout a change that sends the data to a different table for later viewing. Also, the SQL Admin can see the data, which breaks the requirement.

Scenario II: Encrypt the data so that it requires a password to decrypt. This password would be known by the users only. It would be required each time a new record is created as well as each time the data from an old record was retrieved. The encryption/decryption would happen in JavaScript so that the password would never be sent to the server, where it could be logged or sniffed. Hack II: Rollout a change that logs keypresses in javascript and posts them back to the server so that I can retrieve the password. Or, rollout a change that simply stores the unecrypted data in a hidden field that can be posted to the server for later viewing.

Scenario III: Do the same as Scenario II, except that the encryption/decryption happens on a website that we do not control. This magic website would allow a user to input a password and the encrypted or plain-text data, then use javascript to decrypt or encrypt that data. Then, the user could just copy the encrypted text and put the in the field for new records. They would also have to use this site to see the plain-text for old records. Hack III: Besides installing a full-fledged key logger on their system, I don't know how to break this one.

So, Scenario III looks promising, but it's cumbersome for the users. Are there any other possibilities that I may be overlooking?

Answers


If you can have javascript on the page, then I don't think there's anything you can do. If you can see it in a browser, then that means it's in the DOM, which means you can write a script to get it and send it to you after it has been decrypted.

Aren't these problems usually solved via controls:

  1. All programmers need a certain level of clearance and background checks
  2. They are trained to understand that rolling out code to access the data is a fireable or worse offense
  3. Every change in certain areas needs some kind of signoff

For example -- no JavaScript on page without signoff.

If you are allowed to add any code you want, then there's always a way, IMO.


Ask the client to provide an Non-disclosure Agreement for you to sign, sign it, then look at as much data as you want.

What I'm wondering is, what exactly will you be able to do with encrypted data anyway? Pretty-much all apps require you to do some filtering of the data, whether it be move it to a required place, modify it, sanitize it, or display it. Otherwise, you're just a glorified pipe, and you don't have to do any work.

The only way I can think of where you wouldn't be looking at the data or doing anything with it would be a simple form to table mapping with CRUD options. If you know what format the data will be coming in as you should be able to roll something out with RoR, a simple skin, put SSL into the mix, and roll it out. Test with dummy data in the same format, and you're set.

In fact, is your client unable to supply dummy data for testing? If they can, then your life is simple as all you do is provide an "installable" and tell them how to edit a config file.


I think you could still create the app in the following way:

  1. Create a dev database and set up a user for it.
  2. Ask them for: the data type, size, and name of each field that needs to be on the screen.
  3. Set up the screens, create columns in the database that accept the data type and size they specify.
  4. Deploy the app to production, hooked up to an empty database. Get someone with permission (not you) to go in and set the password on the database user and set the password for the DB user in the web app.
  5. Authorized users can then do whatever they want and you never saw what any of the data looked like.

Of course, maintaining the app and debugging is gonna be a bitch!

--In answer to comments:

  1. Ok, so after setting up the password for the Username in the database and in the web app's config, write a program that connects to the database, sets a randomized password, then writes that same randomized password to the web config.

  2. Prevent any outgoing packets from the machine except to a set of authorized workstations - so you can't install your spyware.

  3. Then set the Admin password on both servers to the same random password, then delete all other users on the servers, delete the program, and delete the program source code.

  4. Wipe the hard drives of the developer machines with the DOD algorithm, and then toss them into an industrial shredder.

10. If the server ever needs debugging, toss it in the trash, buy a new one, and start back at #1.

But seriously - this is an insolvable problem. The best answer to this really is:

Tell them they can't have an application. Write your stuff on paper. Put it in a folder. Lock it in a vault. Thrust, repeat.


Wouldn't scenario 3 just expose all the data to the magic website? This doesn't sound like a solvable problem (at least I can't think of a solution).


Go with whatever solution is easiest for you to implement, I think the requirements show the the client does not understand software development and so it should be easy to sell any approach you take.


I have to say I really don't like the idea of using JavaScript on the client to decrypt the data. That is a huge hole as any script (hacker, GreaseMonkey, IE7Pro, etc.) can access the DOM and get data out of the page.

Also, it is very hard to get around the problem of key stroke loggers. If you throw those into the mix, then your options are limited. At that point you need a security FOB such as RSA (commonly used with corporate VPNs) to generate truly random PINs. That will probably be expensive, and it is a pain, and I have only seen it used with VPNs but I assume it could work with websites as well.

As far as the website, I'd stick with HTTPS and find a way to encrypt/decrypt through the WebServer rather than relying on JavaScript. The SSL traffic isn't very prone to sniffing (very difficult to decrypt), so that allows the encryption and decryption to happen server-side which (IMHO) is more secure.

Look at banking scenarios and other financial institutions for a starting point, and then go from there. Try not to over-complicate if possible.


You can't guarantee against hacking into the data as long as you have access to the server it lives on. So tell the employer they have to host the data somewhere else and grant access to the client's browser via a secure HTTPS connection.

You can design your web page to dynamically load an XML data stream securely, and format it into a web page using an XSLT script on the client.

See http://www.w3schools.com/xsl/xsl_client.asp for examples

That way you produce the code, but you never have access to the data. Only the user has access to their own data.

As for how the employer is going to host the data without granting any IT people access to it, that's their problem. It's a foolish requirement.


I think that I'll just tell them that they either have to trust a couple of us to have access (and not look at it) or they don't get a project.

Thanks for the answers. Feel free to post more thoughts if you have them.


You can never have 100% security, and extra security comes at a cost of speed/price/convenience etc.

Let's suppose you take scenario 3 - one of your programmers can use social engineering to get the password from one of the users. Goodbye security.

There's no point having a high-security iron door as a gate if people can just walk around it. Just implement a decent level of security.


(They want me to store it without being able to see it, ever.)

Hey, the recording industry wants people to be able to listen to their music, but not copy it. Sounds like they should get together sometime!

Their idea won't work for the same reason DRM doesn't work: the trust chain is inherently compromised. Encryption examples often use Alice, Bob, and Charlie where Alice is trying to communicate with Bob without Charlie listening in. With DRM, the trust chain is compromised because Bob and Charlie are the same person. With your situation, Charlie is the guy writing the software that Alice and Bob use to communicate. There's an implied trust, because if you don't trust Charlie then you can't trust Charlie's software, either.

That's the root of the issue: trust. If they can't trust the programmer, the game is over before it starts.


There are lots of options based on what their goal really is, but I am confused by their paranoia, er, intent:

  • Is this their (and end-user) data that they wish to keep private or end-user data to be kept private from everyone?
  • Is it just that your (or any contracted) company is suspect?
  • Are they afraid of over-the-wire snooping?
  • Are they afraid of DOM access through JavaScript or browser plugins?

Are they planning staged deployment? In that case you work on test/dev server w/o real data but have no access to the production server with the real data, and DNS logging and/or firewall rules inhibit all of your hacks from working undetected.

Ultimately if the data is stored in a DB then the programmer and DB admin can, by working together, get it. Period. A good audit should uncover that, though.


If this is truly a requirement, the only way to guard against this is to hire an outside firm to audit the code prior to releasing the software, and that's going to be very expensive.


Need Your Help

How to force an MS Word download to a particular location

coldfusion coldfusion-9

I used the code below to download an MS Word file to a default download folder. But I need the document to be downloaded to a specific location. How can I do this?

Lining up data with Titanium

javascript format titanium

I need to display 5 lines of summary data at the bottom of a listview. I created a footer and tried: