Efficient Access Control for Network Event Data

Network events are recorded in a database. Entries for events are partitioned upon storage based on entitlements, e.g., a designation used to determine access privilege. Within a partition, events are sorted, such as based on time stamp. A request referencing an entity identifier from network events and associated with one or more entitlements is received. Entries including the entry identifier and the one or more entitlements are retrieved from the database and subject to a streaming in-memory K-way merge and the merged entries are processed to obtain an aggregation that may be output to a source of the request.

FIELD OF THE INVENTION

The present invention relates generally to systems and methods for detecting spoofed UDP packets.

BACKGROUND OF THE INVENTION

User Datagram Protocol (UDP) is a connectionless protocol in which packets are sent by a source to a destination address without having previously established a connection. Verification of receipt may not be required in some application or be verified by a higher layer in the protocol stack. Because of the connectionless nature of UDP, malicious actors will often send out UDP packets with source addresses of some other entity, i.e., spoofing.

DETAILED DESCRIPTION

Any combination of one or more computer-usable or computer-readable media may be utilized. For example, a computer-readable medium may include one or more of a portable computer diskette, a hard disk, a random access memory (RAM) device, a read-only memory (ROM) device, an erasable programmable read-only memory (EPROM or Flash memory) device, a portable compact disc read-only memory (CDROM), an optical storage device, and a magnetic storage device. In selected embodiments, a computer-readable medium may comprise any non-transitory medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, Smalltalk, C++, or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on a computer system as a stand-alone software package, on a stand-alone hardware unit, partly on a remote computer spaced some distance from the computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).

Referring to FIG. 1, a scanning server 102 may be implemented as a computing device, such as a computing device having some or all the attributes of a computing device 800 described below with respect to FIG. 8. The scanning server 102 may execute a user datagram protocol (UDP) scanner 104. The UDP scanner 104 may generate UDP packets that are then injected into the network stack 106 of the scanning server 102 and transmitted over a network to a UDP target 108. The UDP scanner 104 may operate in a user space of an operating system of the scanning server 102 whereas the network stack 106 operates in the kernel space of the scanning server 102.

The UDP target 108 may be a computer system performing a legitimate or malicious function with the objective of the UDP scanner 104 being to assess the UDP target 108. The network connecting the scanning server 102 to the UDP target 108 may be the Internet 110, a local area network (LAN), wide area network (WAN), or any other type of network.

Referring to FIG. 2A, since UDP is a connectionless protocol, spoofing attacks using UDP are abundant. Any computer system may transmit a packet having the source and destination address thereof set to any address. The UDP scanner 104 may advantageously distinguish between spoofed packets and packets that are responsive to scanning traffic generated by the UDP scanner 104.

The illustrated method 200a may be used to filter out significant quantities of spoofed UDP packets, which reduces the computational burden on the UDP scanner 104 and improves the accuracy of information obtained using the UDP scanner 104.

The method 200a may include the UDP scanner 104 selecting 202 a destination address to which to send a UDP packet. The destination address (e.g., an internet protocol (IP) address) may be selected at random, from a database of known IP addresses of potential threats, or based on some other criteria. Step 202 may further include selecting a destination port, e.g., the port associated with a service, such as secure shell (SSH), hypertext transport protocol (HTTP), or the like.

The UDP scanner may generate 204 a hash of a combination of the destination address, a local address, e.g., an IP address assigned to the scanning server 102, and the destination port. The local address may be one of multiple local addresses assigned to the scanning server 102 (see FIGS. 4A to 4C and associated description, below). The hashing function may be a lossy hash function in that multiple combinations of destination and local addresses may yield the same hash. For example, the number of bits available to represent the hash may be 16 bits or less whereas the destination and local address may each include 16 bits, 32 bits, or more. In some embodiments, the hash function is a Fibonacci hash function, though other lossy hash functions may also be used.

In some embodiments, the hash is generated from the destination address, local address, destination port and a random seed. The random seed may be a randomly, or pseudo-randomly, generated value. The random seed may be associated with a particular time period: each UDP packet generated by the UDP scanner 104 during a time period may use the same random seed. The random seed may be stored in association with the time period and used as described below. The time period may have a duration of one second or less, one minute or less, one hour or less, or a larger duration.

