<CODE BEGINS> file "ietf-i2nsf-cons-facing-interface@2023-03-01.yang"
module ietf-i2nsf-cons-facing-interface {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-i2nsf-cons-facing-interface";
prefix
i2nsfcfi;
import ietf-inet-types{
prefix inet;
reference "RFC 6991";
}
import ietf-yang-types{
prefix yang;
reference "RFC 6991";
}
organization
"IETF I2NSF (Interface to Network Security Functions)
Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/i2nsf>
WG List: <mailto:i2nsf@ietf.org>
Editor: Jaehoon Paul Jeong
<mailto:pauljeong@skku.edu>
Editor: Patrick Lingga
<mailto:patricklink@skku.edu>";
description
"This module is a YANG module for Consumer-Facing Interface.
Copyright (c) 2023 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject to
the license terms contained in, the Revised BSD License set
forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
for full legal notices.";
// RFC Ed.: replace XXXX with an actual RFC number and remove
// this note.
revision "2023-03-01" {
description "Initial revision.";
reference
"RFC XXXX: I2NSF Consumer-Facing Interface YANG Data Model";
// RFC Ed.: replace XXXX with an actual RFC number and remove
// this note.
}
identity resolution-strategy {
description
"Base identity for resolution strategy";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity fmr {
base resolution-strategy;
description
"Conflict resolution with First Matching Rule (FMR).";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity lmr {
base resolution-strategy;
description
"Conflict resolution with Last Matching Rule (LMR)";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity pmre {
base resolution-strategy;
description
"Conflict resolution with Prioritized Matching Rule with
Errors (PMRE)";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity pmrn {
base resolution-strategy;
description
"Conflict resolution with Prioritized Matching Rule with
No Errors (PMRN)";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity event {
description
"Base identity for policy events.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - Event";
}
identity system-event {
base event;
description
"Base Identity for system events. System event (also called
alert) is defined as a warning about any changes of
configuration, any access violation, the information of
sessions and traffic flows.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System event";
}
identity system-alarm {
base event;
description
"Base identity for system alarms. System alarm is defined as a
warning related to service degradation in system hardware.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System alarm";
}
identity access-violation {
base system-event;
description
"Access-violation system event is an event when a user tries
to access (read, write, create, or delete) any information or
execute commands above their privilege (i.e., not-conformant
with the access profile).";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System event for access
violation";
}
identity configuration-change {
base system-event;
description
"The configuration-change system event is an event when a user
adds a new configuration or modify an existing configuration
(write configuration).";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System event for
configuration change";
}
identity memory-alarm {
base system-alarm;
description
"Memory is the hardware to store information temporarily or for
a short period, i.e., Random Access Memory (RAM). A
memory-alarm is emitted when the memory usage is exceeding
the threshold.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System alarm for
memory";
}
identity cpu-alarm {
base system-alarm;
description
"CPU is the Central Processing Unit that executes basic
operations of the system. A cpu-alarm is emitted when the CPU
usage is exceeding a threshold.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System alarm for CPU";
}
identity disk-alarm {
base system-alarm;
description
"Disk or storage is the hardware to store information for a
long period, i.e., Hard Disk and Solid-State Drive. A
disk-alarm is emitted when the disk usage is exceeding a
threshold.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System alarm for disk";
}
identity hardware-alarm {
base system-alarm;
description
"A hardware alarm is emitted when a hardware failure (e.g.,
CPU, memory, disk, or interface) is detected. A hardware
failure is a malfunction within the electronic circuits or
electromechanical components of the hardware that makes it
unusable.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System alarm for
hardware";
}
identity interface-alarm {
base system-alarm;
description
"Interface is the network interface for connecting a device
with the network. The interface-alarm is emitted when the
state of the interface is changed.";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-20: I2NSF NSF
Monitoring Interface YANG Data Model - System alarm for
interface";
}
identity protocol {
description
"This identity represents the protocol types.";
}
identity transport-protocol {
base protocol;
description
"Base identity for the Layer 4 (i.e., Transport Layer)
Protocols";
}
identity tcp {
base transport-protocol;
description
"Base identity for TCP condition capabilities";
reference
"RFC 9293: Transmission Control Protocol";
}
identity udp {
base transport-protocol;
description
"Base identity for UDP condition capabilities";
reference
"RFC 768: User Datagram Protocol";
}
identity sctp {
base transport-protocol;
description
"Identity for SCTP condition capabilities";
reference
"RFC 9260: Stream Control Transmission Protocol";
}
identity dccp {
base transport-protocol;
description
"Identity for DCCP condition capabilities";
reference
"RFC 4340: Datagram Congestion Control Protocol";
}
identity application-protocol {
description
"Base identity for Application protocol. Note that a subset of
application protocols (e.g., HTTP, HTTPS, FTP, POP3, and
IMAP) are handled in this YANG module, rather than all
the existing application protocols.";
}
identity http {
base application-protocol;
description
"The identity for Hypertext Transfer Protocol version 1.1
(HTTP/1.1).";
reference
"RFC 9110: HTTP Semantics
RFC 9112: HTTP/1.1";
}
identity https {
base application-protocol;
description
"The identity for Hypertext Transfer Protocol version 1.1
(HTTP/1.1) over TLS.";
reference
"RFC 9110: HTTP Semantics
RFC 9112: HTTP/1.1";
}
identity http2 {
base application-protocol;
description
"The identity for Hypertext Transfer Protocol version 2
(HTTP/2).";
reference
"RFC 9113: HTTP/2";
}
identity https2 {
base application-protocol;
description
"The identity for Hypertext Transfer Protocol version 2
(HTTP/2) over TLS.";
reference
"RFC 9113: HTTP/2";
}
identity ftp {
base application-protocol;
description
"The identity for File Transfer Protocol.";
reference
"RFC 959: File Transfer Protocol (FTP)";
}
identity ssh {
base application-protocol;
description
"The identity for Secure Shell (SSH) protocol.";
reference
"RFC 4250: The Secure Shell (SSH) Protocol";
}
identity telnet {
base application-protocol;
description
"The identity for telnet.";
reference
"RFC 854: Telnet Protocol";
}
identity smtp {
base application-protocol;
description
"The identity for Simple Mail Transfer Protocol.";
reference
"RFC 5321: Simple Mail Transfer Protocol (SMTP)";
}
identity pop3 {
base application-protocol;
description
"The identity for Post Office Protocol 3 (POP3).";
reference
"RFC 1939: Post Office Protocol - Version 3 (POP3)";
}
identity pop3s {
base application-protocol;
description
"The identity for Post Office Protocol 3 (POP3) over TLS";
reference
"RFC 1939: Post Office Protocol - Version 3 (POP3)
RFC 2595: Using TLS with IMAP, POP3 and ACAP";
}
identity imap {
base application-protocol;
description
"The identity for Internet Message Access Protocol (IMAP).";
reference
"RFC 9051: Internet Message Access Protocol (IMAP) - Version
4rev2";
}
identity imaps {
base application-protocol;
description
"The identity for Internet Message Access Protocol (IMAP) over
TLS";
reference
"RFC 9051: Internet Message Access Protocol (IMAP) - Version
4rev2";
}
identity action {
description
"Base identity for action";
}
identity primary-action {
base action;
description
"Base identity for primary action. Primary action is an action
that handle the forwarding of the packets or flows in an
NSF.";
}
identity secondary-action {
base action;
description
"Base identity for secondary action. Secondary action is an
action in the background that does not affect the network,
such as logging.";
}
identity ingress-action {
base primary-action;
description
"Base identity for ingress action. The action to handle the
network traffic that is entering the secured network.";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Ingress Action";
}
identity egress-action {
base primary-action;
description
"Base identity for egress action. The action to handle the
network traffic that is exiting the secured network.";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Egress Action";
}
identity pass {
base ingress-action;
base egress-action;
description
"The pass action allows traffic that matches
the rule to proceed through the NSF to reach the
destination.";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity drop {
base ingress-action;
base egress-action;
description
"The drop action denies the traffic that
matches the rule. The drop action should do a silent drop,
which does not give any response to the source.";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity reject {
base ingress-action;
base egress-action;
description
"The reject action denies a packet to go through the NSF
entering or exiting the internal network and sends a response
back to the source. The response depends on the packet and
implementation. For example, a TCP packet is rejected with
TCP RST response or a UDP packet may be rejected with an
ICMPv4 response message with Type 3 Code 3 or ICMPv6 response
message Type 1 Code 4 (i.e., Destination Unreachable:
Destination port unreachable).";
}
identity mirror {
base ingress-action;
base egress-action;
description
"The mirror action copies a packet and sends the packet's copy
to the monitoring entity while still allowing the packet or
flow to go through the NSF.";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity rate-limit {
base ingress-action;
base egress-action;
description
"The rate limit action limits the number of packets or flows
that can go through the NSF by dropping packets or flows
(randomly or systematically). The drop mechanism, e.g., silent
drop and unreachable drop (i.e., reject), is up to the
implementation";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity invoke-signaling {
base egress-action;
description
"The invoke-signaling action is used to convey information of
the event triggering this action to a monitoring entity.";
}
identity tunnel-encapsulation {
base egress-action;
description
"The tunnel encapsulation action is used to encapsulate the
packet to be tunneled across the network to enable a secure
connection.";
}
identity forwarding {
base egress-action;
description
"The forwarding action is used to relay the packet from one
network segment to another node in the network.";
}
identity transformation {
base egress-action;
description
"The transformation action is used to transform a packet by
modifying it (e.g., HTTP-to-CoAP packet translation).
Note that a subset of transformation (e.g., HTTP-to-CoAP) is
handled in this YANG module, rather than all the existing
transformations. Specific algorithmic transformations can be
executed by a middlebox (e.g., NSF) for a given transformation
name.";
reference
"RFC 8075: Guidelines for Mapping Implementations: HTTP to the
Constrained Application Protocol (CoAP) - Translation between
HTTP and CoAP.";
}
identity log-action {
base secondary-action;
description
"Base identity for log action";
}
identity rule-log {
base log-action;
description
"Log the policy rule that has been triggered by a packet or
flow.";
}
identity session-log {
base log-action;
description
"A session is a connection (i.e., traffic flow) of a data plane
that includes source and destination information of IP
addresses and transport port numbers with the protocol used.
Log the session that triggered a policy rule.";
}
identity icmp-message {
description
"Base identity for ICMP Message types. Note that this YANG
module only provide ICMP messages that is shared between
ICMPv4 and ICMPv6 (e.g., Destination Unreachable: Port
Unreachable which is ICMPv4 type 3 code 3 or ICMPv6 type 1
code 4).";
reference
"RFC 792: Internet Control Message Protocol
RFC 8335: PROBE: A Utility for Probing Interfaces
IANA: Internet Control Message Protocol (ICMP)
Parameters
IANA: Internet Control Message Protocol version 6
(ICMPv6) Parameters";
}
identity echo-reply {
base icmp-message;
description
"Identity for 'Echo Reply' ICMP message type 0 in ICMPv4 or
type 129 in ICMPv6";
}
identity destination-unreachable {
base icmp-message;
description
"Identity for 'Destination Unreachable' ICMP message type 3 in
ICMPv4 or type 1 in ICMPv6";
}
identity redirect {
base icmp-message;
description
"Identity for 'Redirect' ICMP message type 5 in ICMPv4
or type 137 in ICMPv6";
}
identity echo {
base icmp-message;
description
"Identity for 'Echo' ICMP message type 8 in ICMPv4 or type 128
in ICMPv6";
}
identity router-advertisement {
base icmp-message;
description
"Identity for 'Router Advertisement' ICMP message type 9 in
ICMPv4 or type 134 in ICMPv6";
}
identity router-solicitation {
base icmp-message;
description
"Identity for 'Router Solicitation' ICMP message type 10 in
ICMPv4 or type 135 in ICMPv6";
}
identity time-exceeded {
base icmp-message;
description
"Identity for 'Time exceeded' ICMP message type 11 in ICMPv4
or type 3 in ICMPv6";
}
identity parameter-problem {
base icmp-message;
description
"Identity for 'Parameter Problem' ICMP message type 12 in
ICMPv4 or type 4 in ICMPv6";
}
identity experimental-mobility-protocols {
base icmp-message;
description
"Identity for 'Experimental Mobility Protocols' ICMP message
type 41 in ICMPv4 or type 150 in ICMPv6";
}
identity extended-echo-request {
base icmp-message;
description
"Identity for 'Extended Echo Request' ICMP message type 42
in ICMPv4 or type 160 in ICMPv6";
}
identity extended-echo-reply {
base icmp-message;
description
"Identity for 'Extended Echo Reply' ICMP message type 43 in
ICMPv4 or type 161 in ICMPv6";
}
identity port-unreachable {
base destination-unreachable;
description
"Identity for port unreachable in destination unreachable
message (i.e., ICMPv4 type 3 code 3 or ICMPv6 type 1 code 4)";
}
identity request-no-error {
base extended-echo-request;
description
"Identity for request with no error in extended echo request
message (i.e., ICMPv4 type 42 code 0 or ICMPv6 type 160
code 0)";
}
identity reply-no-error {
base extended-echo-reply;
description
"Identity for reply with no error in extended echo reply
message (i.e., ICMPv4 type 43 code 0 or ICMPv6 type 161
code 0)";
}
identity malformed-query {
base extended-echo-reply;
description
"Identity for malformed query in extended echo reply message
(i.e., ICMPv4 type 43 code 1 or ICMPv6 type 161 code 1)";
}
identity no-such-interface {
base extended-echo-reply;
description
"Identity for no such interface in extended echo reply message
(i.e., ICMPv4 type 43 code 2 or ICMPv6 type 161 code 2)";
}
identity no-such-table-entry {
base extended-echo-reply;
description
"Identity for no such table entry in extended echo reply
message (i.e., ICMPv4 type 43 code 3 or ICMPv6 type 161
code 3)";
}
identity multiple-interfaces-satisfy-query {
base extended-echo-reply;
description
"Identity for multiple interfaces satisfy query in extended
echo reply message (i.e., ICMPv4 type 43 code 4 or ICMPv6
type 161 code 4) ";
reference
"RFC 792: Internet Control Message Protocol
RFC 8335: PROBE: A Utility for Probing Interfaces";
}
identity ioc-format {
description
"This represents the base identity for the format of the
Indicators of Compromise (IOC).";
}
identity stix {
base ioc-format;
description
"This represents the Structured Threat Information Expression
(STIX) format in JSON.";
reference
"STIX: Structured Threat Information Expression version 2.1 - JSON
format";
}
identity misp {
base ioc-format;
description
"This represents the Malware Information Sharing Platform (MISP)
Core format.";
reference
"MISPCORE: Malware Information Sharing Platform (MISP) Core
Format";
}
identity openioc {
base ioc-format;
description
"This represents the OpenIOC format.";
reference
"OPENIOC: OpenIOC 1.1 Schema document";
}
identity iodef {
base ioc-format;
description
"This represents the Incident Object Description Exchange Format
(IODEF) format.";
reference
"RFC 8727: JSON Binding of the Incident Object Description
Exchange Format";
}
identity device-type {
description
"Base identity for types of device. This identity is used for
type of the device for the source or destination of a packet
or traffic flow.";
}
identity computer {
base device-type;
description
"Identity for computer such as personal computer (PC)
and server.";
}
identity mobile-phone {
base device-type;
description
"Identity for mobile-phone such as smartphone and
cellphone";
}
identity voip-vocn-phone {
base device-type;
description
"Identity for VoIP (Voice over Internet Protocol) or VoCN
(Voice over Cellular Network, such as Voice over LTE or 5G)
phone";
}
identity tablet {
base device-type;
description
"Identity for tablet devices";
}
identity network-infrastructure-device {
base device-type;
description
"Identity for network infrastructure devices
such as switch, router, and access point";
}
identity iot-device {
base device-type;
description
"Identity for Internet of Things (IoT) devices
such as sensors, actuators, and low-power
low-capacity computing devices";
}
identity ot {
base device-type;
description
"Identity for Operational Technology (OT) devices (also
known as industrial control systems) that interact
with the physical environment and detect or cause direct
change through the monitoring and control of devices,
processes, and events such as programmable logic
controllers (PLCs), digital oscilloscopes, building
management systems (BMS), and fire control systems";
}
identity vehicle {
base device-type;
description
"Identity for transportation vehicles that connect to and
share data through the Internet over Vehicle-to-Everything
(V2X) communications.";
}
/*
* Typedefs
*/
typedef time {
type string {
pattern '(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.\d+)?'
+ '(Z|[\+\-]((1[0-3]|0[0-9]):([0-5][0-9])|14:00))?';
}
description
"The time type represents an instance of time of zero-duration
in the specified timezone that recurs every day.";
}
typedef day {
type enumeration {
enum monday {
description
"This represents Monday.";
}
enum tuesday {
description
"This represents Tuesday.";
}
enum wednesday {
description
"This represents Wednesday";
}
enum thursday {
description
"This represents Thursday.";
}
enum friday {
description
"This represents Friday.";
}
enum saturday {
description
"This represents Saturday.";
}
enum sunday {
description
"This represents Sunday.";
}
}
description
"The type for representing the day of the week.";
}
/*
* Groupings
*/
grouping ip-address-info {
description
"There are two types to configure a security policy
for an IP address, such as IPv4 adress and IPv6 address.";
choice match-type {
description
"User can choose between IPv4 and IPv6.";
case range-match-ipv4 {
list range-ipv4-address {
key "start end";
leaf start {
type inet:ipv4-address-no-zone;
mandatory true;
description
"A start IPv4 address for a range match.";
}
leaf end {
type inet:ipv4-address-no-zone;
mandatory true;
description
"An end IPv4 address for a range match.";
}
description
"A range match for IPv4 addresses is provided.
Note that the start IPv4 address must be lower than
the end IPv4 address.";
}
}
case range-match-ipv6 {
list range-ipv6-address {
key "start end";
leaf start {
type inet:ipv6-address-no-zone;
mandatory true;
description
"A start IPv6 address for a range match.";
}
leaf end {
type inet:ipv6-address-no-zone;
mandatory true;
description
"An end IPv6 address for a range match.";
}
description
"A range match for IPv6 addresses is provided.
Note that the start IPv6 address must be lower than
the end IPv6 address.";
}
}
}
}
grouping user-group {
description
"This group represents user group information to label MAC
addresses and IP (IPv4 or IPv6) addresses as a group of users.";
leaf name {
type string;
description
"This represents the name of a user-group. A user-group name
is used to map a user-group's name (e.g., employees) to IP
address(es), MAC address(es).
It is dependent on implementation.";
}
leaf-list mac-address {
type yang:mac-address;
description
"Represent the MAC Address of a user-group. A user-group
can have multiple MAC Addresses.";
}
uses ip-address-info{
description
"This represents the IP addresses of a user-group.";
refine match-type{
mandatory true;
}
}
}
grouping device-group {
description
"This group represents device group information to label
IP (IPv4 or IPv6) addresses that provide services hosted
on the application protocol.";
leaf name {
type string;
description
"This represents the name of a device-group.";
}
uses ip-address-info{
description
"This represents the IP addresses of a device-group.";
refine match-type{
mandatory true;
}
}
leaf-list application-protocol {
type identityref {
base application-protocol;
}
description
"This represents the application layer protocols of devices.
If this is not set, it cannot support the appropriate
protocol";
}
}
grouping location-group {
description
"This group represents location-group information to map
IPv4 or IPv6 address to the geographical location.";
leaf country {
type string {
length "2";
pattern "[a-zA-Z]{2}";
}
description
"This represents the 2-letter ISO country code conforming to
ISO3166-1 alpha 2. Examples include 'US' for United States,
'JP' for Japan, and 'PL' for Poland.";
reference
"ISO 3166-1: Decoding table alpha-2 country code";
}
leaf region {
type string {
length "5..6";
pattern "[a-zA-Z]{2}-[a-zA-Z0-9]{2,3}";
}
description
"This represents the ISO region code conforming to ISO 3166-2.
Examples include 'ID-RI' for Riau province of Indonesia and
'NG-RI' for the Rivers province in Nigeria.";
reference
"ISO 3166-2: 3166-2 subdivision code";
}
leaf city {
type string;
description
"This represents the city of a region. Examples include
'Dublin', 'New York', and 'Sao Paulo'.";
}
uses ip-address-info{
refine match-type{
mandatory true;
description
"This represents the IP addresses of a location-group.";
}
}
}
grouping payload-string {
description
"The grouping for payload-string content. It contains
information such as name and string content.";
}
list i2nsf-cfi-policy {
key "name";
description
"This is a security policy list. Each policy in the list
contains a list of security policy rules, and is a policy
instance to have the information of where and when a policy
needs to be applied.";
leaf name {
type string;
description
"The name which identifies the policy.";
}
leaf language {
type string {
pattern '((([A-Za-z]{2,3}(-[A-Za-z]{3}(-[A-Za-z]{3})'
+ '{0,2})?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-[A-Za-z]{4})?'
+ '(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}'
+ '|([0-9][A-Za-z0-9]{3})))*(-[0-9A-WYZa-wyz]'
+ '(-([A-Za-z0-9]{2,8}))+)*(-[Xx](-([A-Za-z0-9]'
+ '{1,8}))+)?|[Xx](-([A-Za-z0-9]{1,8}))+|'
+ '(([Ee][Nn]-[Gg][Bb]-[Oo][Ee][Dd]|[Ii]-'
+ '[Aa][Mm][Ii]|[Ii]-[Bb][Nn][Nn]|[Ii]-'
+ '[Dd][Ee][Ff][Aa][Uu][Ll][Tt]|[Ii]-'
+ '[Ee][Nn][Oo][Cc][Hh][Ii][Aa][Nn]'
+ '|[Ii]-[Hh][Aa][Kk]|'
+ '[Ii]-[Kk][Ll][Ii][Nn][Gg][Oo][Nn]|'
+ '[Ii]-[Ll][Uu][Xx]|[Ii]-[Mm][Ii][Nn][Gg][Oo]|'
+ '[Ii]-[Nn][Aa][Vv][Aa][Jj][Oo]|[Ii]-[Pp][Ww][Nn]|'
+ '[Ii]-[Tt][Aa][Oo]|[Ii]-[Tt][Aa][Yy]|'
+ '[Ii]-[Tt][Ss][Uu]|[Ss][Gg][Nn]-[Bb][Ee]-[Ff][Rr]|'
+ '[Ss][Gg][Nn]-[Bb][Ee]-[Nn][Ll]|[Ss][Gg][Nn]-'
+ '[Cc][Hh]-[Dd][Ee])|([Aa][Rr][Tt]-'
+ '[Ll][Oo][Jj][Bb][Aa][Nn]|[Cc][Ee][Ll]-'
+ '[Gg][Aa][Uu][Ll][Ii][Ss][Hh]|'
+ '[Nn][Oo]-[Bb][Oo][Kk]|[Nn][Oo]-'
+ '[Nn][Yy][Nn]|[Zz][Hh]-[Gg][Uu][Oo][Yy][Uu]|'
+ '[Zz][Hh]-[Hh][Aa][Kk][Kk][Aa]|[Zz][Hh]-'
+ '[Mm][Ii][Nn]|[Zz][Hh]-[Mm][Ii][Nn]-'
+ '[Nn][Aa][Nn]|[Zz][Hh]-[Xx][Ii][Aa][Nn][Gg])))';
}
default "en-US";
description
"The value in this field indicates the language tag
used for all of the 'leaf description' described in the
'i2nsf-cfi-policy'.
The attribute is encoded following the rules in Section 2.1
in RFC 5646. The default language tag is 'en-US'";
reference
"RFC 5646: Tags for Identifying Languages";
}
leaf resolution-strategy {
type identityref {
base resolution-strategy;
}
default fmr;
description
"The resolution strategies that can be used to
specify how to resolve conflicts that occur between
actions of the same or different policy rules that
are matched and contained in this particular NSF";
reference
"draft-ietf-i2nsf-capability-data-model-32:
I2NSF Capability YANG Data Model - Resolution strategy";
}
list rules {
key "name";
description
"There can be a single or multiple number of rules.";
leaf name {
type string;
description
"This represents the name for a rule. Each rule name must
be unique. Note that since this name is a key in the
list of rules, its uniqueness is verified.";
}
leaf priority {
type uint8 {
range "1..255";
}
description
"The priority keyword comes with a mandatory
numeric value which can range from 1 through 255.
Note that a higher number means a higher priority";
}
container event {
description
"This represents an event (i.e., a security event), for
which a security rule is made.";
leaf-list system-event {
type identityref {
base system-event;
}
description
"The security policy rule according to
system events.";
}
leaf-list system-alarm {
type identityref {
base system-alarm;
}
description
"The security policy rule according to
system alarms.";
}
}
container condition {
description
"Conditions for general security policies.";
container firewall {
description
"A general firewall condition based on the packet
header.";
leaf-list source {
type union {
type leafref {
path "/endpoint-groups/user-group/name";
}
type leafref {
path "/endpoint-groups/device-group/name";
}
}
description
"This describes the path of the source.";
}
leaf-list destination {
type union {
type leafref {
path "/endpoint-groups/user-group/name";
}
type leafref {
path "/endpoint-groups/device-group/name";
}
}
description
"This describes the path to the destinations.";
}
leaf transport-layer-protocol {
type identityref {
base transport-protocol;
}
description
"The transport-layer protocol to be matched.";
}
list range-port-number {
key "start end";
leaf start {
type inet:port-number;
description
"A start port number for a range match.";
}
leaf end {
type inet:port-number;
must '. >= ../start' {
error-message
"An end port number MUST be equal to or greater than
a start port number.";
}
description
"An end port number for a range match.";
}
description
"A range match for transport-layer port number. Note
that the start port number value must be lower than
the end port number value";
}
container icmp {
description
"Represents the ICMPv4 and ICMPv6 packet header
information to determine if the set of policy
actions in this ECA policy rule should be executed
or not.";
reference
"RFC 792: Internet Control Message Protocol
RFC 8335: PROBE: A Utility for Probing Interfaces";
leaf-list message {
type identityref {
base icmp-message;
}
description
"The security policy rule according to
ICMP message. The type is representing the
ICMP message corresponds to the ICMP type and
code.";
reference
"RFC 792: Internet Control Message Protocol
RFC 8335: PROBE: A Utility for Probing Interfaces
IANA: Internet Control Message Protocol (ICMP)
Parameters
IANA: Internet Control Message Protocol version 6
(ICMPv6) Parameters";
}
}
}
container ddos {
description
"A condition for a DDoS attack.";
container rate-limit {
description
"This describes the rate-limit.";
leaf packet-rate-threshold {
type uint64;
units "pps";
description
"This is a trigger value for a rate limit of packet
rate in packets per second (pps) for a
DDoS-attack mitigation.";
}
leaf byte-rate-threshold {
type uint64;
units "Bps";
description
"This is a trigger value for a rate limit of byte
rate in bytes per second (Bps) for a DDoS-attack
mitigation.";
}
leaf flow-rate-threshold {
type uint64;
description
"This is a trigger value for a rate limit of flow
creating request rate (e.g., new TCP connection
establishment) in flows per second for a DDoS-attack
mitigation.";
}
}
}
container anti-virus {
description
"A condition for anti-virus";
leaf-list profile {
type string;
description
"The path or name of the file that contains a security
profile for the Antivirus configuration. The security
profile is used to scan the viruses. The absolute
path and relative ones are to be interpreted as
globs.";
reference
"GLOB: The Open Group Base Specifications Issue 7 - glob";
}
leaf-list exception-files {
type string;
description
"The type or name of the files to be excluded by the
antivirus. This can be used to keep the known
harmless files. Absolute paths are filenames/paths
to be excluded and relative ones are interpreted as
globs.";
reference
"GLOB: The Open Group Base Specifications Issue 7 - glob";
}
}
container payload {
description
"A condition based on a packet's content.";
leaf-list content {
type leafref {
path "/threat-prevention/payload-content/name";
}
description
"This describes the paths to a packet content's";
}
}
container url-category {
description
"Condition for url category";
leaf url-name {
type leafref {
path "/endpoint-groups/url-group/name";
}
description
"This is description for the condition of a URL's
category such as SNS sites, game sites, ecommerce
sites, company sites, and university sites.";
}
}
container voice {
description
"For the VoIP/VoCN security system, a VoIP/
VoCN security system can monitor each
VoIP/VoCN flow and manage VoIP/VoCN
security rules controlled by a centralized
server for VoIP/VoCN security service
(called VoIP IPS). The VoIP/VoCN security
system controls each switch for the
VoIP/VoCN call flow management by
manipulating the rules that can be added,
deleted, or modified dynamically.
Note that VoIP is Voice over Internet Protocol
and VoCN is Voice over Cellular Network such as
Voice over LTE or 5G";
reference
"RFC 3261: SIP: Session Initiation Protocol";
leaf-list source-id {
type leafref {
path "/endpoint-groups/voice-group/name";
}
description
"The security policy rule according to
the 'From' header field of the SIP.";
reference
"RFC 3261: SIP: Session Initiation Protocol
- Section 8.1.1.3 (From)";
}
leaf-list destination-id {
type leafref {
path "/endpoint-groups/voice-group/name";
}
description
"The security policy rule according to
the 'To' header field of the SIP.";
reference
"RFC 3261: SIP: Session Initiation Protocol
- Section 8.1.1.2 (To)";
}
leaf-list user-agent {
type string;
description
"The security policy rule according to
the 'user-agent' field of the SIP.";
reference
"RFC 3261: SIP: Session Initiation Protocol
- Section 20.41 (User-Agent)";
}
}
container context {
description
"Condition for matching the context of the packet, such
as geographic location, time, packet direction";
container time {
description
"The time when a security policy rule should be
applied.";
leaf start-date-time {
type yang:date-and-time;
description
"This is the start date and time for a security
policy rule.";
}
leaf end-date-time {
type yang:date-and-time;
description
"This is the end date and time for a security policy
rule. The policy rule will stop working after the
specified end date and time.";
}
container period {
when
"../frequency!='only-once'";
description
"This represents the repetition time. In the case
where the frequency is weekly, the days can be
set.";
leaf start-time {
type time;
description
"This is a period's start time for an event.";
}
leaf end-time {
type time;
description
"This is a period's end time for an event.";
}
leaf-list day {
when
"../../frequency='weekly'";
type day;
min-elements 1;
description
"This represents the repeated day of every week
(e.g., Monday and Tuesday). More than one day can
be specified.";
}
leaf-list date {
when
"../../frequency='monthly'";
type int8 {
range "1..31";
}
min-elements 1;
description
"This represents the repeated date of every month.
More than one date can be specified.";
}
leaf-list month {
when
"../../frequency='yearly'";
type string{
pattern '\d{2}-\d{2}';
}
min-elements 1;
description
"This represents the repeated date and month of
every year. More than one can be specified.
A pattern used here is Month and Date (MM-DD).";
}
}
leaf frequency {
type enumeration {
enum only-once {
description
"This represents that the rule is immediately
enforced only once and not repeated. The policy
will continuously be active from the
start-date-time to the end-date-time.";
}
enum daily {
description
"This represents that the rule is enforced on a
daily basis. The policy will be repeated daily
until the end-date-time.";
}
enum weekly {
description
"This represents that the rule is enforced on a
weekly basis. The policy will be repeated weekly
until the end-date-time. The repeated days can
be specified.";
}
enum monthly {
description
"This represents that the rule is enforced on a
monthly basis. The policy will be repeated
monthly until the end-date-time.";
}
enum yearly {
description
"This represents that the rule is enforced on a
yearly basis. The policy will be repeated
yearly until the end-date-time.";
}
}
default only-once;
description
"This represents how frequently the rule should be
enforced.";
}
}
container application {
description
"Condition for application";
leaf-list protocol {
type identityref {
base application-protocol;
}
description
"The condition based on the application layer
protocol";
}
}
container device-type {
description
"Condition for type of the destination device";
leaf-list device {
type identityref {
base device-type;
}
description
"The device attribute that can identify a device (i.e.,
computer, mobile phone, smartphone, VoIP/VoCN phone,
tablet, network infrastructure device, IoT device,
OT device, and vehicle).";
}
}
container users {
description
"Condition for users";
list user {
key "id";
description
"The user with which the traffic flow is associated
can be identified by either a user ID or username.
The user-to-IP address mapping is assumed to be
provided by the unified user management system via
network.";
leaf id {
type uint32;
description
"The ID of the user.";
}
leaf name {
type string;
description
"The name of the user.";
}
}
list group {
key "id";
description
"The user group with which the traffic flow is
associated can be identified by either a group ID
or group name. The group-to-IP address and
user-to-group mappings are assumed to be provided by
the unified user management system via network.";
leaf id {
type uint32;
description
"The ID of the group.";
}
leaf name {
type string;
description
"The name of the group.";
}
}
}
container geographic-location {
description
"A condition for a location-based connection";
container source {
leaf country {
type leafref {
path "/endpoint-groups/location-group/country";
}
description
"The name of the country in the 2-letter ISO country
code conforming to ISO3166-1 alpha-2.";
reference
"ISO 3166-1: Decoding table alpha-2 country code";
}
leaf region {
type leafref {
path "/endpoint-groups/location-group/region";
}
description
"The region code conforming to ISO 3166-2.";
reference
"ISO 3166-2: 3166-2 subdivision code.";
}
leaf city {
type leafref {
path "/endpoint-groups/location-group/city";
}
description
"The name of the city of the location.";
}
description
"This describes the paths to a location's source.
The values in this field will be mapped into
either IPv4 or IPv6 addresses defined in
/endpoint-groups/location-group.";
}
container destination {
leaf country {
type leafref {
path "/endpoint-groups/location-group/country";
}
description
"The name of the country in the 2-letter ISO country
code conforming to ISO3166-1 alpha-2.";
reference
"ISO 3166-1: Decoding table alpha-2 country code";
}
leaf region {
type leafref {
path "/endpoint-groups/location-group/region";
}
description
"The region code conforming to ISO 3166-2.";
reference
"ISO 3166-2: 3166-2 subdivision code.";
}
leaf city {
type leafref {
path "/endpoint-groups/location-group/city";
}
description
"The name of the city of the location.";
}
description
"This describes the paths to a location's
destination. The values in this field will be
mapped into either IPv4 or IPv6 addresses defined in
/endpoint-groups/location-group.";
}
}
}
container threat-feed {
description
"A condition based on the threat-feed information.";
leaf-list name {
type leafref {
path "/threat-prevention/threat-feed-list/name";
}
description
"This describes the paths to a threat-feed's sources.";
}
}
}
container action {
description
"This is the action container.";
container primary-action {
description
"This represents primary actions (e.g., ingress and
egress actions) to be applied to a condition.
If this is not set, it cannot support the primary
actions.";
leaf action {
type identityref {
base primary-action;
}
mandatory true;
description
"Ingress actions: pass, drop, reject, rate-limit,
and mirror.
Egress actions: pass, drop, reject, rate-limit,
mirror, invoke-signaling, tunnel-encapsulation,
forwarding, and transformation.";
}
leaf limit {
when "../action = 'i2nsfcfi:rate-limit'" {
description
"Rate-limit is valid only when rate-limit action is
used.";
}
type decimal64 {
fraction-digits 2;
}
units "bytes per second";
description
"Specifies how to rate-limit the traffic.";
}
}
container secondary-action {
description
"This represents secondary actions (e.g., log and syslog)
to be applied if they are needed. If this is not set,
it cannot support the secondary actions.";
leaf log-action {
type identityref {
base secondary-action;
}
description
"Log action: rule log and session log";
}
}
}
}
}
container endpoint-groups {
description
"A logical entity in a business environment, where a security
policy is to be applied.";
list user-group{
uses user-group;
key "name";
description
"This represents a user group.";
}
list device-group {
key "name";
uses device-group;
description
"This represents a device group.";
}
list location-group{
key "country region city";
uses location-group;
description
"This represents a location group.";
}
list url-group {
key "name";
description
"This describes the list of URL.";
leaf name {
type string;
description
"This is the name of URL group, e.g., SNS sites,
gaming sites, ecommerce sites";
}
leaf-list url {
type inet:uri;
description
"Specifies the URL to be added into the group.";
reference
"RFC 3986: Uniform Resource Identifier (URI): Generic
Syntax";
}
}
list voice-group {
key "name";
description
"This describes the list of Voice ID";
leaf name {
type string;
description
"This is the name of the voice group.";
}
leaf-list sip-id {
type inet:uri;
description
"Specifies the logical identity of the SIP user written in
SIP URI scheme.";
reference
"RFC3261: SIP: Session Initiation Protocol
- Section 19.1.1 (SIP and SIPS URI Components)";
}
}
}
container threat-prevention {
description
"The container for threat-prevention.";
list threat-feed-list {
key "name";
description
"There can be a single or multiple number of
threat-feeds.";
leaf name {
type string;
description
"This represents the name of the threat-feed.";
}
leaf-list ioc {
type string;
description
"This field represents the Indicators of Compromise (IOC),
i.e., the critical information of patterns or characteristics
(signatures) in the threat feed that identifies malicious
activities. The format of the information given in this field
should be parsed based on the format field (e.g., STIX, MISP,
OpenIOC, and IODEF).";
}
leaf format {
type identityref {
base ioc-format;
}
mandatory true;
description
"This represents the format of the IOC information. This
field is mandatory to parse the IOC. The examples of the
format are STIX, MISP, OpenIOC, and IODEF.";
reference
"STIX: Structured Threat Information Expression version 2.1
MISPCORE: Malware Information Sharing Platform (MISP) Core
Format
OPENIOC: OpenIOC 1.1 Schema document
RFC 8727: JSON Binding of the Incident Object Description
Exchange Format";
}
}
list payload-content {
key "name";
leaf name {
type string;
description
"This represents the name of a packet's payload-content.
It should give an idea of why a specific payload content
is marked as a threat. For example, the name 'backdoor'
indicates the payload content is related to a backdoor
attack.";
}
leaf description {
type string;
description
"This represents the description of a payload. Describe
how the payload contents are related to a security
attack.";
}
list contents {
key "content";
ordered-by user;
leaf content {
type binary;
description
"This represents the pattern of the payload contents (i.e.,
the data after a transport layer header) to be matched.
Due to the types of threats, the type of the content is
defined as a binary to accommodate any kind of a payload
type such as HTTP, HTTPS, and SIP.
If multiple instances of content are defined, it should
match all contents somewhere in the session stream. The
content pattern should be matched based on the order
given by the user. The scope of the payload to be matched
can be defined by the depth and offset/distance fields.";
}
leaf depth {
type uint16 {
range "1..max";
}
units "bytes";
description
"The field specifies how far a packet should be searched
for the specified content pattern defined in the content
field. For example, a depth of 5 means to only look for
the specified content pattern within the first 5 bytes
of the payload. This field accept values greater than or
equal to the content length being searched. If this
field is undefined, then the content pattern should be
searched within the whole payload.";
}
choice starting-point {
description
"Choice of how to specify the starting point of matching
the pattern to the payload. If this field is undefined,
then the content pattern should be searched from the
beginning of the payload.";
case offset {
leaf offset {
type int32;
units "bytes";
description
"The field specifies where to start searching for the
specified content pattern within the payload.
For example, an offset of 5 means to start looking for
the specified content pattern after the first 5 bytes
of the payload. A negative value means to start from
the last bytes of the payload. For example, an offset
of -5 means to start looking for the specified content
pattern from the last 5 bytes of the payload.";
}
}
case distance {
leaf distance {
type int32;
units "bytes";
description
"The field specifies how far a payload should be
ignored before starting to search for the specified
content pattern relative to the end of the previous
specified content pattern match. This can be thought
of as exactly the same thing as offset, except it is
relative to the end of the last pattern match instead
of the beginning of the packet. For example, a distance
of 5 means to start looking for the specified content
pattern 5 bytes after the last byte of the matched
pattern. A negative value means to start looking before
the last byte of the previous matched pattern. For
example, a distance of -5 means to start looking for
the specified content pattern 5 bytes before the last
byte of the previous matched pattern.
Note that this field cannot be used if the content is
the first order of the list.";
}
}
}
description
"List of contents and their scopes for matching content
pattern with the payload";
}
description
"This represents a payload-string group.";
}
}
}
<CODE ENDS>