<?xml version="1.0" encoding="UTF-8"?>
<!--<?xml version="1.0" encoding="US-ASCII"?> -->
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com)
     by Daniel M Kohn (private)
-->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc toc="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>

<rfc category="std" ipr="trust200902" docName="draft-yang-i2nsf-security-policy-translation-14">

<front>
    <title abbrev="I2NSF Security Policy Translation">
        Guidelines for Security Policy Translation in Interface to Network Security Functions
    </title>

  <author role="editor" initials="J." surname="Jeong" fullname="Jaehoon Paul Jeong">	
        <organization abbrev="Sungkyunkwan University">
        Department of Computer Science and Engineering
        </organization>
        <address>
            <postal>
                <street>Sungkyunkwan University</street>
                <street>2066 Seobu-Ro, Jangan-Gu</street>
                <city>Suwon</city>
                <region>Gyeonggi-Do</region>
                <code>16419</code>
                <country>Republic of Korea</country>
            </postal>
            <phone>+82 31 299 4957</phone>
            <facsimile>+82 31 290 7996</facsimile>
            <email>pauljeong@skku.edu</email>
            <uri>http://iotlab.skku.edu/people-jaehoon-jeong.php</uri>
        </address>
    </author>

    <author initials="P." surname="Lingga" fullname="Patrick Lingga">
        <organization abbrev="Sungkyunkwan University">
        Department of Electronic, Electrical and Computer Engineering
        </organization>
        <address>
            <postal>
                <street>Sungkyunkwan University</street>
                <street>2066 Seobu-Ro, Jangan-Gu</street>
                <city>Suwon</city>
                <region>Gyeonggi-Do</region>
                <code>16419</code>
                <country>Republic of Korea</country>
            </postal>
            <phone>+82 31 299 4957</phone>
            <email>patricklink@skku.edu</email>
        </address>
    </author>

    <author initials="J." surname="Yang" fullname="Jinhyuk Yang">
        <organization abbrev="Sungkyunkwan University">
        Department of Electronic, Electrical and Computer Engineering
        </organization>
        <address>
            <postal>
                <street>Sungkyunkwan University</street>
                <street>2066 Seobu-Ro, Jangan-Gu</street>
                <city>Suwon</city>
                <region>Gyeonggi-Do</region>
                <code>16419</code>
                <country>Republic of Korea</country>
            </postal>
            <phone>+82 10 8520 8039</phone>
            <email>jin.hyuk@skku.edu</email>
        </address>
    </author>
	
    <author initials="J." surname="Kim" fullname="Jeonghyeon Kim">
        <organization abbrev="Sungkyunkwan University">
        Department of Computer Science and Engineering
        </organization>
        <address>
            <postal>
                <street>Sungkyunkwan University</street>
                <street>2066 Seobu-Ro, Jangan-Gu</street>
                <city>Suwon</city>
                <region>Gyeonggi-Do</region>
                <code>16419</code>
                <country>Republic of Korea</country>
            </postal>
            <phone>+82 31 299 4957</phone>
            <email>jeonghyeon12@skku.edu</email>
        </address>
    </author>
  
    <date month="March" day="28" year="2023" /> 
    <area>Security</area>
    <workgroup>I2NSF Working Group</workgroup>

<!-- [rfced] Please insert any keywords (beyond those that appear in
the title) for use on http://www.rfc-editor.org/rfcsearch.html. -->

    <keyword>Internet-Draft</keyword>       
    <abstract>
        <t>
          This document proposes the guidelines for security policy translation 
          in Interface to Network Security Functions (I2NSF) Framework. 
          When I2NSF User delivers a high-level security policy for a security
          service, Security Policy Translator in Security Controller
          translates it into a low-level security policy for Network Security 
          Functions (NSFs).
          For this security policy translation, this document specifies the relation
          between a high-level security policy based on the Consumer-Facing Interface 
          YANG data model and a low-level security policy based on the NSF-Facing 
          Interface YANG data model. Also, it describes an architecture of a security
          policy translator along with an NSF database, and the process of security
          policy translation with the NSF database.
        </t>
    </abstract>
</front>

