본문 바로가기

IT 이야기/방화벽(VPN)

[Juniper] SRX_ssh Attack Block

728x90
반응형

***. Juniper SRX 방화벽에서 인가되지 않은 IP 로부터의 ssh 접근을 차단하기 위한 Config 입니다.

 

 

[1단계] SSH 접근을 허용한 IP List 를 정의합니다.

admin@VPN_1# show policy-options

prefix-list SSH_IP {

    10.10.10.0/24;

}

 

[2단계] 방화벽 접근 룰을 생성합니다.

{primary:node0}[edit]

admin@VPN_1# show firewall

family inet {

    filter sshFilter {        <-- 임의의 이름 "sshFilter" 라는 Policy 생성

        term Trust_SSH_Login {

            from {

                source-prefix-list {

                    SSH_IP;           <-- 1단계에서 접근허용한 IP

                }

                protocol tcp;

                destination-port ssh;

            }

            then accept;

        }

        term Reject_unknown_SSH {      <--  "SSH_IP" 외 모든 IP 는 discard 시킴

            from {

                source-address {

                    0.0.0.0/0;

                }

                destination-port ssh;

            }

            then {

                discard;

            }

        }

        term allow {

            then accept;

        }

    }

}

 

[3단계] 생성된 방화벽 룰을 인터페이스에 적용합니다.

{primary:node0}[edit]

admin@VPN_1# show interfaces reth0

description "#### untrust ####";

redundant-ether-options {

    redundancy-group 1;

}

unit 0 {

    family inet {

        filter {

            input sshFilter;

        }

        address 111.177.188.155/28;

    }

}

 

{primary:node0}[edit]

 

 

728x90
반응형