From: Georgy Bystrenin <gkot@basealt.ru>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: [devel] mode = host в alterator-net-iptables
Date: Thu, 21 May 2020 02:40:30 +0400
Message-ID: <CAHOrsKjN8uhv9qp=tjxEDBmGo-cswRcTDUHy5HcPffhT2BTuAA@mail.gmail.com> (raw)
В процессе обдумывания реализации групповой политики для решения
кейса: Применение групповой политики по открытию ip-порта; наткнулись
на проблему описанную в баге -
https://bugzilla.altlinux.org/show_bug.cgi?id=38505
(через модуль alterator-net-iptables невозможно для всех интерфейсов
открыть или закрыть порт, в случае если из список не передать
параметром альтератору).
Было придумано такое решение: добавляем новый режим Хост (mode = host).
В этом режиме внешними ($external_ifaces или параметр -e)
автоматически выбираются все интерфейсы, кроме lo и специальных
исключений (virbr *, docker *).
Значит мы теперь можем просто:
$ sudo alterator-cmdline /net-iptables ipv 4 status '#t' commit on
action write mode host opened_tcp_ports 15001 opened_udp_ports 15002
opened_services ssh
Прочитаем наши настройки:
$ sudo alterator-cmdline /net-iptables ipv 4 action read
ipv:4
commit_mode:#t
status:#t
external_ifaces:eth0;wlan0; <--- авто выбрались ethernet и wereless
интерфейсы ноутбука
opened_services:ssh
opened_tcp_ports:15001
opened_udp_ports:15002
mode:host
А также iptabless теперь выглядит так:
$ sudo iptables -L INPUT -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP all -f 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate
RELATED,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:22
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:15001
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:15002
DROP all -- 0.0.0.0/0 0.0.0.0/0
Таска (карман) с изменениями 251975
для теста надо обновить пакеты
# apt-get install alterator-net-iptables alterator-l10n
В фротенд acc и web-версию изменения тоже внесены (раздел Брандмауер -
Внешние сети)
Код http://git.altlinux.org/people/gkot/packages/alterator-net-iptables.git
P.s.: Прошу апрув на таску 251975 если замечаний.
----
С Уважением, Georgy gkot Bystrenin
next reply other threads:[~2020-05-20 22:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 22:40 Georgy Bystrenin [this message]
2020-05-21 10:14 ` Michael Shigorin
2020-05-21 13:21 ` Sergei Epiphanov
2020-05-21 13:32 ` Dmitry V. Levin
2020-05-21 13:34 ` Georgy Bystrenin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHOrsKjN8uhv9qp=tjxEDBmGo-cswRcTDUHy5HcPffhT2BTuAA@mail.gmail.com' \
--to=gkot@basealt.ru \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git