<middle>
    <section anchor="section:Introduction" title="Introduction">
        <t>
            This document proposes the guidelines for security policy translation
            in Interface to Network Security Functions (I2NSF) Framework
            <xref target="RFC8329"/>. First of all, this document explains
            the necessity of a security policy translator (shortly called 
            policy translator) in the I2NSF framework.
        </t>
        <t> 
            The policy translator resides in Security Controller in the
            I2NSF framework and translates a high-level security policy 
            to a low-level security policy for Network Security Functions 
            (NSFs). A high-level policy is specified by I2NSF User in the 
            I2NSF framework and is delivered to Security Controller via 
            Consumer-Facing Interface <xref target="I-D.ietf-i2nsf-consumer-facing-interface-dm"/>. 
            It is translated into a low-level policy by Policy Translator 
            in Security Controller and is delivered to NSFs to execute the 
            rules corresponding to the low-level policy via NSF-Facing 
            Interface <xref target="I-D.ietf-i2nsf-nsf-facing-interface-dm"/>.
        </t>
    </section>

    <section anchor="section:Terminology" title="Terminology">
        <t>
            This document uses the terminology specified in <xref target="RFC8329"/>.
        </t>
    </section>

    <section anchor="section:Necessity-for-Translator" title="Necessity for Security Policy Translator">
        <t>
            Security Controller acts as a coordinator between I2NSF User 
            and NSFs. Also, Security Controller has capability information
            of NSFs that are registered via Registration Interface 
            <xref target="I-D.ietf-i2nsf-registration-interface-dm"/> by 
            Developer's Management System <xref target="RFC8329"/>. As a
            coordinator, Security Controller needs to generate a low-level 
            policy in the form of security rules intended by the high-level 
            policy, which can be understood by the corresponding NSFs.
        </t>
        <t>
            The high-level and low-level security policies are specified by YANG data model
            <xref target="RFC7950"/> with the delivery using either 
            NETCONF <xref target="RFC6241"/> or RESTCONF <xref target="RFC8040"/>.
            The translation from a high-level security policy to the 
            corresponding low-level security policy will be able to 
            rapidly elevate I2NSF in real-world deployment. A rule in a
            high-level policy can include a broad target object, such as 
            employees in a company for a security service (e.g., firewall 
            and web filter). Such employees may be from human resource 
            (HR) department, software engineering department, and 
            advertisement department. A keyword of employee needs to be
            mapped to these employees from various departments. This 
            mapping needs to be handled by a security policy translator 
            in a flexible way while understanding the intention of a 
            policy specification. Let us consider the following two policies:
        </t>

        <t>
            <list style="symbols">
                <t> Block my son&apos;s computers from malicious websites. </t>
                <t> Drop packets from the IP address 192.0.2.0/24 to malicious1 and malicious2.</t>
            </list>
            The above two sentences are examples of policies for blocking 
            malicious websites. Both policies are for the same operation. 
            However, NSF cannot understand the first policy, because the
            policy does not have any specified information for NSF. To set
            up the policy at an NSF, the NSF MUST receive at least the 
            source IP address and website address for an operation. It 
            means that the first sentence is NOT compatible for an NSF 
            policy.
            Conversely, when I2NSF Users request a security policy to 
            the system, they never make a security policy like the 
            second example. For generating a security policy like the
            second sentence, the user MUST know that the NSF needs to 
            receive the specified information, source IP address and 
            website address. It means that the user understands the NSF
            professionally, but there are not many professional users in 
            a small size of company or at a residential area.
            In conclusion, the I2NSF User prefers to issue a security 
            policy in the first sentence, but an NSF will require the 
            same policy as the second sentence with specific information.
            Therefore, an advanced translation scheme of security policy
            is REQUIRED in I2NSF.
        </t>
        <t>
            This document proposes an approach using Automata theory
            <xref target="Automata" /> for the policy translation, 
            such as Deterministic Finite Automaton
            (DFA). Note that Automata theory is the foundation of programming
            language and compiler. Thus, with this approach, I2NSF User can
            easily specify a high-level security policy that will be enforced
            into the corresponding NSFs with a compatibly low-level security
            policy with the help of Security Policy Translator. Also, for easy
            management, a modularized translator structure is proposed.
        </t>
    </section>
    
    <section anchor="section:CFI-NFI-Relation" title="Relation between Consumer-Facing Interface and NSF-Facing Interface YANG Data Models">
      <t>
        The Consumer-Facing Interface (CFI) YANG data model <xref target="I-D.ietf-i2nsf-consumer-facing-interface-dm"/>
        and NSF-Facing Interface (NFI) YANG data model <xref target="I-D.ietf-i2nsf-nsf-facing-interface-dm"/>
        are two data models designed with different objectives in mind.
        The CFI is designed to be used by someone with little knowledge
        of network security can configure the NSFs by specifying
        the required information, their data types, and encoding schemes as
        a high-level policy.
        The NFI is designed to provide detailed security policy configuration
        for the NSFs as a low-level policy that can be used by the NSFs to 
        deploy security services.
        But even with the distinct objectives for the data models, the attributes
        between the two data models are constructed to have a relation
        for the purpose of automation.
        Thus, this section provides the information of the relationship
        between the attributes in the CFI and NFI YANG data model.
      </t>
      
      <section anchor="section:Top-Level" title="The CFI and NFI Top-Level YANG Trees Comparison">
        <figure anchor="figure:top-level" title="The CFI and NFI Top-Level YANG Trees">
          <artwork><![CDATA[
Consumer-Facing Interface (CFI):
module: ietf-i2nsf-cfi-policy
  +--rw i2nsf-cfi-policy* [name]
     +--rw name                   string
     +--rw language?              string
     +--rw resolution-strategy?   identityref
     +--rw rules* [name]
     |  ...
     +--rw endpoint-groups
     |  ...
     +--rw threat-prevention
        ...

NSF-Facing Interface (NFI):
module: ietf-i2nsf-policy-rule-for-nsf
  +--rw i2nsf-security-policy* [name]
     +--rw name                   string
     +--rw language?              string
     +--rw priority-usage?        identityref
     +--rw resolution-strategy?   identityref
     +--rw default-action?        identityref
     +--rw rules* [name]
     |  ...
     +--rw rule-group
        ...
          ]]></artwork>
        </figure>
        <t>
          <xref target="figure:top-level"/> shows the top-level of the CFI and NFI
          YANG Trees. The CFI and NFI top-level provides the basic security
          policy information such as name of a policy, language tag, and 
          resolution-strategy. Both data models also provide list of rules
          to be executed to perform the network security services.
        </t>
        
        <t>
          The differences of the top-level data models are default action 
          and priority usage are not provided in CFI YANG data model. This 
          is because the philosophy of CFI, i.e., To make CFI as simple as
          possible for the user. But this attributes can be given by the
          Security Controller with a default value in the translation 
          process. Another important distinct point is CFI YANG data model 
          also provides endpoint groups and threat prevention to
          register high-level information (e.g., mapping a user to an IP 
          address) to the database for high-level configuration that can
          be used to translate the high-level policy into the low-level
          policy.
        </t>
      </section>

      <section anchor="section:Rule-Level" title="The CFI and NFI Rule-Level YANG Trees Comparison">
        <figure anchor="figure:rule-level" title="The CFI and NFI Rule-Level YANG Trees">
          <artwork><![CDATA[
Consumer-Facing Interface (CFI):
 +--rw rules* [name]
     |  +--rw name         string
     |  +--rw priority?    uint8
     |  +--rw event
     |  |  ...
     |  +--rw condition
     |  |  ...
     |  +--rw action
     |     ...

NSF-Facing Interface (NFI):
 +--rw rules* [name]
     |  +--rw name               string
     |  +--rw description?       string
     |  +--rw priority?          uint8
     |  +--rw enable?            boolean
     |  +--rw long-connection
     |  |  +--rw enable?     boolean
     |  |  +--rw duration?   uint32
     |  +--rw event
     |  |  ...
     |  +--rw condition
     |  |  ...
     |  +--rw action
     |     ...

          ]]></artwork>
        </figure>
        <t>
          <xref target="figure:rule-level"/> shows the rule-level YANG trees of the CFI and NFI
          YANG Trees. Similarly to the top-level YANG data model, the long-connection
          is not provided in the CFI YANG data model to simplify the 
          data model for the user configuration. This value can also be
          added using a default value in the Security Controller for the 
          low-level security policy.
        </t> 
        <t>
          In term of similarity, the CFI and NFI YANG data model provides 
          the basic rule information
          such as the unique name the priority value for the rules. Both 
          data models utilize the Event-Condition-Action (ECA) policy rule
          described in Section 3.1 of the <xref target="I-D.ietf-i2nsf-capability-data-model"/>.
        </t>
        <section anchor="section:Event-Data-Models" title="The CFI and NFI Event YANG Data Models Comparison">
          <figure anchor="figure:event-tree" title="The CFI and NFI Event YANG Trees">
            <artwork><![CDATA[
  Consumer-Facing Interface (CFI):
  |  +--rw event
  |  |  +--rw system-event*   identityref
  |  |  +--rw system-alarm*   identityref

  NSF-Facing Interface (NFI):
  |  +--rw event
  |  |  +--rw description?     string
  |  |  +--rw system-event*   identityref
  |  |  +--rw system-alarm*   identityref
            ]]></artwork>
          </figure>
          <t>
            As shown in <xref target="figure:event-tree"/>, CFI and NFI YANG data models 
            have the almost same structures for Event except for description in NFI. 
            The description is optional because it contains human-readable
            text for the description of an event.
          </t>
        </section>
        <section anchor="section:Condition-Data-Models" title="The CFI and NFI Condition YANG Data Models Comparison">
          <figure anchor="figure:condition-tree" title="The CFI and NFI Condition YANG Trees">
            <artwork><![CDATA[
Consumer-Facing Interface (CFI):
|  +--rw condition
|  |  +--rw firewall
|  |  |  +--rw source*                     union
|  |  |  +--rw destination*                union
|  |  |  +--rw transport-layer-protocol?   identityref
|  |  |  +--rw range-port-number
|  |  |  |  +--rw start-port-number?   inet:port-number
|  |  |  |  +--rw end-port-number?     inet:port-number
|  |  |  +--rw icmp
|  |  |     +--rw message*   identityref
|  |  +--rw ddos
|  |  |  +--rw rate-limit
|  |  |     +--rw packet-rate-threshold?   uint64
|  |  |     +--rw byte-rate-threshold?     uint64
|  |  |     +--rw flow-rate-threshold?     uint64
|  |  +--rw anti-virus
|  |  |  +--rw profile*   string
|  |  |  +--rw exception-files*   string
|  |  +--rw payload
|  |  |  +--rw content*  -> /threat-prevention/payload-content/name
|  |  +--rw url-category
|  |  |  +--rw url-name?  -> /endpoint-groups/url-group/name
|  |  +--rw voice
|  |  |  +--rw source-id*        string
|  |  |  +--rw destination-id*   string
|  |  |  +--rw user-agent*       string
|  |  +--rw context
|  |  |  +--rw time
|  |  |  |  +--rw start-date-time?   yang:date-and-time
|  |  |  |  +--rw end-date-time?     yang:date-and-time
|  |  |  |  +--rw period
|  |  |  |  |  +--rw start-time?   time
|  |  |  |  |  +--rw end-time?     time
|  |  |  |  |  +--rw day*          day
|  |  |  |  |  +--rw date*         int32
|  |  |  |  |  +--rw month*        string
|  |  |  |  +--rw frequency?         enumeration
|  |  |  +--rw application
|  |  |  |  +--rw protocol*      identityref
|  |  |  +--rw device-type
|  |  |  |  +--rw device*        identityref
|  |  |  +--rw users
|  |  |  |  +--rw user* [id]
|  |  |  |  |  +--rw id      uint32
|  |  |  |  |  +--rw name?   string
|  |  |  |  +--rw group* [id]
|  |  |  |     +--rw id      uint32
|  |  |  |     +--rw name?   string
|  |  +--rw geographic-location
|  |     +--rw source
|  |     |  +--rw country? -> /endpoint-groups/location-group/country
|  |     |  +--rw region?  -> /endpoint-groups/location-group/region
|  |     |  +--rw city?    -> /endpoint-groups/location-group/city
|  |     +--rw destination
|  |        +--rw country? -> /endpoint-groups/location-group/country
|  |        +--rw region?  -> /endpoint-groups/location-group/region
|  |        +--rw city?    -> /endpoint-groups/location-group/city
|  |  +--rw threat-feed
|  |     +--rw name*   -> /threat-prevention/threat-feed-list/name

NSF-Facing Interface:
     |  +--rw condition
     |  |  +--rw description?    string
     |  |  +--rw layer-2* [destination-mac-address source-mac-address 
                           ethertype]
     |  |  |  +--rw description?                    string
     |  |  |  +--rw destination-mac-address         yang:mac-address
     |  |  |  +--rw destination-mac-address-mask?   yang:mac-address
     |  |  |  +--rw source-mac-address              yang:mac-address
     |  |  |  +--rw source-mac-address-mask?        yang:mac-address
     |  |  |  +--rw ethertype                       eth:ethertype
     |  |  +--rw (layer-3)?
     |  |  |  +--:(ipv4)
     |  |  |  |  +--rw ipv4
     |  |  |  |     +--rw description?                      string
     |  |  |  |     +--rw dscp?                             inet:dscp
     |  |  |  |     +--rw ecn?                              uint8
     |  |  |  |     +--rw length?                           uint16
     |  |  |  |     +--rw ttl?                              uint8
     |  |  |  |     +--rw protocol?                         uint8
     |  |  |  |     +--rw ihl?                              uint8
     |  |  |  |     +--rw flags?                            bits
     |  |  |  |     +--rw offset?                           uint16
     |  |  |  |     +--rw identification?                   uint16
     |  |  |  |     +--rw (destination-network)?
     |  |  |  |     |  +--:(destination-ipv4-network)
     |  |  |  |     |  |  +--rw destination-ipv4-network?   
                                                     inet:ipv4-prefix
     |  |  |  |     |  +--:(destination-ipv4-range)
     |  |  |  |     |     +--rw destination-ipv4-range* [start end]
     |  |  |  |     |        +--rw start    inet:ipv4-address-no-zone
     |  |  |  |     |        +--rw end      inet:ipv4-address-no-zone
     |  |  |  |     +--rw (source-network)?
     |  |  |  |        +--:(source-ipv4-network)
     |  |  |  |        |  +--rw source-ipv4-network? inet:ipv4-prefix
     |  |  |  |        +--:(source-ipv4-range)
     |  |  |  |           +--rw source-ipv4-range* [start end]
     |  |  |  |              +--rw start    inet:ipv4-address-no-zone
     |  |  |  |              +--rw end      inet:ipv4-address-no-zone
     |  |  |  +--:(ipv6)
     |  |  |     +--rw ipv6
     |  |  |        +--rw description?                      string
     |  |  |        +--rw dscp?                             inet:dscp
     |  |  |        +--rw ecn?                              uint8
     |  |  |        +--rw length?                           uint16
     |  |  |        +--rw ttl?                              uint8
     |  |  |        +--rw protocol?                         uint8
     |  |  |        +--rw (destination-network)?
     |  |  |        |  +--:(destination-ipv6-network)
     |  |  |        |  |  +--rw destination-ipv6-network?   
                                                     inet:ipv6-prefix
     |  |  |        |  +--:(destination-ipv6-range)
     |  |  |        |     +--rw destination-ipv6-range* [start end]
     |  |  |        |        +--rw start    inet:ipv6-address-no-zone
     |  |  |        |        +--rw end      inet:ipv6-address-no-zone
     |  |  |        +--rw (source-network)?
     |  |  |        |  +--:(source-ipv6-network)
     |  |  |        |  |  +--rw source-ipv6-network? inet:ipv6-prefix
     |  |  |        |  +--:(source-ipv6-range)
     |  |  |        |     +--rw source-ipv6-range* [start end]
     |  |  |        |        +--rw start    inet:ipv6-address-no-zone
     |  |  |        |        +--rw end      inet:ipv6-address-no-zone
     |  |  |        +--rw flow-label?      inet:ipv6-flow-label
     |  |  +--rw (layer-4)?
     |  |  |  +--:(tcp)
     |  |  |  |  +--rw tcp
     |  |  |  |     +--rw description?               string
     |  |  |  |     +--rw source-port-number
     |  |  |  |     |  +--rw (source-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw destination-port-number
     |  |  |  |     |  +--rw (destination-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw sequence-number?           uint32
     |  |  |  |     +--rw acknowledgement-number?    uint32
     |  |  |  |     +--rw data-offset?               uint8
     |  |  |  |     +--rw reserved?                  uint8
     |  |  |  |     +--rw flags?                     bits
     |  |  |  |     +--rw window-size?               uint16
     |  |  |  |     +--rw urgent-pointer?            uint16
     |  |  |  |     +--rw options?                   binary
     |  |  |  +--:(udp)
     |  |  |  |  +--rw udp
     |  |  |  |     +--rw description?               string
     |  |  |  |     +--rw source-port-number
     |  |  |  |     |  +--rw (source-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw destination-port-number
     |  |  |  |     |  +--rw (destination-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw length?                    uint16
     |  |  |  +--:(sctp)
     |  |  |  |  +--rw sctp
     |  |  |  |     +--rw description?               string
     |  |  |  |     +--rw source-port-number
     |  |  |  |     |  +--rw (source-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw destination-port-number
     |  |  |  |     |  +--rw (destination-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw chunk-type*                uint8
     |  |  |  |     +--rw chunk-length?              uint16
     |  |  |  +--:(dccp)
     |  |  |  |  +--rw dccp
     |  |  |  |     +--rw description?               string
     |  |  |  |     +--rw source-port-number
     |  |  |  |     |  +--rw (source-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw destination-port-number
     |  |  |  |     |  +--rw (destination-port)?
     |  |  |  |     |     +--:(range-or-operator)
     |  |  |  |     |     |  +--rw (port-range-or-operator)?
     |  |  |  |     |     |     +--:(range)
     |  |  |  |     |     |     |  +--rw lower-port  inet:port-number
     |  |  |  |     |     |     |  +--rw upper-port  inet:port-number
     |  |  |  |     |     |     +--:(operator)
     |  |  |  |     |     |        +--rw operator?     operator
     |  |  |  |     |     |        +--rw port        inet:port-number
     |  |  |  |     |     +--:(port-list)
     |  |  |  |     |        +--rw port-numbers* [start end]
     |  |  |  |     |           +--rw start    inet:port-number
     |  |  |  |     |           +--rw end      inet:port-number
     |  |  |  |     +--rw service-code*              uint32
     |  |  |  |     +--rw type*                      uint8
     |  |  |  |     +--rw data-offset?               uint8
     |  |  |  +--:(icmp)
     |  |  |     +--rw icmp
     |  |  |        +--rw description?      string
     |  |  |        +--rw version?          enumeration
     |  |  |        +--rw type?             uint8
     |  |  |        +--rw code?             uint8
     |  |  |        +--rw rest-of-header?   binary
     |  |  +--rw url-category
     |  |  |  +--rw description?    string
     |  |  |  +--rw pre-defined*    string
     |  |  |  +--rw user-defined*   string
     |  |  +--rw voice
     |  |  |  +--rw description?            string
     |  |  |  +--rw source-voice-id*        string
     |  |  |  +--rw destination-voice-id*   string
     |  |  |  +--rw user-agent*             string
     |  |  +--rw ddos
     |  |  |  +--rw description?         string
     |  |  |  +--rw alert-packet-rate?   uint32
     |  |  |  +--rw alert-flow-rate?     uint32
     |  |  |  +--rw alert-byte-rate?     uint32
     |  |  +--rw anti-virus
     |  |  |  +--rw profile*           string
     |  |  |  +--rw exception-files*   string
     |  |  +--rw payload
     |  |  |  +--rw description?   string
     |  |  |  +--rw content*       binary
     |  |  +--rw context
     |  |     +--rw description?           string
     |  |     +--rw time
     |  |     |  +--rw start-date-time?   yang:date-and-time
     |  |     |  +--rw end-date-time?     yang:date-and-time
     |  |     |  +--rw period
     |  |     |  |  +--rw start-time?   time
     |  |     |  |  +--rw end-time?     time
     |  |     |  |  +--rw day*          day
     |  |     |  |  +--rw date*         int8
     |  |     |  |  +--rw month*        string
     |  |     |  +--rw frequency?         enumeration
     |  |     +--rw application
     |  |     |  +--rw description?   string
     |  |     |  +--rw protocol*      identityref
     |  |     +--rw device-type
     |  |     |  +--rw description?   string
     |  |     |  +--rw device*        identityref
     |  |     +--rw users
     |  |     |  +--rw description?   string
     |  |     |  +--rw user* [id]
     |  |     |  |  +--rw id      uint32
     |  |     |  |  +--rw name?   string
     |  |     |  +--rw group* [id]
     |  |     |     +--rw id      uint32
     |  |     |     +--rw name?   string
     |  |     +--rw geographic-location
     |  |        +--rw description?   string
     |  |        +--rw source*        string
     |  |        +--rw destination*   string
            ]]></artwork>
          </figure>
          <t>
            <xref target="figure:condition-tree"/> shows CFI and NFI Condition 
            YANG Trees. It shows a different way to manipulate the 
            Access Control Lists (ACLs) for the CFI and NFI YANG data models.
            The CFI aims at an easy security
            policy configuration, thus only provides a simple and most often
            needed fields in ACls, i.e., source and destination address (IPv4 or IPv6),
            type of transport protocol, source and destination port numbers,
            type of application protocol, and ICMP type and code.
            While, the NFI imports from <xref target="RFC8519"/> to provide 
            a detailed configuration of packet header. 
          </t>
          
          <t>
            Additionally, both data models provide configuration for advanced
            network security functions such as DDoS, Antivirus, Payload (DPI), 
            URL Filtering, and Voice Filtering conditions. The difference 
            is that in CFI some of the information (name, value) for 
            configuration is saved into a database in Security Controller
            for easy configuration. The configuration can be done by using
            the key name that holds the corresponding value.
          </t>
          
          <t>
            The YANG data models also has context condition that can be 
            one to one mapped, such as time condition to define the active
            period of a rule or geographic location condition to filter 
            traffic from/to a certain region that can be mapped into the 
            source and destination IP (IPv4 or IPv6) addresses based on 
            the database provided.
          </t>
        </section>
        <section anchor="section:Action-Data-Models" title="The CFI and NFI Action YANG Data Models Comparison">
          <figure anchor="figure:action-tree" title="The CFI and NFI Action YANG Trees">
            <artwork><![CDATA[
  Consumer-Facing Interface (CFI):
      +--rw action
      |  +--rw primary-action
      |  |  +--rw action?   identityref
      |  +--rw secondary-action
      |     +--rw log-action?   identityref
       
  NSF-Facing Interface (NFI):
   |  +--rw action
   |     +--rw description?       string
   |     +--rw packet-action
   |     |  +--rw ingress-action?   identityref
   |     |  +--rw egress-action?    identityref
   |     |  +--rw log-action?       identityref
   |     +--rw flow-action
   |     |  +--rw ingress-action?   identityref
   |     |  +--rw egress-action?    identityref
   |     |  +--rw log-action?       identityref
   |     +--rw advanced-action
   |        +--rw content-security-control*    identityref
   |        +--rw attack-mitigation-control*   identityref
            ]]></artwork>
          </figure>
          <t>
            <xref target="figure:condition-tree"/> shows CFI and NFI Action
            YANG Trees. The action in CFI YANG data model is separated 
            into primary-action and secondary-action. Primary action is the
            Ingress and Egress action (i.e., pass, drop, reject, 
            rate-limit, mirror, invoke-signaling, tunnel-encapsulation, 
            forwarding, and transformation) in the NFI YANG data model.
            The secondary-action is the log-action to log the rule that has
            been triggered by a packet/flow or log the packet/flow that 
            triggered the rule. The NFI also can specify the action as 
            packet or flow action depending on the capability of the NSF.
          </t>
          
          <t>
            In NFI YANG data model, the advanced action is used to 
            activate the Service Function Chaining (SFC) to apply multiple 
            NSFs on network traffics. This does not exist in CFI as the 
            CFI is used to provide a high-level action. The action of a 
            certain policy in CFI may require multiple NSFs (e.g., a URL 
            filtering with firewall) as a single NSF may not have the 
            capability to handle the security policy. Thus, the SFC of
            those NSFs is handled by NFI.
          </t>
        </section>  
      </section>
    </section>
    
  <section anchor="section:Design-for-Translator" title="Design of Security Policy Translator">
        <t>
            Commonly used security policies are created as XML (Extensible Markup Language) <xref target="XML" /> files. A popular way to change the format of an XML file is to use an XSLT (Extensible Stylesheet Language Transformation) <xref target="XSLT" /> document. XSLT is an XML-based language to transform an input XML file into another output XML file. However, the use of XSLT makes it difficult to manage the security policy translator and to handle the registration of new capabilities of NSFs. With the necessity for a security policy translator, this document describes a security policy translator based on Automata theory.
        </t>

        <section anchor="section:Structure-of-Translator" title="Overall Structure of Security Policy Translator">
            <figure anchor="figure:Overall-Translator-Structure" title="The Overall Design of Security Policy Translator">
                <artwork><![CDATA[
   +--------------------------------------------------+
   |                    I2NSF User                    |
   +------------------------+-------------------------+
                            | Consumer-Facing Interface
                            |
                High-level Security Policy
                            |
   Security Controller      V
   +------------------------+--------------------------------+
   |  Security Policy       |                                |
   |  Translator            V                                |
   |  +---------------------+-----------------------------+  |
   |  |                     |                             |  |
   |  |                     V                             |  |
   |  |               +-----+-----+          +----------+ |  |
   |  |               |    Data   |          |Data Model| |  |
   |  |               | Extractor |          |  Mapper  | |  |
   |  |               +-----+-----+          +-----+----+ |  |
   |  | Extracted Data from |              Mapping |      |  |
   |  |   High-Level Policy V                Model V      |  |
   |  |               +-----+-----+           +----+---+  |  |
   |  |               |    Data   |<--------->| NSF DB |  |  |
   |  |               | Converter |           +--------+  |  |
   |  |               +-----+-----+                       |  |
   |  |                     |  Required Data for          |  |
   |  |                     V  Target NSFs                |  |
   |  |            +--------+---------+                   |  |
   |  |            | Policy Generator |                   |  |
   |  |            +--------+---------+                   |  |
   |  |                     |                             |  |
   |  |                     V                             |  |
   |  +---------------------+-----------------------------+  |
   |                        |                                |
   |                        V                                |
   +------------------------+--------------------------------+
                            | NSF-Facing Interface
                            |
                 Low-level Security Policy
                            |
                            V
   +------------------------+-------------------------+
   |                      NSF(s)                      |
   +--------------------------------------------------+
                ]]></artwork>
            </figure>
	        <t>
                <xref target="figure:Overall-Translator-Structure" /> shows
                the overall design for Security Policy Translator in Security
                Controller. There are four main components for Security Policy
                Translator: Data Extractor, Data Converter, Policy Generator,
                and Data Model Mapper.
            </t>
            <t>
                Data Model Mapper creates a mapping model for mapping the
                elements between Consumer-Facing Interface and NSF-Facing Interface.
                Data Extractor is a DFA-based module for extracting data from
                a high-level policy which I2NSF User delivered via Consumer-Facing Interface.
                Data Converter converts the extracted data to the capabilities
                of target NSFs for a low-level policy. 
                It refers to an NSF Database (DB) in order to convert an
                abstract subject or object into the corresponding concrete
                subject or object (e.g., IP address and website URL). 
                Policy Generator generates a low-level policy which will
                execute the NSF capabilities from Converter. 
            </t>
            
	    </section>

        <section anchor="section:Data-Extractor" title="DFA-based Data Extractor">
            <section anchor="section:Design-for-Extractor" title="Design of DFA-based Data Extractor">
	            <figure anchor="figure:DFA-Extractor" title="DFA Architecture of Data Extractor">
                    <artwork><![CDATA[
                          +----------+
                          | accepter |
                          +----------+
                               | ^
                        <tag 1>| |</tag 1>
                               v |
     +------------------------------------------------------+
     |                      middle 1                        |
     +------------------------------------------------------+
         | ^                 | ^                      | ^
  <tag 2>| |</tag 2>  <tag 3>| |</tag 3>  ...  <tag n>| |</tag n>
         v |                 v |                      v |
  
         ...                 ...                      ...
  
   +-------------+      +-------------+          +-------------+
   | extractor 1 |      | extractor 2 |   ...    | extractor m |
   +-------------+      +-------------+          +-------------+
        data:1               data:2                   data:m
                    ]]></artwork>
                </figure>

                <t>
                    <xref target="figure:DFA-Extractor" /> shows a design for Data Extractor in the security policy translator. If a high-level policy contains data along the hierarchical structure of the standard Consumer-Facing Interface YANG data model <xref target="I-D.ietf-i2nsf-consumer-facing-interface-dm" />, data can be easily extracted using the state transition machine, such as DFA. The extracted data can be processed and used by an NSF to understand it. Extractor can be constructed by designing a DFA with the same hierarchical structure as a YANG data model.
                </t>
                <t>
                    After constructing a DFA, Data Extractor can extract all of data in the entered high-level policy by using state transitions.
                    Also, the DFA can easily detect the grammar errors of the high-level policy. The extracting algorithm of Data Extractor is as follows:
                    <list style="numbers">
                        <t> Start from the 'accepter' state. </t>
                        <t> Read the next tag from the high-level policy. </t>
                        <t> Transit to the corresponding state. </t>
                        <t> If the current state is in 'extractor', extract the corresponding data, and then go back to step 2. </t>
                        <t> If the current state is in 'middle', go back to step 2. </t>
                        <t> If there is no possible transition and arrived at &apos;accepter&apos; state, the policy has no grammar error. Otherwise, there is a grammar error, so stop the process with failure. </t>
                    </list>
                </t>
            </section>

            <section anchor="section:Example-Scenario-for-Extractor" title="Example Scenario for Data Extractor">
                <figure anchor="figure:High-level-Example" title="The Example of High-level Policy">
                    <artwork><![CDATA[
  <i2nsf-cfi-policy
    xmlns="urn:ietf:params:xml:ns:yang:ietf-i2nsf-cfi-policy">
    <name>block_web_security_policy</name>
    <rules>
      <name>block_web</name>
      <condition>
        <firewall-condition>
          <source>Son's_PC</source>
        <firewall-condition>
        <url-condition>
          <url-name>malicious_websites</url-name>
        </url-condition>
      </condition>
      <actions>
        <primary-action>
          <action>drop</action>
        </primary-action>
      </actions>
    </rules>
  </i2nsf-cfi-policy>
                ]]></artwork>
                </figure>

                <figure anchor="figure:DFA-Extractor-Example" title="The Example of Data Extractor">
                    <artwork><![CDATA[
                        +----------+
                        | accepter |
                        +----------+
                             | ^
           <i2nsf-cfi-policy>| |</i2nsf-cfi-policy>
                             v |
    +------------------------------------------------------+
    |                      middle 1                        |
    +------------------------------------------------------+
       | ^                               | ^
 <name>| |</name>                        | |
       v |                               | |
 +-------------+                 <rules> | | </rules>
 | extractor 1 |                         | |
 +-------------+                         | |
 block_web_security                      | |
 _policy                                 v |
    +------------------------------------------------------+
    |                  middle 2                            |
    +------------------------------------------------------+
       | ^                   | ^                       | ^
 <name>| |</name> <condition>| | <condition>  <actions>| |</actions>
       v |                   v |                       v |
 +-------------+  +--------------------------+   +-------------+
 | extractor 2 |  |       middle 3           |   |   middle 6  |
 +-------------+  +--------------------------+   +-------------+
    block_web       | ^                  | ^            | ^
                    | |       <url-      | |</url-      | |
                    | |        condition>| | conition>  | |
                    | |                  | |            | |
         <firewall- | |</firewall-       | |   <primary-| |</primary
          condition>| | condition>       | |     action>| | action>
                    v |                  v |            v |
              +-------------+   +-------------+   +-------------+
              |   middle 4  |   |   middle 5  |   |   middle 7  |
              +-------------+   +-------------+   +-------------+
                 | ^                  | ^                | ^     
         <source>| |</source>   <url- | |</url-  <action>| |</action>
                 | |             name>| | name>          | |
                 v |                  v |                v |
              +-------------+   +-------------+    +-------------+
              | extractor 3 |   | extractor 4 |    | extractor 5 |
              +-------------+   +-------------+    +-------------+
                 Son's_PC      malicious_websites        drop

                     ]]></artwork>
                </figure>

                <t>
                    To explain the Data Extractor process by referring to an example scenario, assume that Security Controller received a high-level policy for a web-filtering as shown in <xref target="figure:High-level-Example" />.
                    Then we can construct a DFA-based Data Extractor by using the design as shown in <xref target="figure:DFA-Extractor" />. <xref target="figure:DFA-Extractor-Example" /> shows the architecture of Data Extractor that is based on the architecture in <xref target="figure:DFA-Extractor" /> along with the input high-level policy in <xref target="figure:High-level-Example" />. Data Extractor can automatically extract all of data in the high-level policy according to the following process:

                    <list style="numbers">
                      <t> Start from the &apos;accepter&apos; state. </t>
                      <t> Read the first opening tag called '&lt;i2nsf-cfi-policy&gt;', and transit to the 'middle 1' state. </t>
                      <t> Read the second opening tag called '&lt;name&gt;', and transit to the 'extractor 1' state. </t>
                      <t> The current state is an &apos;extractor&apos; state. Extract the data of 'name' field called 'block_web_security_policy'. </t>
                      <t> Read the second closing tag called '&lt;/name&gt;', and go back to the 'middle 1' state. </t>
                      <t> Read the third opening tag called '&lt;rules&gt;', and transit to the 'middle 2' state. </t>
                      <t> Read the fourth opening tag called '&lt;name&gt;', and transit to the 'extractor 2' state. </t>
                      <t> The current state is an 'extractor' state. Extract the data of 'name' field called 'block_web'. </t>
                      <t> Read the fourth closing tag called '&lt;/name&gt;', and go back to the 'middle 2' state. </t>
                      <t> Read the fifth opening tag called '&lt;condition&gt;', and transit to the 'middle 3' state. </t>
                      <t> Read the sixth opening tag called '&lt;firewall-condition&gt;', and transit to the 'middle 4' state. </t>
                      <t> Read the seventh opening tag called '&lt;source&gt;', and transit to the 'extractor 3' state. </t>
                      <t> The current state is an 'extractor' state. Extract the data of 'source' field called 'Son&apos;s_PC'. </t>
                      <t> Read the seventh closing tag called '&lt;/source&gt;', and go back to the 'middle 4' state. </t>
                      <t> Read the sixth closing tag called '&lt;/firewall-condition&gt;', and go back to the 'middle 3' state. </t>
                      <t> Read the eight opening tag called '&lt;url-condition&gt;', and transit to the 'middle 5' state. </t>
                      <t> Read the ninth opening tag called '&lt;url-name&gt;', and transit to the 'extractor 4' state. </t>
                      <t> The current state is an 'extractor' state. Extract the data of 'url-name' field called 'malicious_websites'. </t>
                      <t> Read the ninth closing tag called '&lt;/url-name&gt;', and go back to the 'middle 5' state. </t>
                      <t> Read the eight closing tag called '&lt;/url-condition&gt;', and go back to the 'middle 3' state. </t>
                      <t> Read the fifth closing tag called '&lt;/condition&gt;', and go back to the 'middle 2' state. </t>
                      <t> Read the tenth opening tag called '&lt;actions&gt;', and transit to the 'middle 6' state. </t>
                      <t> Read the eleventh opening tag called '&lt;primary-action&gt;', and transit to the 'middle 7' state. </t>
                      <t> Read the twelfth opening tag called '&lt;action&gt;', and transit to the 'extractor 5' state. </t>
                      <t> The current state is an 'extractor' state. Extract the data of 'action' field called 'drop'. </t>
                      <t> Read the twelfth closing tag called '&lt;/action&gt;', and go back to the 'middle 7' state. </t>
                      <t> Read the eleventh closing tag called '&lt;/primary-action&gt;', and go back to the 'middle 6' state. </t>
                      <t> Read the tenth closing tag called '&lt;/actions&gt;', and go back to the 'middle 2' state. </t>
                      <t> Read the third closing tag called '&lt;/rules&gt;', and go back to the 'middle 2' state. </t>
                      <t> Read the first closing tag called '&lt;/i2nsf-cfi-policy&gt;', and go back to the 'accepter' state. </t>
                      <t> There is no further possible transition, and the state is finally on 'accepter' state. There is no grammar error in <xref target="figure:High-level-Example"/> so the scanning for data extraction is finished. </t>
                    </list>
                        
                    The above process is constructed by an extracting algorithm. 
                    After finishing all the steps of the above process, Data 
                    Extractor can extract all of data in <xref target="figure:High-level-Example" />,
                    'block_web_security_policy', 'block_malicious', 'Son&apos;s_PC', 'malicious_websites', and 'drop'.
                </t>
                <t>
                    Since the translator is modularized into a DFA structure, a visual understanding is feasible. Also, the performance of Data Extractor is excellent compared to one-to-one searching of data for a particular field. In addition, the management is efficient because the DFA completely follows the hierarchy of Consumer-Facing Interface. If I2NSF User wants to modify the data model of a high-level policy, it only needs to change the connection of the relevant DFA node.
                </t>
            </section>
        </section>
     
        <section anchor="section:Data-Converter" title="Data Converter">
          <section title="Role of Data Converter">
              <t>
                  Every NSF has its own unique capabilities. The capabilities of an NSF are registered into Security Controller by a Developer's Management System, which manages the NSF, via Registration Interface. Therefore, Security Controller already has all information about the capabilities of NSFs. This means that Security Controller can find target NSFs with only the data (e.g., subject and object for a security policy) of the high-level policy by comparing the extracted data with all capabilities of each NSF. This search process for appropriate NSFs is called by policy provisioning, and it eliminates the need for I2NSF User to specify the target NSFs explicitly in a high-level security policy.
              </t>
              <t>
                  Data Converter selects target NSFs and converts the extracted data into the capabilities of selected NSFs. If Security Controller uses this data convertor, it can provide the policy provisioning function to I2NSF User automatically. Thus, the translator design provides big benefits to the I2NSF Framework.
              </t>
          </section>

        <section anchor="section:nsf-database" title="NSF Database">
          <t>
            The NSF Database contains all the information needed to convert high-level policy data to low-level policy data. The contents of NSF Database are classified as the following two: "endpoint information" and "NSF capability information".
          </t>
          <t>
            The first is "endpoint information". Endpoint information is necessary to convert an abstract high-level policy data such as Son's_PC and malicious_websites to a specific low-level policy data such as 192.0.2.0/24 and malicious1, respectively. In the high-level policy, the range of endpoints for applying security policy MUST be provided abstractly. Thus, endpoint information is needed to specify the abstracted high-level policy data. Endpoint information is provided by I2NSF User as the high-level policy through Consumer-Facing Interface, and Security Controller builds NSF Database based on received information.
          </t>
          <t>
            The second is "NSF capability information". Since capability is information that allows NSF to know what features it can support, NSF capability information is used in policy provisioning process to search the appropriate NSFs through the security policy. NSF capability information is provided by Developer's Management System (DMS) through Registration Interface, and Security Controller builds NSF Database based on received information. In addition, if the NSF sends monitoring information such as initiating information to Security Controller through NSF-Facing Interface, Security Controller can modify NSF Database accordingly.
          </t>
                <figure anchor="figure:Entity-Relationship-Diagram" title="Entity-Relationship Diagram of NSF Database">
                    <artwork><![CDATA[
  NSF Capability Information                   Endpoint Information
  +-------------------+   has        convert   +------------------+
  |        NSF        +||---+        +-------||+     Endpoint     |
  +-------------------+     |        |         +------------------+
  | *nsf_id   (INT)   |     |        |         | *end_id (INT)    |
  | nsf_name  (STRING)|     |        |         | keyword (STRING) |
  | inbound   (INT)   |     |        |         +------------------+
  | outbound  (INT)   |     |        |
  | bandwidth (INT)   |     |        |
  | activated (BOOL)  |     |        |
  +-------------------+     |        |
            +---------------+        |        +---------------------+
           /|\                       +------||+ Mapping Information |
  +--------------------+   has       |        +---------------------+
  |     Capability     +||---+       |        | *element_id (INT)   |
  +--------------------+     |       |        | element_name(STR)   |
  | *capa_id   (INT)   |     |       |        | element_map (STR)   |
  | capa_name  (STRING)|     |       |        +---------------------+
  | capa_index (INT)   |     |       |
  +--------------------+     |       |
                            /|\     /|\
                     +-----------------------+
                     |         Field         |
                     +-----------------------+
                     | *field_id   (INT)     |
                     | field_name  (STRING)  |
                     | field_index (INT)     |				   
                     | mapped_data (STRING)  |
                     +-----------------------+
                    ]]></artwork>
                </figure>
          <t>
            <xref target="figure:Entity-Relationship-Diagram" /> shows an Entity-Relationship Diagram (ERD) of NSF Database designed to include both endpoint information received from I2NSF User and NSF capability information received from DMS. By designing the NSF database based on the ERD, all the information necessary for security policy translation can be stored, and the network system administrator can manage the NSF database efficiently. 
          </t>
          <t>
            ERD was expressed by using Crow's Foot notation. Crow's Foot notation represents a relationship between entities as a line and represents the cardinality of the relationship as a symbol at both ends of the line. Attributes prefixed with * are key values of each entity. A link with two vertical lines represents one-to-one mapping, and a bird-shaped link represents one-to-many mapping. An NSF entity stores the NSF name (nsf_name), NSF specification (inbound, outbound, bandwidth), and NSF activation (activated). A Capability entity stores the capability name (capa_name) and the index of the capability field in a Registration Interface YANG data model (capa_index). An Endpoint entity stores the keyword of abstract data conversion from I2NSF User (keyword). A Field entity stores the field name (field_name), the index of the field index in an NSF-Facing Interface YANG data model, and converted data by referring to the Endpoint entity and a 'convert' relationship. 
          </t>
        </section>

        <section anchor="section:Data-Conversion" title="Data Conversion in Data Converter">
                <figure anchor="figure:Data-Converter-Process" title="Example of Data Conversion">
                    <artwork><![CDATA[
   High-level                           Low-level
   Policy Data                          Policy Data
+---------------+                    +------------------------------+
|  Policy Name  |                    |  Policy Name                 |
| +-----------+ | The same value     |  +-------------------------+ |
| | block_web |-|------------------->|->|block_web_security_policy| |
| | _security | |                    |  +-------------------------+ |
| |  _policy  | |                    |                              |
| +-----------+ |                    |                              |
|               |                    |                              |
|  Rule Name    |                    |  Rule Name                   |
| +-----------+ | The same value     |  +-------------------------+ |
| | block_web |-|------------------->|->|        block_web        | |
| +-----------+ |                    |  +-------------------------+ |
|               |                    |                              |
|    Source     | Conversion into    |  Source IPv4 Range           |
| +-----------+ | User's IP address  |  +-------------------------+ |
| | Son's_PC  |-|------------------->|->|       192.0.2.0/24      | |
| +-----------+ |                    |  +-------------------------+ |
|               |                    |                              |
|  URL Name     | Conversion into    |  URL - User Defined          |
| +-----------+ | malicious websites |  +-------------------------+ |
| | malicious |-|------------------->|->|      [malicious1,       | |
| | _websites | |                    |  |       malicious2]       | |
| +-----------+ |                    |  +-------------------------+ |
|               |                    |                              |
|    Action     | Conversion into    |   Action                     |
| +-----------+ | NSF Capability     |  +-----------+               |
| |   drop    |-|------------------->|->|drop/reject|               |
| +-----------+ |                    |  +-----------+               |
+---------------+                    +------------------------------+
                    ]]></artwork>
                </figure>

          <t>
            <xref target="figure:Data-Converter-Process" /> shows an example for describing a data conversion in Data Converter. High-level policy data MUST be converted into low-level policy data which are compatible with NSFs. If a system administrator attaches a database to Data Converter, it can convert contents by referring to the database with SQL queries. Data conversion in <xref target="figure:Data-Converter-Process" /> is based on the following list:
            <list style="symbols">
              <t> 'Policy Name' and 'Rule Name' fields do NOT need the conversion. </t>
              <t> 'Source' field SHOULD be converted into an IPv4 addresses. </t>
              <t> 'URL Name' field SHOULD be converted into a URL list of malicious websites. </t>
              <t> 'Action' field SHOULD be converted into the corresponding action(s) in NSF capabilities. </t>
            </list>
          </t>
        </section>

        <section anchor="section:Data-Model-Mapper" title="Data Model Mapper">
          <t>
            When translating a policy, the mapping between each element
            of the data models are necessary to properly convert the data.
            The Data Model Mapper create a mapping model between the 
            elements in Consumer-Facing Interface YANG data model and 
            NSF-Facing Interface YANG data model. Each element in the 
            Consumer-Facing Interface Policy Data Model has at least
            one or more corresponding element in NSF-Facing Interface 
            Data Model.
          </t>

          <figure anchor="figure:mapper" title="Data Model Mapping">
           <artwork><![CDATA[
    
    Consumer-Facing Interface          NSF-Facing Interface
         YANG data model                  YANG data model
                |                               |
                V                               V
      +---------+-------------------------------+------+
      |         |       Data Model Mapper       |      |
      |         |                               |      |
      |         |  +-------------------------+  |      |
      |         +->+ Convert as a Tree Graph +<-+      |
      |            +------------+------------+         |
      |                         |                      |
      |                         v                      | 
      |          +--------------+-------------+        |
      |          | Calculate each element     |        |
      |          | Tree Edit Distance         |        |
      |          | between the CFI and NFI    |        |
      |          +--------------+-------------+        |
      |                         |                      |
      |                         v                      |
      |            +------------+------------+         |
      |            |  Get the elements with  |         |
      |            |  smallest distance as   |         |
      |            |  the candidates         |         |
      |            +------------+------------+         |
      |                         |                      |
      +-------------------------+----------------------+
                                |
                                V
                  Data Model Mapping Information

Note
CFI: Consumer-Facing Interface
NFI: NSF-Facing Interface

            ]]></artwork>
          </figure>
          
          <t>
            <xref target="figure:mapper"/> shows the automatic mapping method for I2NSF Security Policy Translator.
            The automatic mapping is helpful as the CFI and NFI YANG data models can be extended.
            The automatic mapper uses the CFI and NFI YANG data models as inputs.
            The process the Data Model and converts it into a Tree Graph.
            Tree Graph is used to proces the Data Model as a Tree instead of individual elements.
            Then the Data Model Mapper calculates the Tree Edit Distance between each element in Consumer-Facing Interface and each element in NSF-Facing Interface.
            The Tree Edit Distance can be calculated with an algorithm, e.g., Zhang-Shasha algorithm <xref target="Zhang-Shasha"/>, with the calculation should start from the root of the tree.

          </t>
          
          <t>
            The Zhang-Shasha calculates the distance by three operations:
            <list style="number">
              <t>Insert: Inserting a node or element</t>
              <t>Delete: Deleting a node or element</t>
              <t>Change: Change the label of a node or element to another</t>
            </list>
          </t>
          
          <t>
            The insert and delete operations are a simple of adding/deleting a node or element with the length of the label of the node.
            The change operation must be calculated between the label of the element to produce the distance.
            There are methods to calculate this, such as Levenshtein Distance, Cosine Similarity, or Sequence Matching.
            For this data model mapper, cosine similarity should be the best choice as it measures the similarity between words.
            The data models have similarity between words and it can helps in calculating as minimum distance as possible.
          </t>
          
          <t>
            When the minimum distance is obtained, the NSF-Facing Interface element is saved as the candidates for mapping the Consumer-Facing Interface element.
            This information should be saved to the NSF Database for the Data Converter.
          </t>
          <t>
            Do note that the proper mapping can be achieved because the similarity between the Consumer-Facing Interface and NSF-Facing Interface.
            An extension created for the Consumer-Facing Interface and NSF-Facing Interface should keep the close similarity relationship between the data models to be able to produce the mapping model information automatically.
          </t>
          <t>
            The proper mapping between CFI YANG data model and NFI YANG 
            data model provided in <xref target="I-D.ietf-i2nsf-consumer-facing-interface-dm"/> 
            and <xref target="I-D.ietf-i2nsf-nsf-facing-interface-dm"/>, respectively, 
            can be seen in <xref target="section:mapping-info"/>.
          </t>

          <section anchor="section:Default-for-Translator" title="Handling of Default Values for a Low-level Security Policy">
            <t>
              Attributes in NFI YANG data model provide detailed configuration for
              NSFs to handle thorough examination for security services in a
              network. Some of the attributes in the NFI YANG data model can be
              given directly after the mapping translation from a high-level policy.
              But the CFI YANG data model is designed to be used easily by an I2NSF
              User, hence some attributes cannot be mapped directly to the
              attributes in the NFI YANG data model.
            </t>

            <t>
              To accommodate such attributes that cannot be given by the direct
              translation from the CFI YANG data model, default values can be
              used. For example, the attribute "default-action" in the NFI YANG
              data model cannot be configured by the CFI YANG data model. A
              firewall usually drops packets by default to make sure that only 
              permitted packets are allowed to pass through to the network. 
              So, the default value for the attribute "default-action" will be
              a "drop" action. This can be done in the implementation of the 
              translation so that the attribute can be given a default value.
            </t>

            <t>
              The default value for different NSFs can be different depending on
              the type of service it offers. A typical firewall may use the
              default-value "drop" for the "default-action" attribute, but an
              antivirus may use a default-value "pass" for "default-action" to make
              sure that only the detected viruses are blocked. Other types of
              firewalls may also use different default values for the "default-action".
              Thus, the actual default values that are given to the NSFs are
              out of the scope of this document.
            </t>
          </section>
        </section>

        <section title="Policy Provisioning">
            <figure anchor="figure:Policy-Provisioning" title="Example of Policy Provisioning">
                    <artwork><![CDATA[
      Log-keeper              Low-level              Web-filter
         NSF                 Policy Data                NSF
+-------------------+  +--------------------+  +-------------------+
|    Policy Name    |  |     Policy Name    |  |     Policy Name   |
| +--------------+  |  |  +--------------+  |  |  +--------------+ |
| | block_web    |<-|<-|<-| block_web    |->|->|->| block_web    | |
| | _security    |  |  |  | _security    |  |  |  | _security    | |
| | _policy      |  |  |  | _policy      |  |  |  | _policy      | |
| +--------------+  |  |  +--------------+  |  |  +--------------+ |
|                   |  |                    |  |                   |
|    Rule Name      |  |     Rule Name      |  |     Rule Name     |
| +--------------+  |  |  +--------------+  |  |  +--------------+ |
| |  block_web   |<-|<-|<-|   block_web  |->|->|->|   block_web  | |
| +--------------+  |  |  +--------------+  |  |  +--------------+ |
|                   |  |                    |  |                   |
|   Source IPv4     |  |    Source IPv4     |  |    Source IPv4    |
| +--------------+  |  |  +--------------+  |  |  +--------------+ |
| | 192.0.2.0/24 |<-|<-|<-| 192.0.2.0/24 |->|->|->| 192.0.2.0/24 | |
| +--------------+  |  |  +--------------+  |  |  +--------------+ |
|                   |  |                    |  |                   |
|                   |  | URL - User Defined |  | URL - User Defined|
|                   |  |  +--------------+  |  |  +--------------+ |
|                   |  |  | [malicious1, |->|->|->| [malicious1, | |
|                   |  |  |  malicious2] |  |  |  |  malicious2] | |
|                   |  |  +--------------+  |  |  +--------------+ |
|                   |  |                    |  |                   |
|    Log Action     |  |     Log Action     |  |                   |
| +--------------+  |  |  +--------------+  |  |                   |
| |     True     |<-|<-|<-|     True     |  |  |                   |
| +--------------+  |  |  +--------------+  |  |                   |
+-------------------+  |                    |  |                   |
                       |       Action       |  |       Action      |
                       |  +--------------+  |  |  +--------------+ |
                       |  |     Drop     |->|->|->|  Drop/Reject | |
                       |  +--------------+  |  |  +--------------+ |
                       +--------------------+  +-------------------+
                    ]]></artwork>
                </figure>
                <t>
                  Generator searches for proper NSFs which can cover
                  all of capabilities in the high-level policy. 
                  Generator searches for target NSFs by comparing 
                  only NSF capabilities which is registered by 
                  Vendor Management System. This process is called 
                  by &quot;policy provisioning&quot; because Generator
                  finds proper NSFs by using only the policy. If 
                  target NSFs are found by using other data which 
                  is not included in a user&apos;s policy, it means
                  that the user already knows the specific knowledge
                  of an NSF in the I2NSF Framework. 
                  <xref target="figure:Policy-Provisioning" /> shows
                  an example of policy provisioning. In this example, 
                  log-keeper NSF and web-filter NSF are selected for 
                  covering capabilities in the security policy. All 
                  of capabilities can be covered by two selected NSFs.
                </t>
        </section>

    </section>

    <section anchor="section:Policy-Generator" title="Policy Generator">
      <t>
        Generator makes low-level security policies for each target NSF with
        the extracted data. The low-level security policy can be produced in
        the form of XML or JSON. Libray such as PyangBind <xref target="PyangBind"/> for
        Python can be used to parse the NFI YANG data model to produce an
        XML or JSON form automatically.
      </t>
      <figure anchor="figure:Policy-Generator" title="Policy Generator Architecture">
        <artwork><![CDATA[
   +----------------------------------------------------------+
   |                    Policy Generator                      |
   |                                                          |
   |  +------------+      +-----------+    +-------------+    |
   |  | Low-level  | Pair | Low-Level |    |  NFI YANG   |    |
   |  | Attributes |<---->| Data      |    |  Data Model |    |
   |  +-----+------+      +-----+-----+    +-------+-----+    |
   |        |                   |                  |          |
   |        |                   |                  |          |
   |        +---------+---------+                  |          |
   |                  |                            |          |
   |                  |                            |          |
   |                  v                            v          |
   |          +---------------+             +------------+    |
   |          |   NFI Python  |<------------| PyangBind  |    |
   |          |     Class     |             +------------+    |
   |          +-------+-------+                               |
   |                  |                                       |
   |                  |                                       |
   |                  v                                       |
   |          +---------------+                               |
   |          |   Low-level   |                               |
   |          |    Policy     |                               |
   |          | (XML or JSON) |                               |
   |          +---------------+                               |
   |                                                          |
   +----------------------------------------------------------+
        ]]></artwork>
      </figure>
      <t>
        <xref target="figure:Policy-Generator"/> shows the architecture of the Policy Generator. First,
        PyangBind library generates a Python class hierarchy from an input of
        the NFI YANG data model. This allows low-level data instances from
        the Data Converter (<xref target="section:Data-Converter"/>) to be inserted into the NFI Python
        Class. To get the appropriate attributes, the low-level data is
        paired with the attributes received from the Data Model Mapper 
        (<xref target="section:Data-Model-Mapper"/>). The filled entry can then be encoded into an XML or
        JSON form automatically by PyangBind.
      </t>
      <t>
        <xref target="figure:Low-Level-Policy-Example"/> shows
        an XML example of a low-level policy generated by the
        translator.
      </t>
      <figure anchor="figure:Low-Level-Policy-Example" title="Example of Low-Level Policy">
        <artwork><![CDATA[
      <i2nsf-security-policy>
        <name>block_web_security_policy</name>
        <rules>
          <name>block_web</name>
          <condition>
            <ipv4>
              <ipv4>
                <source-ipv4-network>192.0.2.0/24</source-ipv4-network>
              </ipv4>
            </ipv4>
            <url-category>
              <user-defined>malicious1</user-defined>
              <user-defined>malicious2</user-defined>
            </url-category>
          </condition>
          <action>
            <packet-action>drop</packet-action>
          </action>
        </rules>
      </i2nsf-security-policy>
          ]]></artwork>
      </figure>
    </section>
  </section>

    <section anchor="section:implementation-considerations" title="Implementation Considerations">
      <t>
        The implementation considerations in this document include the following three: 
        "data model auto-adaptation", "data conversion", and "policy provisioning".
      </t>

      <section title="Data Model Auto-adaptation">
        <t>
          Security Controller which acts as an intermediary entity MUST 
          process the data according to the data model of the connected 
          interfaces. However, the data model can be changed flexibly
          depending on the situation, and Security Controller may adapt
          to the change of the data model. Therefore, Security Controller
          can be implemented for convenience so that the security policy
          translator can easily adapt to the change of the data model.
        </t>
        <t>
          The translator constructs and uses the DFA to adapt to the Consumer-
          Facing Interface Data Model. The DFA starts from the root node of the
          YANG tree and expands operations by changing the state according to
          the input. Based on the YANG data model, a container node is defined
          as a middle state and a leaf node is defined as an extractor node.
          After that, if the nodes are connected in the same way as the
          hierarchical structure of the data model, Security Controller can
          automatically construct the DFA. Therefore, the DFA can be conveniently
          built by investigating the link structure using the stack through 
          a Depth-First Search, starting from the root node.
        </t>
        <t>
          The Policy Generator uses PyangBind to construct the hierarchy of the
          NFI YANG data model into a Python class. This allows an XML or JSON form
          to be generated automatically even with updates of the NFI YANG data model.
          Thus, the security policy translator is able to auto-adapt to the
          NFI YANG data model.
        </t>
      </section>

      <section title="Data Conversion">
        <t>
          Security Controller requires the ability to materialize 
          the abstract data in the high-level security policy and 
          forward it to NSFs. Security Controller can receive endpoint 
          information as keywords through the high-level security 
          policy. At this time, if the endpoint information 
          corresponding to the keyword is mapped and the query 
          is transmitted to the NSF Database, the NSF Database 
          can be conveniently registered with necessary information 
          for data conversion. When a policy tries to establish a 
          policy through the keyword, Security Controller searches 
          for the details corresponding to the keyword registered in the 
          NSF Database and converts the keyword into appropriate 
          and specific data.
        </t>
      </section>

      <section title="Policy Provisioning">
        <t>
          This document states that a policy provisioning function is 
          necessary to enable an I2NSF User without expert security
          knowledge to create policies. Policy provisioning is determined
          by the capability of the NSF. If the information about an NSF's
          capability for a policy is available to Security Controller,
          the probability of the selection of an appropriate NSF may 
          increase.
        </t>
        
        <t>
          Most importantly, selected NSFs may be able to perform all 
          capabilities in the security policy. This document recommends 
          the study of policy provisioning algorithms that are highly 
          efficient and can satisfy all capabilities in the security
          policy.
        </t>
      </section>
    </section>

    <section anchor="section:Features-of-Translator" title="Features of Security Policy Translator Design">
      <t>
        First, by showing a visualized translator structure, the 
        security manager can handle various policy changes. 
        Translator can be shown by visualizing DFA
        so that the manager can easily understand the structure of
        Security Policy Translator.
      </t>
      <t>
        Second, if it only keeps the hierarchy of the data 
        model, an I2NSF User can freely create high-level policies. 
        In the case of DFA, data extraction can be performed in 
        the same way even if the order of input is changed. The 
        design of the security policy translator is more flexible 
        than the existing method that works by keeping the tag's 
        position and order exactly.
      </t>
      <t>
        Third, the structure of Security Policy Translator can be 
        updated even while Security Policy Translator is operating.
        Because Security Policy Translator is modularized, the 
        translator can adapt to changes in an NSF's capabilities while
        the I2NSF framework is running. The function of changing the 
        translator's structure can be provided through the Registration 
        Interface <xref target="I-D.ietf-i2nsf-registration-interface-dm"/>.
      </t>
    </section>

    <section anchor="section:Security-Considerations" title="Security Considerations">
      <t>
        The data saved in the database used by the translation process
        MUST be kept securely. Some of the data used to convert the data 
        from the high-level security policy to the corresponding low-level
        security policy may be considered private, e.g., IP addresses 
        mapped to users. And also, alterated data in the database can cause a 
        mistranslation and create a vulnerability in the network security 
        that can be utilized by the attacker. 
      </t>
      <t>
        The configuration and its delivery MUST follow the security considerations
        discussed in <xref target="I-D.ietf-i2nsf-consumer-facing-interface-dm"/> 
        and <xref target="I-D.ietf-i2nsf-nsf-facing-interface-dm"/>.
      </t>
    </section>

    <section anchor="section:IANA-Considerations" title="IANA Considerations">
	    <t>	
        This document does not require any IANA actions.
	    </t>
    </section>

</middle>

<back>

<references title="Normative References">
  <?rfc include="reference.RFC.7950"?>
  <?rfc include="reference.RFC.8040"?>
  <?rfc include="reference.RFC.6241"?>
  <?rfc include="reference.RFC.8329"?>
  <?rfc include="reference.I-D.ietf-i2nsf-consumer-facing-interface-dm"?>
  <?rfc include="reference.I-D.ietf-i2nsf-nsf-facing-interface-dm"?>
  <?rfc include="reference.I-D.ietf-i2nsf-registration-interface-dm"?>
  <?rfc include="reference.I-D.ietf-i2nsf-capability-data-model"?>
</references>

<references title="Informative References">
    <?rfc include="reference.RFC.8519"?>
    <reference anchor="Automata">
        <front>
            <title>Formal Languages and Automata, 6th Edition</title>
            <author initials="L." surname="Peter" />
            <date month="January" year="2016" />
        </front>
    </reference>
    
    <reference anchor="Zhang-Shasha">
        <front>
            <title>Simple Fast Algorithms for the Editing Distance Between Trees and Related Problems</title>
            <author initials="K." surname="Zhang" />
            <author initials="D." surname="Shasha" />
            <date year="1989" />
        </front>
        <seriesInfo name="SIAM J. Comput." value="https://www.researchgate.net/publication/220618233_Simple_Fast_Algorithms_for_the_Editing_Distance_Between_Trees_and_Related_Problems"/>
    </reference>
    
    <reference anchor="PyangBind">
        <front>
            <title>PyangBind</title>
            <author initials="R." surname="Shakir" />
            <date year="2018" />
        </front>
        <seriesInfo name="PyangBind" value="https://github.com/robshakir/pyangbind"/>
    </reference>


    <reference anchor="XML">
        <front>
            <title>On Views and XML (Extensible Markup Language)</title>
            <author>
                <organization>W3C</organization>
            </author>
            <date month="June" year="1999" />
        </front>
    </reference>
		
    <reference anchor="XSLT">
        <front>
            <title>Extensible Stylesheet Language Transformations (XSLT) Version 1.0</title>         
					  <author>
                <organization>W3C</organization>
            </author>
            <date month="November" year="1999" />
        </front>
    </reference>
    </references>

    <section anchor="section:mapping-info" title="Mapping Information for Data Conversion">
      <t>
        <xref target="figure:mapping-list" /> shows a mapping list of
        data fields between Consumer-Facing Interface YANG data model and 
        NSF-Facing Interface YANG data model. <xref target="figure:mapping-list" /> 
        describes the process of passing the data value to the appropriate 
        data field of the Data Model in detail after the data conversion.
      </t>
        <figure anchor="figure:mapping-list" title="Mapping Information for Data Conversion">
            <artwork><![CDATA[
#policy name mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/name
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /name

#language mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/language
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /language
              
#resolution-strategy mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/resolution-strategy
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /resolution-strategy

#rule name mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/name
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/name
              
#rule priority mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/priority
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/priority
              
#event mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/event
/system-event
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/event/system-event
              
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/event
/system-alarm
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/event/system-alarm
              

#firewall-condition source target reference and mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/firewall/source
  -> reference: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or "device-group")/name
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or "device-group")/mac-address
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ethernet
                  /source-mac-address
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or device-group")/range-ipv4-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv4
                  /("source-ipv4-network" or "source-ipv4-range")
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or device-group")/range-ipv6-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv6
                  /("source-ipv6-network" or "source-ipv6-range")

#firewall-condition destination target reference and mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rule/condition
/firewall/destination
  -> reference: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or "device-group")/name
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or "device-group")/mac-address
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ethernet
                  /destination-mac-address
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or "device-group")/range-ipv4-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv4
                  /("destination-ipv4-network" or
                    "destination-ipv4-range")
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-group
                /("user-group" or "device-group")/range-ipv6-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv6
                  /("destination-ipv6-network" or
                    "destination-ipv6-range")
                        
#ddos-condition threshold mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/ddos/packet-rate-threshold
  -> mapping: /ietf-i2nsf-nsf-facing-interface
              /i2nsf-security-policy/rules/condition
              /ddos/alert-packet-rate
                
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/ddos/packet-byte-threshold
  -> mapping: /ietf-i2nsf-nsf-facing-interface
              /i2nsf-security-policy/rules/condition
              /ddos/alert-byte-rate
                
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/ddos/flow-rate-threshold
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/ddos/alert-flow-rate

#anti-virus-condition mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/anti-virus/profile
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/anti-virus/profile
              
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/anti-virus/exception-files
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/anti-virus/exception-files

#payload-condition mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/payload/content
  -> reference: /ietf-i2nsf-cons-facing-interface/threat-prevention
                /payload-content/name
    -> extract: /ietf-i2nsf-cons-facing-interface/threat-prevention
                /payload-content/contents
                /("content" and "depth" and "starting-point")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition
                  /payload/content
                      
#voice-condition mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/voice/source-id
  -> reference: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /voice-group/name
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /voice-group/sip-id
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/voice
                  /source-voice-id
            
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/voice/destination-id
  -> reference: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /voice-group/name
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /voice-group/sip-id
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/voice
                  /destination-voice-id

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/voice/user-agent
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/voice/user-agent
                            
#geographic-location mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/geographic-location/source
/("country" and "region" and "city")
  -> reference: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /location-group/("country" and "region" and "city")
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /location-group/range-ipv4-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv4
                  /("source-ipv4-network" or "source-ipv4-range")
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /location-group/range-ipv6-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv6
                  /("source-ipv6-network" or "source-ipv6-range")

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/geographic-location/destination
/("country" and "region" and "city")
  -> reference: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /location-group/("country" and "region" and "city")
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /location-group/range-ipv4-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv4
                  /("destination-ipv4-network" or 
                    "destination-ipv4-range")          
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /location-group/range-ipv6-address
                /("start" and "end")
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/ipv4
                  /("destination-ipv6-network" or 
                    "destination-ipv6-range") 

#url-condition mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/url/url-name
  -> reference: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /url-group/name
    -> extract: /ietf-i2nsf-cons-facing-interface/endpoint-groups
                /url-group/url
      -> mapping: /ietf-i2nsf-nsf-facing-interface
                  /i2nsf-security-policy/rules/condition/url-category
                  /("pre-defined" or "user-defined")
                  
#time mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/time/start-date-time
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/time/start-date-time

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/time/end-date-time
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/time/end-date-time

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/
/rules/condition/context/time/period/start-time
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/time/period/start-time
              
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/
/rules/condition/context/time/period/end-time
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/time/period/end-time

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/
/rules/condition/context/time/period/day
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/time/period/day

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/
/rules/condition/context/time/period/date
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules//condition/context/time/period/date

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/
/rules/condition/context/time/period/month
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/time/period/month

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/
/rules/condition/context/time/frequency
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/time/frequency

#application mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/application/protocol
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/application/protocol

#device-type mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/device-type/device
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/device-type/device
              
#users mapping
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/users/user/id
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/users/user/id
              
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/users/user/name
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/users/user/name
         
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/users/group/id
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/users/group/id
         
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/condition
/context/users/group/name
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/condition/context/users/group/name

#rule action name mapping (with Service Function Chaining)
/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/action
/primary-action/action
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/action/("packet-action" or "flow-action")
              /("ingress-action" or "egress-action")
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/action/advanced-action
              /("content-security-control" or
                "attack-mitigation-control")

/ietf-i2nsf-cons-facing-interface/i2nsf-cfi-policy/rules/action
/secondary-action/log-action
  -> mapping: /ietf-i2nsf-nsf-facing-interface/i2nsf-security-policy
              /rules/action/packet-action/log-action
          ]]></artwork>
      </figure>
      <t>
        The mapping list shown in the <xref target="figure:mapping-list" /> 
        shows all mapped components.
        This data list should be saved into the NSF Database to provide the
        mapping information for converting the data.
        It is important to produce the list automatically as the Consumer-Facing
        Interface and NSF-Facing Interface can be extended anytime by
        vendors according to the provided NSF.
        The Data Model Mapper in Security Policy Translator should be used
        to produce the mapping model information automatically.
      </t>
    </section>

  <section anchor="Acknowledgments" title="Acknowledgments">
    <t>
      This document is a product by the I2NSF Working Group (WG) including 
      WG Chairs (i.e., Linda Dunbar and Yoav Nir) and Diego Lopez. 
      This document took advantage of the review and comments from the following experts: 
      Roman Danyliw and Tom Petch. 
      The authors sincerely appreciate their sincere efforts and kind help.
    </t>

    <t>
      This work was supported by Institute of Information &amp; Communications 
      Technology Planning &amp; Evaluation (IITP) grant funded by the Korea
      MSIT (Ministry of Science and ICT) (2020-0-00395, Standard
      Development of Blockchain based Network Management Automation Technology).      
      This work was supported in part by the IITP (R-20160222-002755, Cloud based
      Security Intelligence Technology Development for the Customized Security
      Service Provisioning).
      This work was supported in part by the MSIT under the Information Technology 
      Research Center (ITRC) support program (IITP-2022-2017-0-01633) supervised
      by the IITP.
    </t>
  </section>

  <section anchor="section:Contributors" title="Contributors">
    <t indent="0" pn="section-appendix.b-2">  
    The following are coauthors of this document:
    </t>  

      <contact fullname="Chaehong Chung">
        <organization showOnFrontPage="true">Department of Electrical and Computer Engineering,</organization>
        <address>
          <postal>
            <extaddr>Sungkyunkwan University</extaddr>
            <street>2066 Seobu-Ro, Jangan-Gu</street>
            <city>Suwon</city>
            <region>Gyeonggi-Do</region>
            <code>16419</code>
            <country>Republic of Korea</country>
          </postal>
          <phone>+82 31 299 4106</phone>
        </address>
      </contact>
      <contact fullname="Jung-Soo Park">
        <organization showOnFrontPage="true">Electronics and Telecommunications Research Institute</organization>
        <address>
          <postal>
            <extaddr>Electronics and Telecommunications Research Institute</extaddr>
            <street>218 Gajeong-Ro, Yuseong-Gu,</street>
            <region>Daejeon</region>
            <code>34129</code>
            <country>Republicof Korea</country>
          </postal>
          <email>pjs@etri.re.kr</email>
        </address>
      </contact>
      <contact fullname="Younghan Kim">
        <organization showOnFrontPage="true">School of Electronic Engineering</organization>
        <address>
          <postal>
            <extaddr>Soongsil University</extaddr>
            <street>369, Sangdo-ro, Dongjak-gu</street>
            <region>Seoul</region>
            <code>06978</code>
            <country>Republicof Korea</country>
          </postal>
          <email>younghak@ssu.ac.kr</email>
        </address>
      </contact>
  </section>

    <!-- START: Changes from the previous version -->
    <section title="Changes from draft-yang-i2nsf-security-policy-translation-13">
        <t>
        The following changes are made from draft-yang-i2nsf-security-policy-translation-13:
          <list style="symbols">
            <t>
              This version updates the YANG data model and mapping 
              information to follow the latest Consumer-Facing Interface
              YANG data model 
              <xref target="I-D.ietf-i2nsf-consumer-facing-interface-dm"/>. 
            </t>
          </list>
        </t>
    </section>
    <!-- END: Changes from the previous version -->
</back>

<!-- <vspace blankLines="100"/> -->
<!-- page break to put addresses onto one page-->

</rfc>
