Physical versus virtual

by acha11 5. May 2009 03:06
physical and virtual are strange words: in computing, at least, we use them as if they were absolutes (i.e., "this is a physical address" might refer to an address in memory, which may not be a physical location at all) when really they're just relative statements about whether something's "more physical" or "more virtual" than our current context.

Authenticating the caller by IP address – is IP spoofing a realistic threat?

by acha11 24. September 2008 11:00

in a network zone protected by firewalls, you'll often have to secure server-to-server communication channels. for example, in an enterprise app, your workflow server might be calling in to your middle-tier business logic web service.

imagine that, for whatever reason, it's difficult to negotiate a web-services based authentication scheme for use between your middle tier web service and the workflow server calling into it. you might consider a network identity-based approach to authenticating the caller: the middle-tier web service could be configure to reject calls not originating from a set of known, trusted IP addresses.

start out assuming that we can trust that the source IP address is actually the IP address of the originating machine. source IP address-based security doesn't adhere to the principle of defence-in-depth: any attacker able to run code capable of talking of the network from a machine with a trusted IP address can then make whatever calls he wants to the exposed service. this differs from, say, an approach where credentials must be presented by the client because an attacker in that case would have to compromise the credential store, which in turn presumably is secured based on a service account's credentials.

now we should question the assumption that the IP address is reliably the IP address of the originating machine: if you read the IP spec, you'll see the "source IP address" field in the IP packet header. this is specified by the sender, so we're vulnerable to IP spoofing, in which an attacker sends his web services-call packet from an untrusted machine, but (here's the spoof) specifies the source address of one of the trusted machines.

there are, however, a few mechanisms which protect against IP spoofing.

firstly, TCP, layered on top of IP, introduces a handshake that initiates a reliable conversation. the initiator sends a SYN, the other party responds with a SYN/ACK, and the initiator finalises the setup with an ACK. if the source IP address has been spoofed, in the second step, the "other" party's SYN/ACK response will go to the source IP address identified in the IP header, not the attacker. this machine's not expecting the SYN/ACK, so it won't send an ACK, so the conversation won't be initiated, so the attack fails.

this leaves the possibility of hijacking a pre-established conversation between a legitimate IP address and the server. TCP guards against conversation hijacking by introducing sequence numbers. running out of time. not sure exactly how sequence numbering protects against malicious attack - surely if the attacker observes the sequence (assuming it's incremental), he can predict the next value (x + 1!) and insert his own malicious packet. later, the legitimate party to the conversation will send a packet with the same sequence number, but it will be dropped as invalid. but the attacker's packet was accepted, so maybe the attack succeeds?

what i may be missing is some cryptographic aspect to sequence numbering which means that the sequence is cryptographically hard to predict.

Service oriented architecture

by acha11 22. April 2005 02:24

in the few days i've spent back at work since my holiday, i've had occasion to think a bit about soa. there's nothing revolutionary here, just my observations as i really get to grips with what everyone's talking about.

here's a verbose working definition of soa dumped straight from my own head (warning: not suitable for use as a learning aid): the compartmentalisation of enterprise application groups into individual applications that communicate using a limited, documented message set where each message corresponds to idempotent operations, and in which no physical transaction boundary spans an SOA application boundary.

by compartmentalising, we assign ownership of (that is, responsibility for and authority over) business data and business processes to specific applications.

by avoiding physical transactions boundaries which span SOA applications, we avoid the issues (e.g. deadlock, performance) associated with distributed transactions.

by only exposing messages which trigger idempotent operations, we allow client (message sending) applications the freedom to re-send a message to re-trigger an application in the event that confirmation of operation completion is never received, safe in the knowledge that even if the original operation WAS performed, the second operation will not result in an invalid transformation of the data model (e.g. a non-idempotent create would, if performed twice, create two records. an idempotent create would detect the second create attempt and not create the second row. this can be implemented by using sequence numbers.)

by documenting the message set, a server application (receiver of messages) goes part way to documenting the interface which it commits to providing. "part way" because the interface consists of more than just the message set; the transport, protocol, etc., as well as the consequences of processing each message type, form part of the contract. "contract first" fanatics tend to over-focus on the message format aspect of contracts as far as i can tell.

by specifying that soa applications should only communicate via the message interface published at the boundary of the soa apps, we ensure that one soa app is not intimately tied to the implementation details of another; implementation can then be changed so long as the interface (message syntax and semantics) is preserved. this can, of course, be costly where the majority of apps in an enterprise are based on a common tech platform. e.g. most apps in a given division of an enterprise will run off the same RDBMS; allowing direct interactions (e.g. replication) between two DBs would be significantly cheaper than a custom message-oriented replication scheme.

Tags:

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

RecentComments

Comment RSS