The UDP scanner 104 may then generate 206 a probe UDP packet (“the probe packet”) including the destination address and local address as the destination and source addresses of the packet and an ephemeral source port number. The ephemeral source port number may be set equal to the hash. Alternatively, a portion of the bits of the ephemeral source port number maybe set equal to the hash with other bits of the ephemeral source port number being used for other purposes (see FIG. 4C and corresponding description).

Other fields of the probe packet and the payload data may be selected by the UDP scanner 104 according to any approach known in the art. In particular, payload data may be selected to mimic a particular service, attempt to access a particular service, or other action. The payload data may also be random data. The destination port number of the probe packet may be the port conventionally used for the service mimicked by the payload data.

The UDP scanner 104 may inject 208 the probe packet from step 206 in the network stack 106, which then forwards 210 the probe packet to the destination address, e.g., the UDP target 108. The UDP target 108 may either ignore the probe packet or transmit 212 a response packet. An actual response from the UDP target 108 that is a response to the probe UPD packet will include the local address from the probe packet as the destination address, the source address of the UDP target 108 as the source address, and the ephemeral port number from the UDP packet as the destination port number. The response from the UDP target 108 may include the destination port number of the probe packet as the source port number thereof.

FIG. 2B illustrates a method 200b that may be performed in order to filter out spoofed UDP packets. For example, the method 200b may be used to determine whether a UDP packet (“response packet”) transmitted 220 from a UDP source 222 was transmitted by a UDP target 108 in response to a probe packet in a previous iteration of the method 200a.

The network stack 106 may receive the response packet and forward 224 the response packet to the UDP scanner 104. The UDP scanner 104 may retrieve 226 a random seed used in a previous iteration of the method 200a. For example, the UDP scanner 104 may retrieve the random seed for a time period including the current time and one or more random seeds for one or more time periods immediately preceding the current time, such as one, two, or more time periods. In particular, the number of time periods may correspond to a maximum delay expected or allowed to receive a response to a probe packet. E.g., the oldest time period for which a random seed is retrieved may include the time of receipt of the response packet minus the maximum delay.

The method 200b may include generating, for each random seed retrieved at step 228, a hash from the source address, destination address, source port, and the random seed. The arrangement of these values when applying the hash function may match the ordering of step 204 of the method 200a. For example, the list below describes the substitution of fields of the probe packet used at step 204 for fields of the response packet when generating the hash at step 228:

The result of step 228 is a hash that may be compared 230 to the destination port of the response packet. A packet sent from a UDP target 108 will use the ephemeral port of the probe packet as the destination port and will therefore match. A packet that is not sent from a UDP target 108 will most likely not match, though there is a non-zero probability that a match may occur. For example, at least 90 percent of spoofed packets may be correctly identified as such and ignored. This drastically reduces the amount of computational resources wasted by processing spoofed packets.

If the hash does not match the destination port of the response packet, the response packet is deemed 232 a spoofed packet and may be ignored. If the hash does match the destination port of the response packet, then further action may be taken. For example, the method 200a may include scanning 234 the UDP source 222. Scanning 234 may include performing a scan of some or all layers of the network stack of the UDP source 222. Scanning 234 may include verifying that a service in fact exists at the source of the response packet, e.g., the service corresponding to the destination port of the probe packet and/or the payload of the probe packet.

Referring to FIG. 3, in some embodiments, a UDP scanner 104 may additionally or alternatively, implement a plurality of UDP probes 300. Each UDP probe 300 generates packets intended to mimic or otherwise engage a particular service. Each UDP probe 300 may therefore use port numbers, payload data, and/or other formatting that mimics the behavior of a client or server participating in a particular service. In other embodiments, a UDP probe 300 may generate payloads including random data with different probes generating different types of random data.

