Service Function Chaining
Use Cases for Network SecurityCisco Systems Inc.170 W Tasman DrSan JoseCA95134U.S.A.ejwang@cisco.comCisco Systems Inc.170 W Tasman DrSan JoseCA95134U.S.A.kleung@cisco.comCisco Systems Inc.170 W Tasman DrSan JoseCA95134U.S.A.jefelix@cisco.comCisco Systems Inc.170 W Tasman DrSan JoseCA95134U.S.A.jiyer@cisco.comF5 Networks3545 N 1st StSan JoseCA95134U.S.A.pradeeppatel@gmail.com
General
Service Function ChainingtemplateEnterprise networks deploy a variety of security devices to protect
the network, hosts and endpoints. Network security devices, both
hardware and virtual, operate at all OSI layers with scanning and
analysis capabilities for application content. Multiple specific devices
are often deployed together for breadth and depth of defense. This
document describes use cases of Service Function Chaining (SFC) when
deploying network security devices in the manner described above and
also puts forth requirements for their effective operation.Network security service nodes participate in Service Function
Chaining (SFC) to provide comprehensive solutions for securing campus
and data center enterprise networks. Often, network operators deploy
various types and instances of security service nodes. These nodes are
complementary to one another for the purpose of coverage, depth of
defense, scalability and availability.In addition to packet forwarding, network security devices can
buffer, inject or block certain packets, as well as proxy entire
connections. Most of the network security devices maintain state at the
connection, session or transaction levels. When used in a SFC
environment these security Service Function actions and properties
require careful design and extension including the Service Classifier
and Service Function itself. This document attempts to describe the
detailed use cases that lead to the requirements to support network
security functions in SFC.The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119.This document uses the terms as defined in RFC
7498, RFC 665 and .In addition the following terms are defined.A Security
Service Function is a Service Function that carries out specific
security tasks. We limit the scope of security functions to network
security in this document (as opposed to functions such as endpoint
security). In addition to the general forwarding action, a Security
Service Function can buffer, proxy, inject or block certain packets
based on its policy. A Security Service Function can maintain state
at the connection, session or transaction levels. Sample Security
Service Functions are: Firewall, Intrusion Prevention/Detection
System (IPS/IDS), Deep Packet Inspection (DPI), Application
Visibility and Control (AVC), network virus and malware scanning,
sandbox, Data Loss Prevention (DLP), Distributed Denial of Service
(DDoS) mitigation and TLS proxy.A flow is a uni-directional traffic stream
identified by network layer attributes, specifically IP addresses
and TCP/UDP ports for TCP/UDP traffic.A connection is a bi-directional traffic
stream composed of two flows sharing the same network layer
attributes.Most Security Service Functions are stateful. They maintain state at
the connection, session or transaction levels, depending on the OSI
layers that they act on. Many Security Functions require receiving both
directions of the client-server traffic in order to maintain state
properly. Asymmetric traffic must be normalized before packets reach the
Security Functions.Security Service Functions operate on network layer data with
specific behaviors. For example:A Firewall tracks TCP state between the TCP client and server.
TCP packets that do not correspond to the Firewall's maintained
state are likely to be dropped.A Firewall can modify the L3/L4 headers for NAT . The flow attributes in the packet header may be
changed after the packet egresses the Firewall.A Firewall can proxy a TCP connection by sending a TCP ACK on
behalf of the endpoint. From the SFC perspective, this results in
Service Function generated packets being injected into the service
path in the reverse direction.A Firewall or DDoS mitigator can inject TCP layer challenges to
the originating client before the intended server receives a packet
from the client.Security Functions also handle packets and examine data at
higher OSI layers. For example:A Firewall can inspect the HTTP header and body data. Based on
the inspection results, the firewall can decide to drop the packet
and/or block the connection completely.A Web proxy can inject an HTTP challenge page into an HTTP
transaction for the purposes of authentication and identity
collection.At the enterprise edge, a TLS proxy, when authorized, operates as
a trusted Man-in-the-Middle to proxy the TLS handshake and decrypt
the packet data. The TCP payload may be completely different between
ingress and egress of TLS Proxy.A stream scanning service examines a certain set of application
data. File scanning engines examine file streams of specific
types.Many Security Service Functions require receiving bi-directional
traffic of a connection. For example, a DDoS mitigator may require
to see the return traffic to maintain proper state.Return traffic (i.e. server to client response) should be
classified based on the forward traffic (i.e. the client to server
request). This allows server's return traffic to be associated with
the clients forward traffic. The forward and return traffic forms a
single bi-directional connection and shares Service Function Paths
with similar set of Service Functions.In the figure below, the Service Classifier handling traffic from
Host B must be able to identify return traffic (flow 2) and select
the Service Function Path with “DDoS”. Flow 1 and 2 form
a connection and traverse DDoS in both directions.Even if a Security Service Function requires receiving
bi-directional traffic of a connection, it should not necessarily
receive traffic initiated from all network segments for performance,
availability, and scalability reasons. For example, a DDoS mitigator
is configured to receive bi-directional traffic initiated from the
Internet, but not for traffic initiated from the internal
network.Traffic initiated from a network segment should be classified
independently. In Figure 1(b), the Service Classifier for Host B
must identify traffic initiated by Host B (flow 3) and classify it
independently. Such traffic bypasses the DDoS Service Function in
this example.The Service Classifier must distinguish between flow 2 and flow
3, both of which are from Host B to Host A. In other words, it must
be able to identify the initiator and responder of a connection.A Service Classifier that keeps certain state would be able to
handle the above requirements. The state should be accessible by
each Service Classifier if there are multiple instances handling
traffic sources from various network segments.The Service Classifier evaluates SFC Policies (i.e. Service
Policies) in order to determine the traffic and associated Service
Function Paths. In the case of Security Service Functions, the
Service Policies can contain match criteria derived from all OSI
layers of the packet.SFC classification is often based on network data, including but
not limited to: Network interface port, VLAN, source and destination
IP addresses, source and destination TCP and UDP ports, IP protocol,
etc. These properties can be derived from the packet headers and are
consistent across every packet of a flow.There are match criteria that are desired by Security Service
Functions that are either not present in the first packet, or are
not present in every packet.Those criteria may comprise “application data” from
above the network layer, referred to as "application criteria". For
example, a policy rule may state:for all TLS traffic, run the traffic through Service Function
"TLS Proxy"Another example of an application layer policy rule is:for all HTTP traffic with content containing file types of
interest, run the traffic through Service Function "File Stream
Scanner"The Service Classifier for Security Service Functions needs to
handle complex Service Policy. In some cases, this can be achieved
by embedding the Service Classifier function into a Security Service
Function, such that it can evaluate the application data as it
becomes available.Network data is likely to be available on the first packet of the
flow. When only network data is used as Service Policy match
criteria, a stateful Service Classifier will be able to determine
the forward and reverse Service Function Paths from the first packet
(initial classification). The forward and reverse Service Function
Paths remain unchanged for the entire life of the flow for these
types of policies.When the Service Policy contains application criteria, the policy
rule may not be fully evaluated until several packets have passed
through the chain. For example, TLS traffic can be identified only
after the TLS Client Hello handshake message is observed.Multiple classifiers may be required to provide sufficient
classification granularity and complete a full evaluation of the
Service Policy. In many cases, classification will be co-located
with a Security Service Function that has the ability to inspect and
scan the application data.A new Service Function Path may be selected by a non-initial
classification, different from the one determined by the initial
classification.The selection of a new Service Function Path can be reflected in
the NSH Service Path Header as a new Service Path ID for the Service
Function Forwarder to direct the packet accordingly.The decision of a new Service Function Path often needs to be
stored in the Service Classifier to ensure that subsequent packets
of the flow follow the new path. This is because the data that
triggers a new Service Function Path may be available from one
particular packet only. For example, the packet with the TLS Client
Hello message is used to identify a TLS session. Subsequent packets
may not contain information for identifying the TLS sessions. All
subsequent packets, without being classified again, must travel
through the path with the “TLS Proxy” Service
Function.The Service Function that is new in the packet path (as part of
the new Service Function Path) has to be able to handle not seeing
earlier packets in the flow. Refer to Section 4.2 for more
discussions on Service Functions.Figure 2 illustrates a simple set of Security Functions deployed
at the Internet edge. The default Service Function Path is SFP-1,
with Service Functions "AVC" and "Firewall". When a TLS session is
detected (e.g. by detecting the TLS Client Hello in the AVC Service
Function), packets of the flow from that point on are switched to
SFP-2, which contains "TLS Proxy" between "AVC" and "Firewall" to
decrypt the TLS traffic for inspection.Table 1 lists the Service Function Path for each packet in an
HTTPS connection, from the TCP 3-way handshake to the HTTPS data
packets. A new Service Function Path is selected in the middle of
the connection after the TLS Client Hello is observed.Service Functions that are capable of selecting a new Service
Function Path must have the Service Classifier function integrated.
Such Service Functions are often responsible for classification
using their inspection and scanning results and updating Service
Function Paths based on the Service Policy.Next generation security devices are intelligent, and they work
by correlating the traffic. Based on the content of the traffic, a
Security Function may create blacklist/whitelist to deny/allow the
traffic. For example: In the case of Peer to Peer communication, the
enterprise firewall may allow users from outside of the enterprise
periphery to connect to the inside users on any port if the internal
user initiates the connection by creating a short-lived dynamic
rule.Service Classifier performing the classification may be unaware
of the traffic correlation capability of the security Service
Function. The inability of the Service classifier to identify
related traffic may result in following issues:Service Classifier may not send traffic from secondary
connection to the same firewall function which had seen the
primary connection. If the secondary connection doesn’t
pass through the same service function, then it may result in
traffic drop from the secondary connection.Service Classifier may not add security Service Function to
the service chain for secondary connection. As the secondary
traffic will not be seen by the application firewall function,
tertiary connection (connection created by secondary connection)
traffic may be dropped.Blacklisted traffic may pass through the network in case
classifier fails to add same security Service Function which
classified specific traffic as blacklisted. The inability of the
Service Classifier to identify related traffic can be addressed
by injecting the security Service Function correlation result as
a classification rule into the Service Classifier
dynamically.Certain Security Service Functions operate on L5 to L7 data. For
example, a "TLS Proxy" consumes a TCP stream without retransmitted
or overlapping TCP segments. A "Web Proxy" operates on TCP stream of
HTTP traffic. The data consumed by such Service Functions may not be
in the original packet frame format, and the data may not contain
the original L2-L4 header information. Such Service Functions can
obtain the session or flow information from the SFC metadata carried
in NSH.When a new Service Function Path is selected as a result of
Service Policy re-evaluation with application layer policy metadata,
a new Service Function may need to start handling packet frames in
the middle of a flow. This is referred to as "mid-stream pick-up".
Although this is mid-stream from a flow perspective, it is still a
complete data stream from the Service Function perspective (e.g.,
although "TLS Proxy" Service Function may not see the prior TCP
handshake packets, it still sees the entire TLS stream). Similarly,
transaction based Service Functions only handle packets belonging to
a particular transaction. Such Service Function may use the flow ID
metadata carried in NSH to link the session back to the flow.Table 2 lists the Service Functions visited by each packet from
an HTTPS connection. The first packet that the Service Function "TLS
Proxy" receives is the TLS Client Hello, as opposed to the TCP
handshake packets prior to it.Certain Security Service Functions can be compute-intensive while
only serving a particular task. It may be required to bypass such a
Service Function in the middle of a flow. For example:"Firewall" may request offloading of certain flows to fast
forwarding engine with minimal inspection"HTTP Inspector" may decide to not inspect video streams from
a site with a high reputation"TLS Proxy" may have to avoid decryption of banking traffic
for compliance reasonsThe decision to bypass a Service Function is made by the
Service Function with its static policy, the inspection results
and/or mid-stream evaluation of Service Policy.Even if a flow is offloaded or bypassed, the Security Service
Function may want to continue receiving critical packets for state
tracking purposes. For example, "Firewall" may want to receive TCP
control packets, and "HTTP Inspector" may want to track each
transaction in the same flow.A new Service Function Path may be selected to steer traffic to
the path with the bypassed Service Function removed. The Service
Function may update the NSH Service Path ID in the packet (in-band
signaling) if the Service Function has knowledge of the relevant
Service Function Paths. Alternatively, the Service Function may
signal the Service Classifier (out-of-band) to update the Service
Function Path for excluding the Service Function.Service Function bypass may also follow the procedure described
in "Service Function Simple Offloads" , where the Service Function
signals the Service Function Forwarder to offload a flow, without
selecting a new Service Function Path. The Service Function
Forwarder caches the offload request and bypasses the Service
Function in the service path for the remainder of the flow.Certain Service Functions such as an IDS may operate in
"receive-only" mode, i.e. they consume a packet instead of passing
the packet through. The Service Function Forwarder should send
copies of packets to receive-only Service Functions.Figure 4 illustrates an example of receive-only Service Function
and its insertion into a Service Function Chain. The IDS Service
Function receives copies of packets from the Service Function
Forwarder.Security Service Functions may inject new packets into an
existing flow in either direction. For example,"Web Proxy" inserts an HTTP page challenging the client to
login, in order to obtain the client's identity. This is in
response to a packet (likely HTTP Request) but in the opposite
direction of the flow.“Firewall” checks an idle TCP connection by
sending TCP keepalives to the client and/or server (known as
“TCP dead connection detection”). This is on
existing flows but not responding to a prior packet.“Firewall” sends ICMP error message after
dropping a packet. This is in response to the prior packet but
on a new flow.The Service Function or Service Classifier needs to conduct a
lookup of the reverse Service Function Path and populate the NSH
Service Path Header. The approaches described in may be adopted to support this use
case.A Service Function may need to create its own connections that
are not associated with any client connection. Use cases include
probing of servers behind a web proxy. In such cases, there will be
no existing metadata for the Service Function to use to establish
this connection. Such connections should be classified just like any
other connections traversing the Service Function Path, as there may
be Service Functions that are required to perform operations such an
NAT on such connections in order for it to reach its
destination.Option 1: Service Classifier in Service Function. A Service
Classifier-capable Service Function may conduct service
classification to determine the Service Function Path for the
Service Function initiated connection. It can add an NSH with the
proper Service Path Headers to the packets, and the Service Function
would be the first SF on the chain. Response traffic follows a
reverse Service Function Path and terminates at the Service
Function. The number of Service Path Identifiers increases with more
Service Functions bearing such capability.Option 2: Service Classifier external to Service Function. A
Service Function may send native packets without NSH when it is not
capable of service classification. Such traffic is handled by the
Service Classifier, which will populate the traffic with the
appropriate NSH.Security Service Functions may generate security classification
results (e.g. policy actions and inspection results) while
processing the packet data. Certain actions such as packet drop and
flow closure can be taken immediately.However, Service Functions can choose not to take any action
immediately. Instead, it may pass the classification results to the
subsequent Service Functions or to a control point.Security classification results may be carried in NSH metadata as
a score value. The score can be relayed and refined by other
Security Service Functions along the path. Figure 6 below depicts an
example of accumulating the client's score based on the Service
Function's classification result. The client's reputation score is 6
as reported by the Service Function "Reputation", and the score is
then passed to the next Service Function "Web Proxy" as the initial
score for the connection. "Web Proxy" reduces the score to 3 after
detecting access to a low reputation website. The Service Function
"File Scanner" is involved due to the low score so far. After the
"File Scanner" conducts scanning on the downloaded file and
identifies it to be a malware, it updates the score to be -5 which
is below the threshold for the connection to be blocked.Alternatively, each participating Service Function may send its
own classification result to a central Service Function or control
point for aggregation. Actions are then taken by a specific Service
Function or control point based on the accumulated results. Figure 7
illustrates this option.The above use cases lead to the following requirements for applying
SFC to security services on the data traffic.Requirements that may need working group drafts:SFC SHOULD allow packet frames carrying only L5 and upper layer
traffic data without L2-L4 headers.SFC SHOULD support bypass of a Service Function in the middle of
a connection while allowing necessary control packets to reach the
Service Function. Possible extension to SFC control plane and packet plane MUST support receive-only
Service Functions.SFC MUST support packet injection to the opposite direction of a
Service Function Path. Possible extension to SFC SHOULD allow metadata passing classification results.Requirements for implementation driven by respective use
cases:SFC MUST support the use of stateful Service Classifiers and
Service Functions if present.Service Classifiers MUST have the ability to classify forward and
the corresponding reverse Service Function Paths.Service Classifiers MUST be able to distinguish between traffic
initiator and responder.SFC MUST support the use of Service Policies with network and
application layer match criteria if supported by Service
Classifier.SFC MUST support Service Function Path update or selection of a
new path by a Service Classifier in the middle of a flow.This document describes use cases for Security Service Functions to
participate in SFC. There are cases such as picking up traffic from the
middle of a packet stream or handling packets without L2-L4 headers.
Security Service Functions must process those types of traffic properly
and associate them with the appropriate internal state.While each Security Service Function applies its own implementation
to secure the internal data, communications between Service Functions
need to be secured as well. Measures must be taken to ensure metadata
such as security classifications carried in NSH is not tampered.The authors would like to thank Paul Quinn, Reinaldo Penno and Jim
Guichard for their detailed review, comments and contributions.This document includes no request to IANA.