Типы правил

ID статьи: 1548
Последнее обновление: 03 окт, 2024
Product: NGFW
Version: 7.1.x

Правила контентной фильтрации

Префиксы

Имя

Описание

PASS

Разрешение посещения.

DENY

Блокировка веб-страницы.

WARNING

Предупреждение пользователя о том, что страница нежелательна для посещения.

Условия

src.zonesrc.geoipsrc.ip

dst.zonedst.geoipdst.ip.

categorymorphologyscenario, timeurluser.

request.header.Referer — Список URL, в котором указаны рефереры для текущей страницы.
request.header.User-Agent — Useragent пользовательских браузеров.
response.header.Content-Type — Списки типов контента.
http.method — Метод, используемый в HTTP-запросах.

Свойства

namedescenabledrule_logvirus_heuristic.

Пример

[content "Content Rules"]
 % ----------------- 1 --- "Content Rules" --------------
PASS \
    url = lib.url("Education institutions") \
    src.zone = Trusted \
    desc("Content filtering rule which allows access to the list of URLs. This is an example rule which can be changed or deleted if necessary.") \
    rule_log(yes) \
    enabled(true) \
    name("Example white list")
% ----------------- 2 --- "Content Rules" --------------
DENY("Blockpage (EN)") \
    url = lib.url("Education institutions") \
    dst.zone = Untrusted \
    rule_log(yes) \
    enabled(false) \
    name("Example block RU RKN by URL list")
% ----------------- 3 --- "Content Rules" --------------
DENY \
    url = lib.network("Private IPs") \
    morphology = lib.morphology(Drugs) \
    src.zone = Trusted \
    time = lib.time(Weekdays) \
    rule_log(yes) \
    redirect(302, "https://bing.com") \
    enabled(false) \
    name("Example redirect to safesearch engines")

Правила межсетевого экрана

Префиксы

Имя

Описание

PASS

Разрешение трафика.

DENY

Блокировка трафика.

Условия

src.zonesrc.geoipsrc.ip.

dst.zonedst.geoipdst.ip.

servicescenariotimeurluser, hip_profile.

Свойства

namedescenabledrule_logreject_withips_profilel7_profile.

Пример

[firewall "Firewall rules"]
% ----------------- 1 -----------------
DENY \
    scenario = "Example torrent detection scenario" \
    dst.zone = Untrusted \
    dst.ip = lib.network("Botnets IP list") \
    rule_log(session) \
    reject_with("host-unreach") \
    enabled(true) \
    name("Example block RU RKN by IP list")
% ----------------- 2 -----------------
PASS \
    scenario = "Example torrent detection scenario" \
    src.zone = Trusted \
    dst.zone = Untrusted \
    hip_profile = "HIP profile" \
    ips_profile("Default IDPS profile") \
    l7_profile("Pass all applications") \
    rule_log(yes, "3/h", 5) \
    enabled(true) \
    name("Allow trusted to untrusted")

Правила NAT и маршрутизации

Префиксы

Имя

Описание

OK

Всегда ОК.

Тип правила определяется действием (Action):

  • nat — правило NAT;
  • dnat — правило DNAT;
  • port_mapping — правило порт-форвардинга;
  • netmap — правило Network mapping;
  • route — правило policy-based.

Условия

src.zonesrc.geoipsrc.ipsrc.mac.

dst.zonedst.geoipdst.ip.

servicescenariotimeurluser.

Свойства

namedescenabledrule_logdirectiontarget_iptarget_snatsnat_target_ipport_mapgateway.

Пример

[nat_routing "NAT and Routing Rules"]
% ----------------- 1 -----------------
OK \
    src.zone = Trusted \
    service = (HTTP, HTTPS) \
    snat_target_ip("192.168.13.210") \
    rule_log(session) \
    enabled(true) \
    name("NAT Rule")\
    nat
% ----------------- 2 -----------------
OK \
    src.zone = Management \
    dst.ip = (lib.network("Private IPs"), lib.url("Microsoft Windows Internet checker")) \
    target_ip("171.168.1.1") \
    target_snat(yes) \
    snat_target_ip("192.168.1.1") \
    enabled(true) \
    name("DNAY Rule")\
    dnat
% ----------------- 3 -----------------
OK \
    target_ip("172.168.1.1") \
    snat_target_ip("192.168.1.1") \
    port_map(tcp, 2000, 2000) \
    enabled(true) \
    name("Port-forwarding Rule")\
    port_mapping