There may be many UDP probes 300, such as at least 10, at least 100, at least 1000, or more UDP probes 300. The UDP scanner 104 may have a plurality of local addresses, e.g., local internet protocol (IP) addresses, assigned thereto. Each probe 300 is assigned, or assigned to, a local address of the plurality of local addresses. Assignments of the UDP probes 300 may be distributed (e.g., evenly) among the local addresses with some variation from an even distribution where the number of UDP probes is not evenly divisible by the number of local addresses. Each UDP probe 300 may further be assigned, or assigned to, one of a plurality of probe indexes. The probe indexes assigned to UDP probes 300 assigned to the same local address are unique. However, the same indexes may be assigned to other UDP probes assigned different local addresses. Accordingly, the local address and index of a UDP probe 300 uniquely identifies each UDP probe 300.

For example, as shown in FIG. 3, one UDP probe 300 is assigned probe index A and local IP address L1 whereas another UDP probe 300 is assigned probe index A and local IP address L2. The number of probe indexes may correspond to a number of bits available to represent the probe index in a probe packet as described below, such as 8 probe indexes for three bits, 16 probe indexes for four bits, and so on.

For example, the ephemeral port number 302 in a probe packet may include a probe index field 304 that records the probe index of a UDP probe 300 that generated the payload and/or other fields of the probe packet. The probe index field 304 may occupy less than all of the bits used to represent the ephemeral port number. The remaining bits of the ephemeral port number may be occupied with random data or a hash field 306. A hash included in the random data or hash field 306 may be a hash generated as described above with respect to the method 200a.

FIG. 4A illustrates a method 400a for transmitting a UDP probe packet (“probe packet”) from a UDP probe 300. The method 400a may be performed for some or all UDP probes 300 defined by the UDP scanner 104.

The method 400a may include the UDP scanner 104 receiving 402 a UDP payload from the UDP probe 300. The UDP payload may be formatted and/or contain data corresponding to a particular service. Step 402 may include receiving a destination port number corresponding to the service.

The method 400a may include the UDP scanner 104 generating 404 an ephemeral port number. For example, step 404 may include adding a probe index of the UDP probe 300 to the ephemeral port number. Step 404 may include adding a hash to the ephemeral port number, the hash being generate according to step 204 of the method 200a.

The method 400a may include generating 406 a UDP probe packet (“probe packet”) including the ephemeral port number as the source port, the destination port from step 402 as the destination port, and the local address of the UDP probe 300 as the source address. The destination address may be set to that of the UDP target 108, which may be selected as described above with respect to step 202 of the method 200a. The probe packet may further include the payload data from step 402. The UDP scanner injects 408 the probe packet into the network stack which then forwards 410 the probe packet to the destination address of the UDP packet, i.e., the UDP target 108.

The UDP target 108 may then transmit 412 a response UDP packet (“response packet”) to the scanning server 102, the response packet including the ephemeral port number as the destination port and the local address of the UDP probe 300 as the destination address. The source address of the response packet may be the destination address of the probe packet and the source port of the response packet may be the destination port of the probe packet.

FIG. 4B illustrates a method 400b for assigning received packets to UDP probes 300. A UDP source 222 transmits 420 a response packet that includes the local address of a UDP probe 300 as the destination address thereof and a destination port number. The network stack 106 receives the response packet and forwards 422 the response packet to the UDP scanner 104.

The UDP scanner 104 extracts 424 bits from the destination port number of the response packet. For example, the N least significant bits may be used at step 404 of the method 400a such that the N least significant bits are extracted 424. Other bit locations, including the N most significant bits may be used in a like manner. N may be any integer up to the total number of bits used to represent the destination port number, such as 3, 4, or more bits.

The UDP scanner may map 426 the extracted bits and the destination address of the response packet to a UDP probe 300 having a probe index matching the extracted bits and a local address matching the destination address of the response packet.

The response packet may then be processed further with respect to the UDP probe 300 identified at step 426. For example, one or more metrics of the UDP probe 300 may be updated 428. For example, one objective of the UDP scanner 104 may be to identify services on hosts and to identify those UDP probes 300 that are successful at eliciting a response from hosts. Accordingly, step 426 may include updating a counter or other metric to indicate that the UDP probe 300 received yet another response.

