<CODE BEGINS> file "ietf-i2nsf-policy-rule-for-nsf@2021-08-15.yang"
module ietf-i2nsf-policy-rule-for-nsf {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-i2nsf-policy-rule-for-nsf";
prefix
nsfintf;
import ietf-inet-types{
prefix inet;
reference
"Section 4 of RFC 6991";
}
import ietf-yang-types {
prefix yang;
reference
"Section 3 of RFC 6991";
}
organization
"IETF I2NSF (Interface to Network Security Functions)
Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/i2nsf>
WG List: <mailto:i2nsf@ietf.org>
Editor: Jinyong Tim Kim
<mailto:timkim@skku.edu>
Editor: Jaehoon Paul Jeong
<mailto:pauljeong@skku.edu>";
description
"This module is a YANG module for Network Security Functions
(NSF)-Facing Interface.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this
document are to be interpreted as described in BCP 14
(RFC 2119) (RFC 8174) when, and only when, they appear
in all capitals, as shown here.
Copyright (c) 2021 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 Simplified 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.";
revision "2021-08-15"{
description "The latest revision.";
reference
"RFC XXXX: I2NSF Network Security Function-Facing Interface
YANG Data Model";
}
/*
* Identities
*/
identity priority-usage {
description
"Base identity for priority usage type.";
}
identity priority-by-order {
base priority-usage;
description
"Identity for priority by order";
}
identity priority-by-number {
base priority-usage;
description
"Identity for priority by number";
}
identity event {
description
"Base identity for policy events";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - Event";
}
identity system-event {
base event;
description
"Identity for system events";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System event";
}
identity system-alarm {
base event;
description
"Identity for system alarms";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System alarm";
}
identity access-violation {
base system-event;
description
"Identity for access violation
system events";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System event for access
violation";
}
identity configuration-change {
base system-event;
description
"Identity for configuration change
system events";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System event for configuration
change";
}
identity memory-alarm {
base system-alarm;
description
"Identity for memory alarm
system alarms";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System alarm for memory";
}
identity cpu-alarm {
base system-alarm;
description
"Identity for CPU alarm
system alarms";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System alarm for CPU";
}
identity disk-alarm {
base system-alarm;
description
"Identity for disk alarm
system alarms";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System alarm for disk";
}
identity hardware-alarm {
base system-alarm;
description
"Identity for hardware alarm
system alarms";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System alarm for hardware";
}
identity interface-alarm {
base system-alarm;
description
"Identity for interface alarm
system alarms";
reference
"draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF NSF
Monitoring YANG Data Model - System alarm for interface";
}
identity fragmentation-flags {
description
"Base identity for fragmentation flags type";
reference
"RFC 791: Internet Protocol - Fragmentation Flags";
}
identity fragment {
base fragmentation-flags;
description
"Identity for 'More fragment' flag";
reference
"RFC 791: Internet Protocol - Fragmentation Flags";
}
identity no-fragment {
base fragmentation-flags;
description
"Identity for 'Do not fragment' flag";
reference
"RFC 791: Internet Protocol - Fragmentation Flags";
}
identity reserved {
base fragmentation-flags;
description
"Identity for reserved flags";
reference
"RFC 791: Internet Protocol - Fragmentation Flags";
}
identity ipopts {
description
"Base identity for IP options";
reference
"RFC 791: Internet Protocol - Options";
}
identity rr {
base ipopts;
description
"Identity for 'Record Route' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity eol {
base ipopts;
description
"Identity for 'End of List' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity nop {
base ipopts;
description
"Identity for 'No Operation' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity ts {
base ipopts;
description
"Identity for 'Timestamp' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity sec {
base ipopts;
description
"Identity for 'IP security' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity esec {
base ipopts;
description
"Identity for 'IP extended security' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity lsrr {
base ipopts;
description
"Identity for 'Loose Source Routing' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity ssrr {
base ipopts;
description
"Identity for 'Strict Source Routing' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity satid {
base ipopts;
description
"Identity for 'Stream Identifier' IP Option";
reference
"RFC 791: Internet Protocol - Options";
}
identity any {
base ipopts;
description
"Identity for 'any IP options
included in IPv4 packet";
reference
"RFC 791: Internet Protocol - Options";
}
identity tcp-flags {
description
"Base identity for TCP flags";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity cwr {
base tcp-flags;
description
"Identity for 'Congestion Window Reduced' TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity ecn {
base tcp-flags;
description
"Identity for 'Explicit Congestion Notification'
TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity urg {
base tcp-flags;
description
"Identity for 'Urgent' TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity ack {
base tcp-flags;
description
"Identity for 'acknowledgement' TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity psh {
base tcp-flags;
description
"Identity for 'Push' TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity rst {
base tcp-flags;
description
"Identity for 'Reset' TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity syn {
base tcp-flags;
description
"Identity for 'Synchronize' TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity fin {
base tcp-flags;
description
"Identity for 'Finish' TCP flag";
reference
"RFC 793: Transmission Control Protocol - Flags";
}
identity target-device {
description
"Base identity for target devices";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model";
}
identity computer {
base target-device;
description
"Identity for computer such as personal computer (PC)
and server";
}
identity mobile-phone {
base target-device;
description
"Identity for mobile-phone such as smartphone and
cellphone";
}
identity voip-volte-phone {
base target-device;
description
"Identity for voip-volte-phone";
}
identity tablet {
base target-device;
description
"Identity for tablet";
}
identity network-infrastructure-device {
base target-device;
description
"Identity for network infrastructure devices
such as switch, router, and access point";
}
identity iot-device {
base target-device;
description
"Identity for IoT (Internet of Things) devices";
}
identity ot {
base target-device;
description
"Identity for Operational Technology";
}
identity vehicle {
base target-device;
description
"Identity for vehicle that connects to and shares
data through the Internet";
}
identity advanced-nsf {
description
"Base identity for advanced Network Security Function (NSF)
capability. This can be used for advanced NSFs such as
Anti-DDoS Attack, IPS, URL-Filtering, Antivirus,
and VoIP/VoLTE Filter.";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model";
}
identity content-security-control {
base advanced-nsf;
description
"Base identity for content security control";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model";
}
identity ips {
base content-security-control;
description
"Identity for IPS (Intrusion Prevention System)
that prevents malicious activity within a network";
}
identity url-filtering {
base content-security-control;
description
"Identity for url filtering that limits access by comparing the
web traffic's URL with the URLs for web filtering in a
database";
}
identity anti-virus {
base content-security-control;
description
"Identity for antivirus to protect the network by detecting and
removing viruses or malwares.";
}
identity voip-volte-filter {
base content-security-control;
description
"Identity for VoIP/VoLTE security service that filters out the
packets or flows of malicious users with a deny list of
malicious users in a database";
}
identity attack-mitigation-control {
base advanced-nsf;
description
"Base identity for attack mitigation control";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model";
}
identity anti-ddos {
base attack-mitigation-control;
description
"Identity for advanced NSF Anti-DDoS or DDoS Mitigator
capability.";
}
identity ingress-action {
description
"Base identity for action";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Ingress Action";
}
identity egress-action {
description
"Base identity for egress action";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Egress Action";
}
identity default-action {
description
"Base identity for default action";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Default Action";
}
identity pass {
base ingress-action;
base egress-action;
base default-action;
description
"Identity for pass";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity drop {
base ingress-action;
base egress-action;
base default-action;
description
"Identity for drop";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity mirror {
base ingress-action;
base egress-action;
base default-action;
description
"Identity for mirror";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity rate-limit {
base ingress-action;
base egress-action;
base default-action;
description
"Identity for rate limiting action";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Actions and
Default Action";
}
identity log-action {
description
"Base identity for log action";
}
identity rule-log {
base log-action;
description
"Identity for rule log";
}
identity session-log {
base log-action;
description
"Identity for session log";
}
identity invoke-signaling {
base egress-action;
description
"Identity for invoke signaling";
}
identity tunnel-encapsulation {
base egress-action;
description
"Identity for tunnel encapsulation";
}
identity forwarding {
base egress-action;
description
"Identity for forwarding";
}
identity transformation {
base egress-action;
description
"Identity for transformation";
}
identity redirection {
base egress-action;
description
"Identity for redirection";
}
identity resolution-strategy {
description
"Base identity for resolution strategy";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity fmr {
base resolution-strategy;
description
"Identity for First Matching Rule (FMR)";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity lmr {
base resolution-strategy;
description
"Identity for Last Matching Rule (LMR)";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity pmr {
base resolution-strategy;
description
"Identity for Prioritized Matching Rule (PMR)";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity pmre {
base resolution-strategy;
description
"Identity for Prioritized Matching Rule
with Errors (PMRE)";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity pmrn {
base resolution-strategy;
description
"Identity for Prioritized Matching Rule
with No Errors (PMRN)";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Resolution Strategy";
}
identity day {
description
"This represents the base for days.";
}
identity monday {
base day;
description
"This represents Monday.";
}
identity tuesday {
base day;
description
"This represents Tuesday.";
}
identity wednesday {
base day;
description
"This represents Wednesday.";
}
identity thursday {
base day;
description
"This represents Thursday.";
}
identity friday {
base day;
description
"This represents Friday.";
}
identity saturday {
base day;
description
"This represents Saturday.";
}
identity sunday {
base day;
description
"This represents Sunday.";
}
/*
* 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
that recurs every day.";
}
/*
* Groupings
*/
grouping ipv4-prefix {
description
"The list of IPv4 addresses.";
leaf ipv4 {
type inet:ipv4-address;
description
"The value of IPv4 address.";
}
choice subnet {
description
"The subnet can be specified as a prefix length or
netmask.";
leaf prefix-length {
type uint8 {
range "0..32";
}
description
"The length of the subnet prefix.";
}
leaf netmask {
type yang:dotted-quad;
description
"The subnet specified as a netmask.";
}
}
reference
"RFC 791: Internet Protocol - IPv4 address
RFC 8344: A YANG Data Model for IP Management";
}
grouping ipv6-prefix {
description
"The list of IPv6 addresses.";
leaf ipv6 {
type inet:ipv6-address;
description
"The value of IPv6 address.";
}
leaf prefix-length {
type uint8 {
range "0..128";
}
description
"The length of the subnet prefix.";
}
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - IPv6 address
RFC 8344: A YANG Data Model for IP Management";
}
grouping ipv4-range {
description
"Range match for the IPv4 addresses. If only one value is
needed, then set both start and end to the same value.
The end IPv4 address MUST be equal or greater than the
start IPv4 address.";
leaf start {
type inet:ipv4-address;
description
"Starting IPv4 address for a range match.";
}
leaf end {
type inet:ipv4-address;
description
"Ending IPv4 address for a range match.";
}
reference
"RFC 791: Internet Protocol - IPv4 address";
}
grouping ipv6-range {
description
"Range match for the IPv6 addresses. If only one value is
needed, then set both start and end to the same value.
The end IPv6 address number MUST be equal to or greater than
the start IPv6 address.";
leaf start {
type inet:ipv6-address;
description
"Starting IPv6 address for a range match.";
}
leaf end {
type inet:ipv6-address;
description
"Ending IPv6 address for a range match.";
}
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - IPv6 address";
}
grouping ipv4-address {
description
"Grouping for IPv4 address. IPv4 address can be in the form of
prefix or range.";
choice match-type {
description
"Choose between Prefix or Range";
case prefix {
list ipv4-prefix {
key "ipv4";
uses ipv4-prefix;
description
"The list of IPv4 addresses specified with an
IPv4 address and a prefix-length or
a netmask.";
}
}
case range {
list ipv4-range {
key "start end";
uses ipv4-range;
description
"The list of IPv4 address specified with a
start IPv4 address and an end IPv4 address.
If only one value is needed, then set both
start and end to the same value.";
}
}
}
}
grouping ipv6-address {
description
"Grouping for IPv6 address. IPv6 address can be in the form of
prefix or range.";
choice match-type {
description
"Choose between Prefix or Range";
case prefix {
list ipv6-prefix {
key "ipv6";
uses ipv6-prefix;
description
"The list of IPv6 addresses specified with an
IPv6 address and a prefix-length.";
}
}
case range {
list ipv6-range {
key "start end";
uses ipv6-range;
description
"The list of IPv6 address specified with a
start IPv6 address and an end IPv6 address.
If only one value is needed, then set both
start and end to the same value.";
}
}
}
}
grouping port-range {
leaf start {
type inet:port-number;
description
"Starting port number for a range match.";
}
leaf end {
type inet:port-number;
must '. >= ../start' {
error-message
"The end port number MUST be equal to or greater than the
start port number.";
}
description
"Ending port number for a range match.";
}
description
"Range match for the port numbers. If only one value is needed,
then set both start and end to the same value.";
reference
"RFC 793: Transmission Control Protocol - Port number
RFC 768: User Datagram Protocol - Port Number
RFC 4960: Stream Control Transmission Protocol - Port number
RFC 4340: Datagram Congestion Control Protocol (DCCP)
- Port number";
}
/*
* Data nodes
*/
list i2nsf-security-policy {
key "system-policy-name";
description
"Container for security policy
including a set of security rules according to certain logic,
i.e., their similarity or mutual relations, etc. The network
security policy can be applied to both the unidirectional
and bidirectional traffic across the NSF.
The I2NSF security policies use the Event-Condition-Action
(ECA) policy model ";
reference
"RFC 8329: Framework for Interface to Network Security
Functions - I2NSF Flow Security Policy Structure
draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Design Principles and
ECA Policy Model Overview";
leaf system-policy-name {
type string;
description
"The name of the policy.
This must be unique.";
}
leaf priority-usage {
type identityref {
base priority-usage;
}
default priority-by-order;
description
"Priority usage type for security policy rule:
priority by order and priority by number";
}
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-17:
I2NSF Capability YANG Data Model - Resolution strategy";
}
leaf default-action {
type identityref {
base default-action;
}
default mirror;
description
"This default action can be used to specify a predefined
action when no other alternative action was matched
by the currently executing I2NSF Policy Rule. An analogy
is the use of a default statement in a C switch statement.";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Default Action";
}
list rules {
key "rule-name";
description
"This is a rule for network security functions.";
leaf rule-name {
type string;
description
"The name of the rule.";
}
leaf rule-description {
type string;
description
"This description gives more information about
rules.";
}
leaf rule-priority {
type uint8 {
range "1..255";
}
description
"The priority keyword comes with a mandatory
numeric value which can range from 1 till 255.
Note that a higher number means a higher priority";
}
leaf rule-enable {
type boolean;
description
"True is enable.
False is not enable.";
}
leaf session-aging-time {
type uint16;
units "second";
description
"This is session aging time.";
}
container long-connection {
description
"This is long-connection";
leaf enable {
type boolean;
description
"True is enable.
False is not enable.";
}
leaf duration {
type uint16;
description
"This is the duration of the long-connection.";
}
}
container event {
description
"An event is defined as any important
occurrence in time of a change in the system being
managed, and/or in the environment of the system being
managed. When used in the context of policy rules for
a flow-based NSF, it is used to determine whether the
Condition clause of the Policy Rule can be evaluated
or not. Examples of an I2NSF event include time and
user actions (e.g., logon, logoff, and actions that
violate any ACL.).";
reference
"RFC 8329: Framework for Interface to Network Security
Functions - I2NSF Flow Security Policy Structure
draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Design Principles and
ECA Policy Model Overview
draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF
NSF Monitoring YANG Data Model - Alarms, Events, Logs,
and Counters";
leaf event-clause-description {
type string;
description
"Description for an event clause";
}
container time {
description
"Time to determine when the policy 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 policy rule. The
policy rule will stop working after the specified
end-date-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 identityref{
base 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 int32{
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
enforcedonly once and not repeated. The policy
will continuously be active from the start-time
to the end-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.";
}
enum weekly {
description
"This represents that the rule is enforced on a
weekly basis. The policy will be repeated weekly
until the end-date. 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.";
}
enum yearly {
description
"This represents that the rule is enforced on
a yearly basis. The policy will be repeated
yearly until the end-date.";
}
}
default only-once;
description
"This represents how frequently the rule
should be enforced.";
}
}
container event-clauses {
description
"System Event Clause - either a system event or
system alarm";
reference
"RFC 8329: Framework for Interface to Network Security
Functions - I2NSF Flow Security Policy Structure
draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Design Principles and
ECA Policy Model Overview
draft-ietf-i2nsf-nsf-monitoring-data-model-08: I2NSF
NSF Monitoring YANG Data Model - Alarms, Events, Logs,
and Counters";
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
"A condition is defined as a set
of attributes, features, and/or values that are to be
compared with a set of known attributes, features,
and/or values in order to determine whether or not the
set of Actions in that (imperative) I2NSF Policy Rule
can be executed or not. Examples of I2NSF Conditions
include matching attributes of a packet or flow, and
comparing the internal state of an NSF to a desired
state.";
reference
"RFC 8329: Framework for Interface to Network Security
Functions - I2NSF Flow Security Policy Structure
draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Design Principles and
ECA Policy Model Overview";
leaf condition-clause-description {
type string;
description
"Description for a condition clause.";
}
container ethernet {
description
"The purpose of this container is to represent layer 2
packet header information to determine the set of policy
actions in this ECA policy rule should be executed or
not.";
reference
"IEEE 802.3: IEEE Standard for Ethernet";
leaf ethernet-description {
type string;
description
"The MAC Condition description";
}
leaf-list source-address {
type yang:mac-address;
description
"The condition for source Media Access Control (MAC)
Address of a Layer 2 packet. Multiple source MAC
Addresses can be given in a single rule.";
reference
"IEEE 802.3: IEEE Standard for Ethernet";
}
leaf-list destination-address {
type yang:mac-address;
description
"The condition for destination Media Access Control
(MAC) Address of a Layer 2 packet. Multiple
destination MAC Addresses can be given in a
single rule.";
reference
"IEEE 802.3: IEEE Standard for Ethernet";
}
leaf-list ether-type {
type uint16;
description
"The condition for matching the 2-octet of IEEE 802.3
Length/Type field. Can be specified with decimal or
hexadecimal from 0 through 65535 (0xFFFF)
A value from 0 through 1500 (0x05DC) specifies the
number of MAC client data octets contained in the
subsequent MAC Client Data Field of the basic frame
A value greater than or equal to 1536 (0x0600)
specifies that the Length/Type field indicates
Ethertype of the MAC client protocol";
reference
"IEEE 802.3: IEEE Standard for Ethernet";
}
}
container ipv4 {
description
"The purpose of this container is to represent IPv4
packet header information to determine if the set
of policy actions in this ECA policy rule should be
executed or not.";
reference
"RFC 791: Internet Protocol";
leaf description {
type string;
description
"ipv4 condition textual description.";
}
list header-length {
key "start end";
leaf start{
type uint8 {
range "5..15";
}
description
"Starting IPv4 header length for a range match.";
}
leaf end {
type uint8 {
range "5..15";
}
must '. >= ../start' {
error-message
"The end header length MUST be equal to or greater
than the start header length.";
}
description
"Ending IPv4 header length for a range match.";
}
description
"The security policy rule according to
IPv4 header length. If only one value is needed, then
set both start and end to the same value.";
reference
"RFC 791: Internet Protocol - Header length";
}
leaf-list dscp {
type inet:dscp;
description
"The security policy rule according to
IPv4 type of service for DSCP.";
reference
"RFC 791: Internet Protocol - Type of service
RFC 2474: Definition of the Differentiated
Services Field (DS Field) in the IPv4 and
IPv6 Headers.";
}
list total-length {
key "start end";
leaf start {
type uint16;
description
"Starting IPv4 total length for a range match.";
}
leaf end {
type uint16;
must '. >= ../start' {
error-message
"The end total length MUST be equal to or greater
than the start total length.";
}
description
"Ending IPv4 total length for a range match.";
}
description
"The security policy rule according to
IPv4 total length. If only one value is needed, then
set both start and end to the same value.";
reference
"RFC 791: Internet Protocol - Total length";
}
leaf-list identification {
type uint16;
description
"The security policy rule according to
IPv4 identification.";
reference
"RFC 791: Internet Protocol - Identification";
}
leaf-list fragment-flags {
type identityref {
base fragmentation-flags;
}
description
"The security policy rule according to
IPv4 fragment flags.";
reference
"RFC 791: Internet Protocol - Fragment flags";
}
list fragment-offset {
key "start end";
leaf start {
type uint16 {
range "0..16383";
}
description
"Starting IPv4 fragment offset for a range match.";
}
leaf end {
type uint16 {
range "0..16383";
}
must '. >= ../start' {
error-message
"The end fragment offset MUST be equal or greater
than the start fragment offset.";
}
description
"Ending IPv4 fragment offset for a range match.";
}
description
"The security policy rule according to
IPv4 fragment offset.";
reference
"RFC 791: Internet Protocol - Fragment offset";
}
list ttl {
key "start end";
leaf start {
type uint8;
description
"Starting IPv4 TTL for a range match.";
}
leaf end {
type uint8;
must '. >= ../start' {
error-message
"The end TTL MUST be equal or greater than
the start TTL.";
}
description
"Ending IPv4 TTL for a range match.";
}
description
"The security policy rule according to
IPv4 time-to-live (TTL). If only one value is needed,
then set both start and end to the same value.";
reference
"RFC 791: Internet Protocol - Time to live";
}
leaf-list protocol {
type uint8;
description
"The security policy rule according to
IPv4 protocol header field.";
reference
"RFC 791: Internet Protocol - Protocol
IANA: Assigned Internet Protocol Numbers";
}
container source-address {
uses ipv4-address;
description
"The security policy rule according to
IPv4 source address.";
reference
"RFC 791: Internet Protocol - IPv4 Address";
}
container destination-address {
uses ipv4-address;
description
"The security policy rule according to
IPv4 destination address.";
reference
"RFC 791: Internet Protocol - IPv4 Address";
}
leaf-list ipopts {
type identityref {
base ipopts;
}
description
"The security policy rule according to
IPv4 options.";
reference
"RFC 791: Internet Protocol - Options";
}
}
container ipv6 {
description
"The purpose of this container is to represent
IPv6 packet header information to determine
if the set of policy actions in this ECA policy
rule should be executed or not.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification";
leaf description {
type string;
description
"This is description for ipv6 condition.";
}
leaf-list dscp {
type inet:dscp;
description
"The security policy rule according to
IPv6 traffic class for DSCP.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - Traffic class
RFC 2474: Definition of the Differentiated
Services Field (DS Field) in the IPv4 and
IPv6 Headers.";
}
list flow-label {
key "start end";
leaf start {
type inet:ipv6-flow-label;
description
"Starting IPv6 flow label for a range match.";
}
leaf end {
type inet:ipv6-flow-label;
must '. >= ../start' {
error-message
"The end flow label MUST be equal or greater than
the start flow label.";
}
description
"Ending IPv6 flow label for a range match.";
}
description
"The security policy rule according to
IPv6 flow label. If only one value is needed,
then set both start and end to the same value.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - Flow label";
}
list payload-length {
key "start end";
leaf start {
type uint16;
description
"Starting IPv6 payload length for a range match.";
}
leaf end {
type uint16;
must '. >= ../start' {
error-message
"The end payload length MUST be equal or greater
than the start payload length.";
}
description
"Ending IPv6 payload length for a range match.";
}
description
"The security policy rule according to
IPv6 payload length. If only one value is needed,
then set both start and end to the same value.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - Payload length";
}
leaf-list next-header {
type uint8;
description
"The security policy rule according to
IPv6 next header.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - Next header
IANA: Assigned Internet Protocol Numbers";
}
list hop-limit {
key "start end";
leaf start {
type uint8;
description
"Start IPv6 hop limit for a range match.";
}
leaf end {
type uint8;
must '. >= ../start' {
error-message
"The end hop limit MUST be equal or greater than
the start hop limit.";
}
description
"End IPv6 hop limit for a range match.";
}
description
"The security policy rule according to
IPv6 hop limit. If only one value is needed,
then set both start and end to the same value.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - Hop limit";
}
container source-address {
uses ipv6-address;
description
"The security policy rule according to
IPv6 source address.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - IPv6 address";
}
container destination-address {
uses ipv6-address;
description
"The security policy rule according to
IPv6 destination address.";
reference
"RFC 8200: Internet Protocol, Version 6 (IPv6)
Specification - IPv6 address";
}
}
container tcp {
description
"The purpose of this container is to represent
TCP packet header information to determine
if the set of policy actions in this ECA policy
rule should be executed or not.";
reference
"RFC 793: Transmission Control Protocol";
leaf description {
type string;
description
"This is description for tcp condition.";
}
list source-port-number {
key "start end";
uses port-range;
description
"The security policy rule according to
tcp source port number.";
reference
"RFC 793: Transmission Control Protocol
- Port number";
}
list destination-port-number {
key "start end";
uses port-range;
description
"The security policy rule according to
tcp destination port number.";
reference
"RFC 793: Transmission Control Protocol
- Port number";
}
leaf-list flags {
type identityref {
base tcp-flags;
}
description
"The security policy rule according to
tcp flags.";
reference
"RFC 793: Transmission Control Protocol
- Flags";
}
}
container udp {
description
"The purpose of this container is to represent
UDP packet header information to determine
if the set of policy actions in this ECA policy
rule should be executed or not.";
reference
"RFC 768: User Datagram Protocol";
leaf description {
type string;
description
"This is description for udp condition.";
}
container source-port-number {
uses port-range;
description
"The security policy rule according to
udp source port number.";
reference
"RFC 768: User Datagram Protocol - Port Number";
}
container destination-port-number {
uses port-range;
description
"The security policy rule according to
udp destination port number.";
reference
"RFC 768: User Datagram Protocol - Port Number";
}
list total-length {
key "start end";
leaf start {
type uint32;
description
"Start udp total length for a range match.";
}
leaf end {
type uint32;
must '. >= ../start' {
error-message
"The end hop limit MUST be equal or greater than
the start hop limit.";
}
description
"End udp total length for a range match.";
}
description
"The security policy rule according to
udp total length. If only one value is needed,
then set both start and end to the same value";
reference
"RFC 768: User Datagram Protocol - Total Length";
}
}
container sctp {
description
"The purpose of this container is to represent
SCTP packet header information to determine
if the set of policy actions in this ECA policy
rule should be executed or not.";
leaf description {
type string;
description
"This is description for sctp condition.";
}
container source-port-number {
uses port-range;
description
"The security policy rule according to
sctp source port number.";
reference
"RFC 4960: Stream Control Transmission Protocol
- Port number";
}
container destination-port-number {
uses port-range;
description
"The security policy rule according to
sctp destination port number.";
reference
"RFC 4960: Stream Control Transmission Protocol
- Port Number";
}
leaf-list verification-tag {
type uint32;
description
"The security policy rule according to
udp total length.";
reference
"RFC 4960: Stream Control Transmission Protocol
- Verification Tag";
}
leaf-list chunk-type {
type uint8;
description
"The security policy rule according to
sctp chunk type ID Value.";
reference
"RFC 4960: Stream Control Transmission Protocol
- Chunk Type";
}
}
container dccp {
description
"The purpose of this container is to represent
DCCP packet header information to determine
if the set of policy actions in this ECA policy
rule should be executed or not.";
leaf description {
type string;
description
"This is description for dccp condition.";
}
container source-port-number {
uses port-range;
description
"The security policy rule according to
dccp source port number.";
reference
"RFC 4340: Datagram Congestion Control Protocol (DCCP)
- Port number";
}
container destination-port-number {
uses port-range;
description
"The security policy rule according to
dccp destination port number.";
reference
"RFC 4340: Datagram Congestion Control Protocol (DCCP)
- Port number";
}
leaf-list service-code {
type uint32;
description
"The security policy rule according to
dccp service code.";
reference
"RFC 4340: Datagram Congestion Control Protocol (DCCP)
- Service Codes
RFC 5595: The Datagram Congestion Control Protocol
(DCCP) Service Codes
RFC 6335: Internet Assigned Numbers Authority (IANA)
Procedures for the Management of the Service
Name and Transport Protocol Port Number
Registry - Service Code";
}
}
list icmp {
key "version";
description
"The purpose of this container is to represent
ICMP 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 description {
type string;
description
"This is description for icmp condition.";
}
leaf version {
type enumeration {
enum icmpv4 {
value "1";
description
"The ICMPv4 Protocol as defined in RFC 792";
}
enum icmpv6 {
value "2";
description
"The ICMPv6 Protocol as defined in RFC 4443";
}
}
description
"The ICMP version to be matched. This value
affected the type and code values.";
reference
"RFC 792: Internet Control Message Protocol
RFC 4443: Internet Control Message Protocol (ICMPv6)
for the Internet Protocol Version 6 (IPv6)
Specification";
}
leaf-list type {
type uint8;
description
"The security policy rule according to
ICMPv4 or ICMPv6 type header field.
The value of this leaf-list is affected by
the value of the leaf version.
If the version value is icmpv4, the type follows
the IANA ICMP Parameters.
If the version value is icmpv6, the type follows
the IANA ICMPv6 Parameters.";
reference
"RFC 792: Internet Control Message Protocol
RFC 4443: Internet Control Message Protocol (ICMPv6)
for the Internet Protocol Version 6 (IPv6)
Specification
RFC 8335: PROBE: A Utility for Probing Interfaces
IANA: Internet Control Message Protocol (ICMP)
Parameters
IANA: Internet Control Message Protocol version 6
(ICMPv6) Parameters";
}
leaf-list code {
type uint8;
description
"The security policy rule according to
ICMPv4 or ICMPv6 code header field.
The value of this leaf-list is affected by
the value of the leaf version.
If the version value is icmpv4, the code follows
the IANA ICMP parameters.
If the version value is icmpv6, the code follows
the IANA ICMPv6 parameters.";
reference
"RFC 792: Internet Control Message Protocol
RFC 4443: Internet Control Message Protocol (ICMPv6)
for the Internet Protocol Version 6 (IPv6)
Specification
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 url-category {
description
"Condition for url category";
leaf description {
type string;
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.";
}
leaf-list pre-defined-category {
type string;
description
"This is pre-defined-category.";
}
leaf-list user-defined-category {
type string;
description
"This user-defined-category.";
}
}
container voice {
description
"For the VoIP/VoLTE security system, a VoIP/
VoLTE security system can monitor each
VoIP/VoLTE flow and manage VoIP/VoLTE
security rules controlled by a centralized
server for VoIP/VoLTE security service
(called VoIP IPS). The VoIP/VoLTE security
system controls each switch for the
VoIP/VoLTE call flow management by
manipulating the rules that can be added,
deleted, or modified dynamically.";
reference
"RFC 3261: SIP: Session Initiation Protocol";
leaf description {
type string;
description
"This is description for voice condition.";
}
leaf-list source-voice-id {
type string;
description
"The security policy rule according to
a source voice ID for VoIP and VoLTE.";
}
leaf-list destination-voice-id {
type string;
description
"The security policy rule according to
a destination voice ID for VoIP and VoLTE.";
}
leaf-list user-agent {
type string;
description
"The security policy rule according to
an user agent for VoIP and VoLTE.";
}
}
container ddos {
description
"Condition for DDoS attack.";
leaf description {
type string;
description
"This is description for ddos condition.";
}
leaf alert-packet-rate {
type uint32;
units "pps";
description
"The alert rate of flood detection for
packets per second (PPS) of an IP address.";
}
leaf alert-flow-rate {
type uint32;
description
"The alert rate of flood detection for
flows per second of an IP address.";
}
leaf alert-byte-rate {
type uint32;
units "BPS";
description
"The alert rate of flood detection for
bytes per second of an IP address.";
}
}
container anti-virus {
description
"Condition for antivirus";
leaf-list profile {
type string;
description
"The security profile for antivirus. This is used to
update the security profile for improving the
security. The security profile is used to scan
the viruses.";
}
leaf-list exception-files {
type string;
description
"The type or name of the files to be excluded by the
anti-virus. This can be used to keep the known
harmless files.";
}
}
container payload {
description
"Condition for packet payload";
leaf packet-payload-description {
type string;
description
"This is description for payload condition.";
}
leaf-list payload-content {
type string;
description
"This is a condition for packet payload content.";
}
}
container context {
description
"Condition for context";
leaf context-description {
type string;
description
"This is description for context condition.";
}
container application {
description
"Condition for application";
leaf description {
type string;
description
"This is description for application condition.";
}
leaf-list object {
type string;
description
"This is application object.";
}
leaf-list group {
type string;
description
"This is application group.";
}
leaf-list label {
type string;
description
"This is application label.";
}
container category {
description
"This is application category";
list application-category {
key "name subcategory";
description
"This is application category list";
leaf name {
type string;
description
"This is name for application category.";
}
leaf subcategory {
type string;
description
"This is application subcategory.";
}
}
}
}
container target {
description
"Condition for target";
leaf description {
type string;
description
"This is description for target condition.
Vendors can write instructions for target condition
that vendor made";
}
leaf-list device {
type identityref {
base target-device;
}
description
"The device attribute that can identify a device,
including the device type (i.e., router, switch,
pc, ios, or android) and the device's owner as
well.";
}
}
container users {
description
"Condition for users";
leaf users-description {
type string;
description
"This is the description for users' condition.";
}
list user {
key "user-id";
description
"The user with which the traffic flow is associated
can be identified by either a user id or user name.
The user-to-IP address mapping is assumed to be
provided by the unified user management system via
network.";
leaf user-id {
type uint32;
description
"The ID of the user.";
}
leaf user-name {
type string;
description
"The name of the user.";
}
}
list group {
key "group-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 group-id {
type uint32;
description
"The ID of the group.";
}
leaf group-name {
type string;
description
"The name of the group.";
}
}
leaf security-group {
type string;
description
"security-group.";
}
}
container geography-location {
description
"The location which network traffic flow is associated
with. The region can be the geographical location
such as country, province, and city,
as well as the logical network location such as
IP address, network section, and network domain.";
leaf description {
type string;
description
"This is description for generic context condition.
Vendors can write instructions for generic context
condition that vendor made";
}
leaf-list source {
type string;
description
"The src-geography-location is a geographical
location mapped into an IP address. It matches the
mapped IP address to the source IP address of the
traffic flow.";
reference
"ISO 3166: Codes for the representation of
names of countries and their subdivisions";
}
leaf-list destination {
type string;
description
"The dest-geography-location is a geographical
location mapped into an IP address. It matches the
mapped IP address to the destination IP address of
the traffic flow.";
reference
"ISO 3166: Codes for the representation of
names of countries and their subdivisions";
}
}
}
}
container action {
description
"An action is used to control and monitor aspects of
flow-based NSFs when the event and condition clauses
are satisfied. NSFs provide security functions by
executing various Actions. Examples of I2NSF Actions
include providing intrusion detection and/or protection,
web and flow filtering, and deep packet inspection
for packets and flows.";
reference
"RFC 8329: Framework for Interface to Network Security
Functions - I2NSF Flow Security Policy Structure
draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Design Principles and
ECA Policy Model Overview";
leaf action-clause-description {
type string;
description
"Description for an action clause.";
}
container packet-action {
description
"Action for packets";
reference
"RFC 8329: Framework for Interface to Network Security
Functions - I2NSF Flow Security Policy Structure
draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Design Principles and
ECA Policy Model Overview";
leaf ingress-action {
type identityref {
base ingress-action;
}
description
"Ingress Action: pass, drop, rate-limit, and
mirror.";
}
leaf egress-action {
type identityref {
base egress-action;
}
description
"Egress action: pass, drop, rate-limit, mirror,
invoke-signaling, tunnel-encapsulation, forwarding,
and redirection.";
}
leaf log-action {
type identityref {
base log-action;
}
description
"Log action: rule log and session log";
}
}
container flow-action {
description
"Action for flows";
reference
"RFC 8329: Framework for Interface to Network Security
Functions - I2NSF Flow Security Policy Structure
draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - Design Principles and
ECA Policy Model Overview";
leaf ingress-action {
type identityref {
base ingress-action;
}
description
"Action: pass, drop, rate-limit, and mirror.";
}
leaf egress-action {
type identityref {
base egress-action;
}
description
"Egress action: pass, drop, rate-limit, mirror,
invoke-signaling, tunnel-encapsulation, forwarding,
and redirection.";
}
leaf log-action {
type identityref {
base log-action;
}
description
"Log action: rule log and session log";
}
}
container advanced-action {
description
"If the packet needs to be additionally inspected,
the packet is passed to advanced network
security functions according to the profile.
The profile means the types of NSFs where the packet
will be forwarded in order to additionally
inspect the packet.
The advanced action activates Service Function
Chaining (SFC) for further inspection of a packet.";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - YANG Tree
Diagram";
leaf-list content-security-control {
type identityref {
base content-security-control;
}
description
"Content-security-control is the NSFs that
inspect the payload of the packet.
The profile for the types of NSFs for mitigation is
divided into content security control and
attack-mitigation-control.
Content security control: ips, url filtering,
anti-virus, and voip-volte-filter. This can be
extended according to the provided NSFs.";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - YANG Tree Diagram";
}
leaf-list attack-mitigation-control {
type identityref {
base attack-mitigation-control;
}
description
"Attack-mitigation-control is the NSFs that weaken
the attacks related to a denial of service
and reconnaissance.
The profile for the types of NSFs for mitigation is
divided into content security control and
attack-mitigation-control.
Attack mitigation control: Anti-DDoS or DDoS
mitigator. This can be extended according to the
provided NSFs such as mitigators for ip sweep,
port scanning, ping of death, teardrop, oversized
icmp, and tracert.";
reference
"draft-ietf-i2nsf-capability-data-model-17:
I2NSF Capability YANG Data Model - YANG Tree Diagram";
}
}
}
}
container rule-group {
description
"This is rule group";
list groups {
key "group-name";
description
"This is a group for rules";
leaf group-name {
type string;
description
"This is a group for rules";
}
container rule-range {
description
"This is a rule range.";
leaf start-rule {
type string;
description
"This is a start rule";
}
leaf end-rule {
type string;
description
"This is a end rule";
}
}
leaf enable {
type boolean;
description
"This is enable
False is not enable.";
}
leaf description {
type string;
description
"This is a description for rule-group";
}
}
}
}
}
<CODE ENDS>