% ----------------- 4 -----------------
OK \
    user = example \
    scenario = "Example torrent detection scenario" \
    gateway(My) \
    enabled(true) \
    name("Policy-base Rule")\
    route
% ----------------- 5 -----------------
OK \
    dst.geoip = (RW, SO) \
    target_ip("172.168.1.1") \
    direction(input) \
    enabled(true) \
    name("Network mapping Rule")\
    netmap

Правила Captive-портала

Префиксы

Имя

Описание

PASS

Не использовать аутентификацию.

OK

Использовать Captive-профиль.

Условия

src.zonesrc.geoipsrc.ip.

dst.zonedst.geoipdst.ip.

timeurlcategory.

Свойства

namedescenabledrule_logprofile.

Пример

[captive "Captive Rules"]
% ----------------- 1 -----------------
PASS \
    category = lib.category(Threats) \
    url = lib.url("Microsoft Windows Internet checker") \
    time = lib.time(Weekends) \
    rule_log(yes) \
    enabled(true) \
    name("Skip auth for Microsoft Internet checker")
% ----------------- 2 -----------------
OK \
    src.zone = Trusted \
    profile("Example Captive profile") \
    enabled(true) \
    name("Example Captive portal")

Правила инспектирования SSL

Префиксы

Имя

Описание

PASS

Не расшифровывать передаваемые данные.

OK

Расшифровать передаваемые данные.

Пересылка определяется действием (Action):

  • forward — в случае успешной расшифровки трафика SSL/TLS копия трафика будет переслана в соответствии с правилом и профилем инспектирования SSL (ssl_forward_profile).

Условия

src.zonesrc.geoipsrc.ip,

dst.geoipdst.ip,

timeserviceusercategory.

Свойства

namedescenabledrule_logssl_profilessl_forward_profile.

block_invalid_certcheck_revoc_certblock_expired_certblock_self_signed_cert.

Пример

[ssl "Decrypt Rules"]
% ----------------- 1 -----------------
PASS \
    category = (Finance, "Information Security") \
    rule_log(yes) \
    ssl_profile("Default SSL profile") \
    enabled(false) \
    name("Example DO NOT Decrypt rule for Finance and Security sites")
% ----------------- 2 -----------------
OK \
    category = lib.category(Threats) \
    rule_log(yes) \
    block_invalid_cert(yes) \
    check_revoc_cert(yes) \
    block_expired_cert(yes) \
    block_self_signed_cert(yes) \
    ssl_profile("Default SSL profile") \
    enabled(false) \
    name("Example decrypt rule for parental control")
% ----------------- 3 -----------------
OK \
    url = lib.url("Default SSL profile") \
    rule_log(yes) \
    ssl_profile("Default SSL profile") \
    ssl_forward_profile("SSL forward profile") \
    enabled(false) \
    name("Example decrypt RU RKN")\
    forward

Правила инспектирования SSH

Префиксы

Имя

Описание

PASS

Не расшифровывать передаваемые данные.

OK

Расшифровать передаваемые данные.

Условия

src.zonesrc.geoipsrc.ip,

dst.geoipdst.ip,

timeserviceuser.

Свойства

namedescenabledrule_log,

block_ssh_shellblock_ssh_execblock_sftpssh_command.

Пример

[ssh "SSH inspection Rules"]
% ----------------- 1 -----------------
PASS \
    service = "Any UDP" \
    rule_log(yes) \
    enabled(true) \
    name("Bypass Rule")
% ----------------- 2 -----------------
OK \
    service = IMAP \
    block_ssh_shell(yes) \
    block_ssh_exec(yes) \
    block_sftp(yes) \
    ssh_command("command") \
    rule_log(yes) \
    enabled(true) \
    name("Decrypy Rule")

DNS-правила

Префиксы

Имя

Описание

OK

Всегда OK.

Условия

url.domain.

Свойства

namedescenableddns_server.

Пример

[dns "DNS Rules"]
% ----------------- 1 -----------------
OK \
    url.domain = "*.example.com" \
    dns_server(1.2.3.4) \
    enabled(true) \
    name("Dns rule")

DoS-правила

Префиксы

Имя

Описание

PASS

Разрешение трафика.

DENY

Безусловная блокировка трафика.

WARNING

Применение профиля защиты от DoS-атак.

Условия

src.zonesrc.geoipsrc.ip,

dst.zonedst.geoipdst.ip.