Referring to FIG. 4C, in some embodiments, the methods 200b and 400b may be combined to implement the illustrated method 400c in order to filter out spoofed UDP packets as well as associate packets with UDP probes 300. For example, steps 420 and 422 may be followed by performing steps 226-232 of the method 200b. For those packets that are not identified 232 as spoofed packets, steps 424, 426, and 428 may be performed. In this manner, the metrics for the UDP probes will be made more accurate by eliminating most spoofed UDP packets.

Referring to FIG. 5, the approaches described with respect to FIGS. 1-4C may generate events. An event may, for example, be detection of a spoofed packet (see step 432 of the method 200b), updating a of a probe metric (see step 428 of the methods 400b, 400c), a threat assessment, or other type of events. Events may include any record of a specific packet, a specific network connection, or any other network data that may be detected.

There maybe many millions, billions, or even a trillion or more events. For example, a billion events or more per day may be generated. Accordingly, generating representations of such events and controlling access thereto is a challenge. The method 500 of FIG. 5 may be used to store a representation of events that facilitates subsequent access control and retrieval.

The method 500 may include receiving 502 events and partitioning 504 the events according to entitlements. Entitlements may be used to determine an access privilege or have an associated access requirement according to any role-based access control (RBAC) known in the art. An entitlement may therefore enable the determination for a specific requester whether specific data or data of a specific type is accessible by the requester.

Entitlements may define an access privilege associated with a user identifier of a requester, a user group or business to which a requester belongs, a geographic region where a requester is located, a particular network or subnetwork (e.g., subnet mask) in which a requester is located, a particular cloud computing platform or region of a cloud computing platform, or other entity or group of entities. Entitlements may be associated with a particular protocol (hypertext transfer protocol (HTTP), transmission control protocol (TCP), user datagram protocol (UDP)). Entitlements may be associated with a particular type of event, e.g., identification of a threat, identification of a service, update to a probe metrics, identification of a spoofed metric, or the like.

The entitlements associated with an event may be associated with a source or destination address of a packet represented by the event (e.g., a spoofed packet or a packet used to update a probe metric as described above). For example, an address, range of addresses, domain, or other sub-division of addresses may be associated with a user identifier, group identifier, business unit identifier, or other entity. The entitlement associated with an event may be an entitlement associated with a user identifier of an owner of a process that generated the event, e.g., that performs the method 200a, 200b, 400a, 400b, and/or 400c that generated the event.

The method 500 may include writing 506 event entries to a database according to the partitioning of step 504 and a time stamp, e.g., a time at which the event was generated. The database may be implemented by the same computing device executing the method 500 or a different device. The time stamp may be a time associated with a packet (e.g., sequence number) that generated the event, a time at which a method 200a, 200b, 400a, 400b, and/or 400c that generated the event started or ended, a time at which the entry is formatted and prepared for writing to the database, or some other time that enables events to be ordered exactly or approximately (e.g., within 100 milliseconds) according to time of occurrence.

Each entry of the database for an event may include an entity identifier (ID) column 600, an entitlement column 602, a time stamp column 604, and event data column 606.

The entity identifier column 600 may record an identifier of an identity referenced by an event. For example, the entity identifier may record the address (e.g., destination address for inbound packets relative to the receiving entity from step 502 or source address for outbound packets) of a packet that generated the event (e.g., was found to be spoofed, to be a threat, or that resulted in the updating of probe metrics). The entity identifier may record other information, such as a protocol of the packet (e.g., transmission control protocol (TCP), hypertext transfer protocol (HTTP), etc.).

The entitlement column 602 may record the entitlements for an event as defined above, such as in the form of a user identifier, region identifier, group identifier, business unit identifier, an entitlement classification (e.g., public, private, etc.), event type (service identification, spoofed packet identification, probe metric update, threat identification, etc.) or other data that can be evaluated to determine whether a specific user identifier is authorized to access data.

