pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:
I recently wrote a question, Good IPC Message Protocols?, and wrote it badly. I know I wrote it badly because %90 of the answers weren't to the question I wanted to ask. Sigh... I accept full responsibility and beg my brethren and sistren's forbearance. Achem... And I'll give it another go.
SHORT VERSION: What's the best way to serialise a message so as to make it easy for the receiver to reject bad messages?
LONG VERSION:
I'm building a client server app on Linux. The server has root privileges and does special root-like things on behalf of the client. The client talks to humans and passes requests to the server. For the communication between the client and server I'm using unix domain sockets, so I don't need to worry about encryption and I can even limit access with file system permissions. This is all on one machine, no network required.
Authentication happens inside the server on behalf of the user. So, for instance, the user submits a username, password and request. This means I base my trust on the provided credentials, not any assumptions about the client.
My #1 priority is ensuring that baddies can not trick my server into doing bad things. I assume that baddies own my client and everything in it. When my client passes a request to my server, I want that request to come in a very very strict format. I don't want it to be so strict that I have to pre-code every possible interaction, but I want it strict. Again, I'm talking about the format of the messages themselves, not the carrier protocol.
Said another way, if my server does SQL on behalf of the client, I really really don't want SQL injection attacks to happen.
I want to find the best way to serialize it so as to minimize the chance that I'll un-serialize it wrong. YAML, SOAP, etc... are good possibilities, but they're pretty broad and I think can get better security with something simpler and stricter.
Okay, I'm going to stop now. Hopefully this makes sense this time...
Thank you! If you've read this far, you are a hero!
--Pileofrogs
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IPC Messages Redux
by zwon (Abbot) on Jan 30, 2009 at 21:13 UTC | |
by Your Mother (Archbishop) on Jan 30, 2009 at 23:40 UTC | |
|
Re: IPC Messages Redux
by salva (Canon) on Jan 30, 2009 at 21:11 UTC | |
|
Re: IPC Messages Redux
by BrowserUk (Patriarch) on Jan 31, 2009 at 01:02 UTC | |
by pileofrogs (Priest) on Feb 02, 2009 at 18:32 UTC | |
|
Re: IPC Messages Redux
by gone2015 (Deacon) on Jan 31, 2009 at 01:30 UTC | |
by Beechbone (Friar) on Feb 02, 2009 at 11:34 UTC | |
by pileofrogs (Priest) on Feb 02, 2009 at 18:41 UTC | |
|
Re: IPC Messages Redux
by Your Mother (Archbishop) on Jan 31, 2009 at 01:06 UTC | |
|
Re: IPC Messages Redux
by hbm (Hermit) on Feb 02, 2009 at 18:09 UTC | |
by pileofrogs (Priest) on Feb 02, 2009 at 18:46 UTC |