timeserviceuser, scenario

Свойства

namedescenabledrule_logprofile.

Пример

[dos "DoS Rules"]
% ----------------- 1 -----------------
PASS \
    scenario = "Example torrent detection scenario" \
    user = example \
    src.ip = lib.url("Microsoft Windows Internet checker") \
    dst.geoip = RW \
    service = FTP \
    rule_log(session) \
    enabled(true) \
    name("DoS Allow Rule")
% ----------------- 2 -----------------
DENY \
    desc(api_dos_rule) \
    rule_log(yes, "3/h", 5) \
    enabled(true) \
    name("DoS Deny Rule")
% ----------------- 3 -----------------
WARNING \
    user = "CN=VPN users,DC=LOCAL" \
    time = lib.time("Working hours") \
    profile("DoS Profile") \
    enabled(false) \
    name("DoS Protect Rule")

ICAP-правила

Префиксы

Имя

Описание

PASS

Пропуск. Не посылать данные на ICAP-сервер.

OK

Пересылка данных на ICAP-сервер.

Действие (Action):

  • ignore — игнорировать ответ от ICAP-сервера.

Условия

src.zonesrc.geoipsrc.ip.

dst.zonedst.geoipdst.ip.

urlcategoryuserservice, http.methodresponse.header.Content-Type.

Свойства

namedescenabledrule_logprofile.

Пример

[dos "DoS Rules"]
% ----------------- 1 -----------------
PASS \
    scenario = "Example torrent detection scenario" \
    user = example \
    src.ip = lib.url("Microsoft Windows Internet checker") \
    dst.geoip = RW \
    service = FTP \
    rule_log(session) \
    enabled(true) \
    name("DoS Allow Rule")
% ----------------- 2 -----------------
DENY \
    desc(api_dos_rule) \
    rule_log(yes, "3/h", 5) \
    enabled(true) \
    name("DoS Deny Rule")
% ----------------- 3 -----------------
WARNING \
    user = "CN=VPN users,DC=LOCAL" \
    time = lib.time("Working hours") \
    profile("DoS Profile") \
    enabled(false) \
    name("DoS Protect Rule")

Правила защиты почтового трафика

Префиксы

Имя

Описание

PASS

Пропуск трафика без изменений.

DENY ("with error")

Блокировка письма, при этом сообщается об ошибке доставки письма на сервер.

DENY

Блокировка письма без уведомления о блокировке.

WARNING

Маркировка почтовых сообщений.

Условия

src.zonesrc.geoipsrc.ip.

dst.zonedst.geoipdst.ip.

userservice, envelope_from, envelope_to.

Свойства

namedescenabledrule_logmark_hdrmarkantispam_usergatednsbl.

Пример

[mailsecurity "Mail Security Rules"]
% ----------------- 1 -----------------
PASS \
    user = (example, "CN=VPN users,DC=LOCAL") \
    envelope_from = "Email froup from" \
    envelope_to = "Email froup to" \
    service = SMTP \
    rule_log(yes) \
    mark_hdr(Subject) \
    enabled(true) \
    name("Mail Pass Rule")
% ----------------- 2 -----------------
DENY("with error") \
    service = (SMTPS, SMTP) \
    rule_log(yes) \
    mark_hdr(Subject) \
    antispam_usergate(yes) \
    enabled(true) \
    name("Mail Drop Rule")
% ----------------- 3 -----------------
DENY \
    src.zone = Untrusted \
    service = SMTP \
    mark_hdr(Subject) \
    dnsbl(yes) \
    enabled(false) \
    name("DNSBL spam drop rule")
% ----------------- 4 -----------------
WARNING \
    src.zone = Untrusted \
    service = (SMTP, POP3, SMTPS, POP3S) \
    mark_hdr(Subject) \
    mark("[SPAM]") \
    antispam_usergate(yes) \
    enabled(false) \
    name("SMTP and POP3 filtering")

Правила reverse-прокси

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

src.zonesrc.geoipsrc.ipsrc.mac.

dst.zonedst.geoipdst.ip.

user, request.header.User-Agenturl.port.

Свойства

namedescenabledrule_logprofile, certificatecert_auth_enabledis_httpsssl_profilewaf_profilerewrite_path.

Пример