The time stamp column 604 may include a time stamp for an event as defined above. The time stamp may be in a date and time format according to any standard known in the art, such as the ISO 8601 format or other format. The time stamp may be an index that may be used to compare time of occurrence of events but that does not necessarily resolve to an exact time and date. The time stamp may represent an elapsed time from a reference time point, e.g., milliseconds of a current epoch.

The event data column 606 may include information describing, defining, or characterizing the event represented. For example, for a packet determined to be spoofed, the event data column 606 may record this fact, payload data of the packet, a source address for an inbound packet relative to the receiving entity from step 502 or source address for an outbound packet. The event data column 606 may store a probe metric updated in response to a packet, such as an identifier of the probe metric, a change to the probe metric resulting from the update, and/or value of the probe metric following updating at step 428. The event data column 606 may reference a service associated with an event. For example, a probe packet may have a payload mimicking a service or a probe metric may be for a probe intended to mimic or discover a service. Accordingly, the event data column 606 for an event (spoofed packet, update to a probe metric, or other event) resulting from a probe packet may reference the service mimicked by the probe packet or associated with a port number of the probe packet. For example, the event data column 606 may record an identifier of the service, the port number associated with the service, and/or other information. The event data column 606 may additionally or alternatively store other data describing the packet or context in which the packet was received.

As shown in FIG. 6, the database may be partitioned based on entitlement such that entries including the same entitlement (entitlement A, entitlement B, entitlement C) are grouped together, e.g., in a contiguous set of entries. Within a group of entries having the same entitlement, the entries may be sorted based on time stamp, e.g., latest time stamp first.

FIG. 7 illustrates a method 700 for generating views of a database, such as a database generated according to the approach described above with respect to FIGS. 5 and 6.

The method 700 may include receiving 702 one or more entity identifiers, such as in a request from a requester. In some embodiments, a single entity identifier is received. The entity identifier may include any of the item of information that is described above as being potentially included in the entity identifier column 600.

The method 700 may include receiving 704 one or more time bounds, such as a starting time with an ending time being the current time or a starting time and an ending time. The time bounds may have the same format as the entries in the time stamp column 604 or may be converted to the same format. The one or more time bounds may be included in the request. In some embodiments time bounds are omitted and all entries of the database are evaluated without regard to time bounds. Alternatively, default starting and/or ending time bounds may be used.

The method 700 may include receiving 706 entitlements. Receiving 706 entitlements may include receiving a user identifier of a requester that submitted the request, such as through a client application (e.g., web browser) that is authenticated with respect to the user identifier. Entitlements associated with the user identifier may then be retrieved, such as from an entitlement database. For example, a user identifier may be associated with some or all of a region identifier, group identifier, business unit identifier, an entitlement classification (e.g., public, private, etc.), event type (service identification, spoofed packet identification, probe metric update, threat identification, etc.) or other data that defines an entitlement.

The method 700 may include retrieving 708 entries from the database, each entry including both of (a) the entity identifier received at step 702 in the entity identifier column 600 thereof and (b) at least one of the entitlements from step 706 in the entitlement column 602 thereof. The retrieving 708 may be made efficient due to step 708 being a read of K contiguous row ranges, where K is the number of entitlements received at step 706. For example, the contiguous row ranges may be expressed as “(entity_identifier, entitlement-1, start-timestamp, end-timestamp) . . . (entity_identifier, entitlement-K, start-timestamp, end-timestamp),” where both start and end timestamps are optional. Because each read is a contiguous range and is stored in a sorted format, the reads are extremely efficient.

The method 700 may include performing 710 a K-way merge of the entries from step 708. The K-way merge may be performed with respect to the entitlements received at step 706. The K (e.g., where K is an integer) of the K-way merge may refer to K different entitlements represented in the entitlements received at step 706. The K-way merge has the advantage of preserving previous ordering of the entries, such as ordering according to time stamp. In some embodiments, step 710 may include performing a streaming K-way merge in memory, e.g., without performing writes to persistent storage. The result of step may therefore be a stream of entries transmitted to a consumer of the entries. Performing an in-memory K-way merge makes it possible to generate aggregates on vast row ranges that would otherwise be cost-prohibitive to hold in memory.

