
Bluewall은 공격 및 방어 사이버 전문가를 위해 설계된 방화벽 프레임워크입니다.

Bluewall은 공격 및 방어 사이버 전문가를 위해 설계된 방화벽 프레임워크입니다. 이 프레임워크를 통해 사이버보안 전문가는 자신의 범위를 벗어나지 않으면서 환경을 신속하게 설정할 수 있습니다.
Andrew Benson의 hostfw iptable 생성 스크립트에서 영감을 받았습니다.
* 방화벽 구성
* 호스트 이름 구성
* 인터페이스 구성
* Redhat/CentOS
* Windows 구성은 생성할 수 있지만 실행할 수는 없습니다.
* bluewall -c config/example.ini
** 예제 구성 참조
* Enumerate - 네트워크 내 활성 호스트 식별 (출시 예정)
* 대상 호스트 - 아웃바운드 통신
* 신뢰 호스트 - 양방향 통신
* No Strike - 컴퓨터가 통신하지 않아야 하는 장치
# BUILT FOR PYTHON 2.x
sudo python setup.py install
sudo bluewall -h (도움말)
# 구성 파일을 사용하여 초기 환경 설정
sudo bluewall -c config/hostconfig.ini
# 선택적 Windows 구성 내보내기
sudo bluewall -c config/hostconfig.ini -w autoconfig.ps1
# 추가 수신 호스트 또는 범위 추가
sudo bluewall -ih 192.168.0.3,192.168.1.0/24
# 통신에서 제외할 호스트
sudo bluewall -eh 192.168.1.1
# 매우 쉬운 마법사 모드
sudo bluewall --wizard
usage: bluewall [-h] [-V] [-v] [-r] [-p] [-i] [-d] [-w WINDOWS_CONFIG]
[-ot TCP_PORTS_OUT] [-ou UDP_PORTS_OUT] [-it TCP_PORTS_IN]
[-iu UDP_PORTS_IN] [-oh OUTBOUND_HOSTS] [-ih INBOUND_HOSTS]
[-eh EXCLUDE_HOSTS] [-l] [-s] [-q] [-D] [-A] [-F] [-S] [-c CONFIG]
[--info]
/////////////////////////////////////////////////////
| _____ __ _____ _____ _ _ _ _____ __ __ |
| | __ | | | | | __| | | | - | | | | |
| | __-| |__| | | __| | | | | |__| |__ |
| |_____|_____|_____|_____|_____|__|__|_____|_____| |
| |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
방화벽 설정을 자동화하는 Python 프레임워크입니다.
기본값:
아웃바운드 연결은 모든 포트에서 모든 호스트로 허용됩니다.
인바운드 연결은 관련 아웃바운드 트래픽으로 제한됩니다.
DHCP가 활성화됩니다.
Ping 응답이 활성화됩니다.
요청되지 않은 인바운드 연결은 드롭됩니다.
선택적 인수:
-h, --help 도움말 메시지를 표시하고 종료합니다.
-V, --version 버전 표시
-v, --verbose 자세한 모드
-r, --reset 패킷 드롭 대신 TCP RST 전송
-p, --disallow_ping 들어오는 PING 차단
-i, --allow_outbound_icmp
ICMP 유형 제한 안 함
-d, --disallow_dhcp DHCP 차단
-w WINDOWS_CONFIG, --windows_config WINDOWS_CONFIG
Windows 구성 생성. 사용법: bluewall -w config.ps1
-ot TCP_PORTS_OUT, --tcp_ports_out TCP_PORTS_OUT
허용된 아웃바운드 TCP 포트 목록 (쉼표로 구분)
-ou UDP_PORTS_OUT, --udp_ports_out UDP_PORTS_OUT
허용된 아웃바운드 UDP 포트 목록 (쉼표로 구분)
-it TCP_PORTS_IN, --tcp_ports_in TCP_PORTS_IN
허용된 인바운드 TCP 포트 목록 (쉼표로 구분)
-iu UDP_PORTS_IN, --udp_ports_in UDP_PORTS_IN
허용된 인바운드 UDP 포트 목록 (쉼표로 구분)
-oh OUTBOUND_HOSTS, --outbound_hosts OUTBOUND_HOSTS
아웃바운드를 지정된 호스트로 제한. -oh
192.168.3.0/24,192.168.4.0/24
-ih INBOUND_HOSTS, --inbound_hosts INBOUND_HOSTS
인바운드를 지정된 호스트로 제한. -ih
192.168.3.0/24,192.168.4.0/24
-eh EXCLUDE_HOSTS, --exclude_hosts EXCLUDE_HOSTS
호스트 제외 -eh 192.168.3.0/24
-l, --log_exceptions 예외 기록
-s, --simulate 시뮬레이션만 수행
-q, --quiet 조용히 실행 (상태 메시지 표시 안 함)
-D, --deny_all 모든 것 거부
-A, --allow_all 모든 것 허용
-F, --flush IPTables 플러시
-S, --show_rules 설정 후 규칙 표시
--wizard 주소 및 방화벽 마법사 모드
-c CONFIG, --config CONFIG
방화벽 구성
--info Bluewall 정보
example.ini
[local_config]
iface=em1
rh_host=RHEL-Example
rh_ipaddr=192.168.1.42
netmask=255.255.255.0
gateway_addr=172.16.63.1
dns=8.8.8.8
#win_ipaddr=192.168.1.42 - 선택적 Windows IP 주소
#
# 선택적 Windows 호스트 (Bluewall이 Windows용 구성 파일 생성)
win_host=WINExample
# MAC 주소는 대문자여야 함. 유효: AA:93:AB:EF:00:01
# rh_mac=*는 무작위 MAC 주소 생성
rh_mac=*
[firewall_config]
# 대상 범위는 아웃바운드 통신을 허용할 네트워크입니다.
target_range=172.16.63.0/24
target_range=192.168.2.0/24
#
# Nostrike 주소는 컴퓨터가 통신하지 않아야 하는 장치입니다.
nostrike=192.168.2.1
#
# 신뢰 범위는 양방향 통신을 원하는 네트워크입니다.
trusted_range=172.16.63.0/24
trusted_host=42.42.42.42
[ataylor@localhost bluewall]$ sudo bluewall -c configs/exampleconfig.ini
[OK] 192.168.1.101 is a valid setting for dns
[OK] 192.168.1.1 is a valid setting for gateway_addr
[OK] 24 is a valid setting for cidr_prefix
[OK] 192.168.1.254 is a valid setting for nostrike
[OK] * is a valid setting for rh_mac
[OK] WINtaylor is a valid setting for win_host
[OK] 192.168.2.0/24 is a valid setting for target_range
[OK] 192.168.3.0/24 is a valid setting for target_range
[OK] 192.168.1.30 is a valid setting for rh_ipaddr
[OK] RHEL-taylor is a valid setting for rh_host
[OK] 42.42.42.42 is a valid setting for trusted_host
[OK] 192.168.1.0/24 is a valid setting for trusted_range
[OK] 192.168.1.50 is a valid setting for win_ipaddr
==============================
[VALID CONFIG] No Errors Detected.
CONFIGURING
writing eth config to /etc/sysconfig/network-scripts/ifcfg-ens33
[CONFIGURATION]
TYPE="Ethernet"
BOOTPROTO=none
NAME=ens33
DEVICE="ens33"
ONBOOT=no
DEFROUTE="yes"
IPV4_FAILURE_FATAL=no
DNS1=192.168.1.101
IPADDR=192.168.1.30
PREFIX=24
GATEWAY=192.168.1.1
MACADDR=00:16:3E:52:7F:8D
[+] Interface ens33 shutdown.
[+] Restarting Network Service
[+] Interface ens33 brought up.
[+] Rules Flushed!
[+] Allowing outbound ICMP/traceroute to 192.168.2.0/24...
[+] Allowing outbound ICMP/traceroute to 192.168.3.0/24...
[+] Allowing outbound ICMP/traceroute to 192.168.1.0/24...
[+] Limiting outbound TCP connections to 192.168.2.0/24.
[+] Limiting outbound TCP connections to 192.168.3.0/24.
[+] Limiting outbound TCP connections to 192.168.1.0/24.
[+] Limiting outbound UDP connections to 192.168.2.0/24.
[+] Limiting outbound UDP connections to 192.168.3.0/24.
[+] Limiting outbound UDP connections to 192.168.1.0/24.
[+] Limiting inbound UDP connections to 192.168.1.0/24.
[+] Limiting inbound TCP connections to 192.168.1.0/24.
[+] Allowing traffic for localhost.
[+] 192.168.1.254 applied to NOSTRIKE
$ iptables -nvL
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * * 192.168.1.254 0.0.0.0/0
0 0 ACCEPT all -- * * 127.0.0.0/8 127.0.0.0/8
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.1.0/24
0 0 ACCEPT udp -- * * 0.0.0.0/0 192.168.1.0/24
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * * 0.0.0.0/0 192.168.1.254
0 0 ACCEPT all -- * * 127.0.0.0/8 127.0.0.0/8
0 0 ACCEPT udp -- * * 0.0.0.0/0 192.168.1.0/24
0 0 ACCEPT udp -- * * 0.0.0.0/0 192.168.3.0/24
0 0 ACCEPT udp -- * * 0.0.0.0/0 192.168.2.0/24
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.1.0/24
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.3.0/24
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.2.0/24
0 0 ACCEPT icmp -- * * 0.0.0.0/0 192.168.1.0/24 icmptype 0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 192.168.1.0/24 icmptype 8
0 0 ACCEPT icmp -- * * 0.0.0.0/0 192.168.3.0/24 icmptype 0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 192.168.3.0/24 icmptype 8
0 0 ACCEPT icmp -- * * 0.0.0.0/0 192.168.2.0/24 icmptype 0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 192.168.2.0/24 icmptype 8
[+] Setup Complete.