[reverseproxy "Reverse proxy Rules"]
% ----------------- 1 -----------------
OK \
    url.port = 80 \
    src.zone = Untrusted \
    desc("Example reverse proxy rule. This is an example rule which can be changed or deleted if necessary. ") \
    profile("Example reverse proxy server") \
    rewrite_path("example.com/path1", "example.local/path1") \
    waf_profile("Example WAF profile") \
    enabled(true) \
    name("Example reverse proxy rule")

Правила веб-безопасности

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

src.zonesrc.geoipsrc.ipsrc.mac.

dst.zonedst.geoipdst.ip.

timeuser,

Свойства

namedescenabledrule_log.

enable_adblocksafe_searchsearch_history_loggingsocial_sites_blockenable_injectorcustom_injectorurl_list_exclusions.

Пример

[safebrowsing "Safe browsing Rules"]
% ----------------- 1 -----------------
OK \
    rule_log(yes) \
    enable_adblock(yes) \
    safe_search(yes) \
    search_history_logging(yes) \
    social_sites_block(yes) \
    enable_injector(yes) \
    custom_injector(code) \
    url_list_exclusions(FISHING_BLACK_LIST) \
    desc("Safebrowsing rule for all users. This is an example rule which can be changed or deleted if necessary.") \
    enabled(false) \
    name("Example safebrowsing")

Правила пропускной способности

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

src.zonesrc.geoipsrc.ipsrc.mac.

dst.zonedst.geoipdst.ip.

timeuser applicationservicescenario,

Свойства

namedescenabledrule_logbandwidth_pool.

Пример

[shaper "Shaper Rules"]
% ----------------- 1 -----------------
OK \
    scenario = "Example torrent detection scenario" \
    service = "HTTP Proxy" \
    rule_log(session) \
    bandwidth_pool("1 Mbps") \
    enabled(true) \
    name("Example Bandwidth rule")
% ----------------- 2 -----------------
OK \
    scenario = "Example torrent detection scenario" \
    src.zone = Trusted \
    application = lib.category("Coin Miners", Business) \
    rule_log(yes, "3/h", 5) \
    bandwidth_pool("100 Kbps") \
    enabled(true) \
    name("Example torrent shaper")

Правила инспектирования туннелей

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

src.zonesrc.geoipsrc.ipsrc.mac.

dst.zonedst.geoipdst.ip.

service.

Свойства

namedescenabled.

Пример

[tunnel "Tunnel inspection Rules"]
% ----------------- 1 -----------------
PASS \
    src.zone = Trusted \
    dst.zone = Untrusted \
    service = gre \
    enabled(true) \
    name("Example Tonnel Incpection Bypass rule")
% ----------------- 2 -----------------
OK \
    dst.geoip = YE \
    service = gtpu \
    enabled(true) \
    name("Example Tonnel Incpection Rule")

Правила веб-портала

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

urluser, url.domain.

Свойства

namedescenabled.

iconssl_profilecertificateadditional_urlrdp_check_session_alivetransparent_auth.

Пример

[webportal "Web portal Rules"]
% ----------------- 1 -----------------
OK \
    user = "CN=Default Group,DC=LOCAL" \
    url = "http://www.intranet.loc" \
    icon("default.svg") \
    rdp_check_session_alive(yes) \
    transparent_auth(yes) \
    certificate("CA (Default)") \
    ssl_profile("Default SSL profile") \
    enabled(false) \
    name("Example http application published via web portal")

Правила VPN-сервера

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

src.zonesrc.geoipsrc.ipsrc.mac.

dst.geoipdst.ip.

user,

Свойства

namedescenabled.

profileauth_profilevpn_networkinterface.

Пример


[vpn_server "VPN server Rules"]
% ----------------- 1 -----------------
OK \
    user = "CN=VPN users,DC=LOCAL" \
    src.zone = Untrusted \
    profile("Remote access VPN profile") \
    auth_profile("Example user auth profile") \
    vpn_network("Remote access VPN network") \
    interface(tunnel1) \
    enabled(false) \
    name("Remote access VPN rule")

Правила VPN-клиента

Префиксы

Имя

Описание

OK

Всегда ОК.

Свойства

namedescenabled.

profileinterface, server_address.

last_errorstatusconnection_time — информационные поля, недоступные для редактирования.

Пример

[vpn_client "VPN client Rules"]
% ----------------- 1 -----------------
OK \
    server_address("10.10.10.10") \
    last_error(Disabled) \
    status(disconnected) \
    connection_time(0) \
    profile("Client VPN profile") \
    interface(tunnel3) \
    enabled(true) \
    name("Client VPN rule")