The method 700 may include generating 712 an aggregate representation of the entries as merged at step 710. For example, the consumer may be an application that generates an aggregation, summary, visualization, or other representation of the entries. The aggregation may include a histogram of values represented in the event data column 606 or other statistical characterization of the values (maximum, minimum, average, standard deviation, etc.). The aggregate representation may be output to a user, such as a source of the information from steps 702 and 704. Step 712 may be performed on a different device from steps 702-710. For example, the merged entries may be streamed to a remote device that may then aggregate 712 the entries and output a representation of the aggregation to a display device coupled to the remote device.

In one example use case, the aggregate representation is a representation of the device and software that were scanned to generate the events represented by the aggregation. For example, event data for an event may indicate that “IP address X was scanned with Probe Y and received Data Z.” The aggregate representation may communicate that “there is a SSH service active on IP X with open-ssh version V.” The aggregate representation may correct for artifacts such as transient scanning failures and geolocational differences. The entitlements a user can access may thus change the resulting state of the aggregate representation significantly. For example, if the user is able to utilize scan data gathered from a specific geolocation or from a specific probe. In some application, it is not feasible to store the data in the aggregate form because there are 2{circumflex over ( )}N possible aggregates, where N is the number of available entitlements. The streaming K-way merge is therefore an efficient way to supply data for aggregation.

FIG. 8 illustrates an example computing device 800 that may be used to implement the scanning server 102, UDP target 108, or any UDP source 222. The computing device 800 may be used to implement the methods 500 and 700. The scanning server 102 may have some or all of the attributes of the computing device 800 of FIG. 8. FIG. 8 is also a block diagram illustrating an example computing device 800 which can be used to implement the systems and methods disclosed herein.

Computing device 800 includes one or more processor(s) 802, one or more memory device(s) 804, one or more interface(s) 806, one or more mass storage device(s) 808, one or more Input/Output (I/O) device(s) 810, and a display device 830 all of which are coupled to a bus 812. Processor(s) 802 include one or more processors or controllers that execute instructions stored in memory device(s) 804 and/or mass storage device(s) 808. Processor(s) 802 may also include various types of computer-readable media, such as cache memory.

Mass storage device(s) 808 include various computer readable media, such as magnetic tapes, magnetic disks, optical disks, solid-state memory (e.g., Flash memory), and so forth. As shown in FIG. 8, a particular mass storage device is a hard disk drive 824. Various drives may also be included in mass storage device(s) 808 to enable reading from and/or writing to the various computer readable media. Mass storage device(s) 808 include removable media 826 and/or non-removable media.

I/O device(s) 810 include various devices that allow data and/or other information to be input to or retrieved from computing device 800. Example I/O device(s) 810 include cursor control devices, keyboards, keypads, microphones, monitors or other display devices, speakers, printers, network interface cards, modems, lenses, CCDs or other image capture devices, and the like.

Display device 830 includes any type of device capable of displaying information to one or more users of computing device 800. Examples of display device 830 include a monitor, display terminal, video projection device, and the like.

Interface(s) 806 include various interfaces that allow computing device 800 to interact with other systems, devices, or computing environments. Example interface(s) 806 include any number of different network interfaces 820, such as interfaces to local area networks (LANs), wide area networks (WANs), wireless networks, and the Internet. Other interface(s) include user interface 818 and peripheral device interface 822. The interface(s) 806 may also include one or more user interface elements 818. The interface(s) 806 may also include one or more peripheral interfaces such as interfaces for printers, pointing devices (mice, track pad, etc.), keyboards, and the like.

Bus 812 allows processor(s) 802, memory device(s) 804, interface(s) 806, mass storage device(s) 808, and I/O device(s) 810 to communicate with one another, as well as other devices or components coupled to bus 812. Bus 812 represents one or more of several types of bus structures, such as a system bus, PCI bus, IEEE 1394 bus, USB bus, and so forth.

The foregoing description has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the disclosure to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. Further, it should be noted that any or all of the aforementioned alternate implementations may be used in any combination desired to form additional hybrid implementations of the disclosure.