RPZ를 뷰와 아무런 효과 없이 바인딩합니다.

RPZ를 뷰와 아무런 효과 없이 바인딩합니다.

내부 사용자용과 외부(예: 인터넷)용의 두 가지 보기가 있는 DNS 서버가 있습니다. 내부 사용자가 샘플 웹사이트를 요청할 때(외부 재귀 쿼리는 거부됨) 다른 웹사이트(필터 페이지)로 리디렉션되어 이 웹사이트에 대한 액세스가 허용되지 않도록 RPZ를 구성하고 싶습니다. 그러나 RPZ는 작동하지 않습니다. bad.com에 대한 쿼리는 실제 주소를 반환합니다. 문제를 알 수 없습니다.

명명된.conf.옵션:

options {
    directory "/var/cache/bind";

    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

    // If your ISP provided one or more IP addresses for stable 
    // nameservers, you probably want to use them as forwarders.  
    // Uncomment the following block, and insert the addresses replacing 
    // the all-0's placeholder.

 forwarders {
    8.8.8.8;
 };


    response-policy {zone "filter" recursive-only no;};

    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys.  See https://www.isc.org/bind-keys
    //========================================================================
#   dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};

명명된.conf.local:

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";


acl internal {172.17.116/24; 192.168.20/24; 127/8;};

view "internal" {
    match-clients {internal;};
    recursion yes;
    zone "wsi.org" {
        type master;
        file "/etc/bind/internal.zone";
    };

    zone "filter" {
        type master;
        file "/etc/bind/filter.zone";
    };



    include "/etc/bind/named.conf.default-zones";
};

view "external" {
    match-clients {any;};
    recursion no;
    zone "wsi.org" {
        type master;
        file "/etc/bind/external.zone";
    };

    zone "filter" {
        type master;
        file "/etc/bind/filter2.zone";
    };


    include "/etc/bind/named.conf.default-zones";
};

필터.영역:

TTL 604800
@   IN  SOA wsi.org. root.wsi.org. (
                  3     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL

bad.com A   filter.wsi.org
bad.net A   filter.wsi.org

필터2 영역:

TTL 604800
@   IN  SOA wsi.org. root.wsi.org. (
                  3     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL

bad.com A   filter.wsi.org
bad.net CNAME   rpz-passthru

nslookupbad.net 및 bad.com의 실제 주소를 항상 표시합니다.

실험 중이었는데 두 개의 영역이 있는 이유입니다.

답변1

다음의 첫 번째 올바른 A 레코드:

bad.com A   filter.wsi.org 

에게:

bad.com A   192.168.1.1

또는 아래와 같이 변경하세요.

bad.com CNAME   filter.wsi.org

아래와 같이 구성을 테스트합니다.

response-policy {zone "filter";};

답변2

rpz 영역 파일에서 ns 레코드를 정의하지 않는 또 다른 문제를 발견했습니다.

@   NS    127.0.0.1.

구성 문제를 해결하려면 바인딩 도구를 사용하세요. 구성 구문을 확인하려면 다음을 수행하세요.

named-checkconf

영역 파일 구문을 확인하려면 다음을 수행하세요.

named-checkzone filter /etc/bind/filter.zone

바인딩이 오류 없이 실행되고 있는지 확인하려면 다음을 수행하세요.

netstat -lntup | grep 53

관련 정보