Правила сценариев

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

scenario_cond.

Свойства

namedescenabled.

operation_modetriggerduration.

Условия сценария

Категория URL (url_category)

Условия

category

Свойства

count_intervalmax_event_countscond_type

Обнаружение вируса (virus_detection)

Свойства

scond_type

Приложение (app)

Условия

application

Свойства

count_intervalmax_event_countscond_type

СОВ  (ips)

Свойства

ips_tlscond_type

Тип котента (mime_type)

Условия

response.header.Content-Type

Свойства

count_intervalmax_event_countscond_type

Размер пакета  (net_packet_size)

Свойства

packet_sizescond_type

Сессий c одного IP  (sessions_per_ip)

Свойства

sessions_limitscond_type

Объем трафика  (traffic)

Свойства

traffic_limitperiodscond_type

Проверка состояния (health_check)

Условия

url.addressurl.domain

Свойства

health_check_methodhealth_resulthealth_request_timeouthealth_type_requesthealth_answer_timeout

count_intervalmax_event_countscond_type

Пример


[scenarios "Scenario Rules"]
% ----------------- 1 -----------------
def scenario_cond example_scenario_define
    category = (lib.category(Threats), "Advertisements & Pop-Ups") count_interval(10) max_event_count(3) scond_type(url_category)
    scond_type(virus_detection)
    application = lib.category(Threats) count_interval(2) max_event_count(1) scond_type(app)
    ips_tl(medium) scond_type(ips)
    response.header.Content-Type = lib.mime("Java script") count_interval(0) max_event_count(0) scond_type(mime_type)
    packet_size(200MB) scond_type(net_packet_size)
    sessions_limit(50) scond_type(sessions_per_ip)
    traffic_limit(2GB) period(hour) scond_type(traffic)
    url.address = "192.168.100.100" url.domain = "example.com" health_check_method(dns) \
        health_result(negative) health_request_timeout(4) health_type_request(a) \
        count_interval(5) max_event_count(3) scond_type(health_check)
    url.domain = "example.com" health_check_method(get) \
        health_result(negative) health_request_timeout(5) health_answer_timeout(10) \
        count_interval(0) max_event_count(0) scond_type(health_check)
end
OK \
    scenario_cond = example_scenario_define \
    operation_mode(all) \
    trigger(one_user) \
    duration(5) \
    enabled(false) \
    name("Example torrent detection scenario")

Правила балансировки нагрузки TCP/UDP

Префиксы

Имя

Описание

OK

Всегда ОК.

Условия

src.zonesrc.geoipsrc.ipsrc.mac.

service, url.addressurl.port.

Свойства

namedescenabled.

schedulerreal_serveripvs_fallback

monitor_kindmonitor_servicemonitor_requestmonitor_responsemonitor_intervalmonitor_timeoutmonitor_failurecount

Пример

[ipvs_server "TCP/UDP load balancing Rules"]
% ----------------- 1 -----------------
OK \
    src.geoip = RW \
    url.address = 192.168.1.100 \
    url.port = 80 \
    service = tcp \
    scheduler(rr) \
    real_server(gate, 1.1.1.1:80, 50) \
    ipvs_fallback(masq_snat, 8.8.8.8:10000) \
    monitor_kind(negotiate) \
    monitor_service(http) \
    monitor_request("example.com") \
    monitor_interval(60) \
    monitor_timeout(60) \
    monitor_failurecount(10) \
    enabled(true) \
    name("TCP load balancing")

Правила балансировки ICAP

Префиксы

Имя

Описание

OK

Всегда ОК.

Свойства

namedescenabled, profile.

Пример

[icap_balancing "ICAP load balancing Rules"]
% ----------------- 1 -----------------
OK \
    profile("Example ICAP server") \
    enabled(true) \
    name("ICAP load balancing")

Правила балансировки reverse-прокси

Префиксы

Имя

Описание

OK

Всегда ОК.

Свойства

namedescenabled, profile.

Пример

[reverseproxy_balancing "Reverse proxy load balancing Rules"]
% ----------------- 1 -----------------
OK \
    profile("Example reverse proxy server") \
    enabled(true) \
    name("Reverse-proxy load balancing")

Эта статья была:   Полезна | Не полезна
Сообщить об ошибке
ID статьи: 1548
Последнее обновление: 03 окт, 2024
Ревизия: 31
Просмотры: 97
Комментарии: 0
Теги