domainfilter

package
v0.0.0-...-56e3cfe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: EUPL-1.2 Imports: 11 Imported by: 0

README

domainfilter

Name

domainfilter - filters domains via eBlocker's ICAP server.

Description

The domainfilter plugin asks eBlocker's ICAP server whether a given domain is blocked for a specific client. The client's IP address is transmitted to the server. If the domain is blocked, the server returns the ID of the blocking list and the IPv4 address to return to the client.

If the domain is not blocked, the request is passed to the next plugin in the chain.

If the ICAP server's domain filter returns an error, the blocking behaviour depends on the configured default action:

  • allow passes the request to the next plugin
  • deny returns the default access denied IP 169.254.93.109.

If a domain is blocked and the requested type is not A (for example AAAA), an empty response is returned.

Syntax

domainfilter HOST:PORT DEFAULT_ACTION
  • HOST the address of the ICAP server's domain filter. Usually this is localhost.
  • PORT the UDP port to connect to. Usually this is 7777.
  • DEFAULT_ACTION the action to take in case of an error: allow or deny.

Examples

Send domain filter requests to UDP port 7777 at localhost:

. {
    domainfilter localhost:7777 allow
}

Allow a domain in case of an error.

Metadata

The plugin will publish the following metadata, if the metadata plugin is also enabled:

  • domainfilter/blockedbylist: the domain in the query was blocked by the given list

See also

Messages are defined by the Squid ACL helper API.

The plugin communicates with the ICAP server's request handler.

Documentation

Overview

* Copyright 2024 eBlocker Open Source UG (haftungsbeschraenkt) * * Licensed under the EUPL, Version 1.2 or - as soon they will be * approved by the European Commission - subsequent versions of the EUPL * (the "License"); You may not use this work except in compliance with * the License. You may obtain a copy of the License at: * * https://joinup.ec.europa.eu/page/eupl-text-11-12 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License.

* Copyright 2024 eBlocker Open Source UG (haftungsbeschraenkt) * * Licensed under the EUPL, Version 1.2 or - as soon they will be * approved by the European Commission - subsequent versions of the EUPL * (the "License"); You may not use this work except in compliance with * the License. You may obtain a copy of the License at: * * https://joinup.ec.europa.eu/page/eupl-text-11-12 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainFilter

type DomainFilter struct {
	Next           plugin.Handler
	ServiceAddress string       // usually "localhost:7777"
	ActionOnError  string       // "allow" or "deny" if filter service is not available
	UDPAddr        *net.UDPAddr // resolved service address
}

Domainfilter represents the plugin's configuration.

func NewDomainFilter

func NewDomainFilter(next plugin.Handler, serviceAddress string, actionOnError string) *DomainFilter

NewDomainFilter creates a DomainFilter.

func (*DomainFilter) Name

func (df *DomainFilter) Name() string

Name implements plugin.Handler.

func (*DomainFilter) ServeDNS

func (df *DomainFilter) ServeDNS(ctx context.Context, writer dns.ResponseWriter, req *dns.Msg) (int, error)

ServeDNS implements plugin.Handler.

type FilterResult

type FilterResult struct {
	// contains filtered or unexported fields
}

FilterResult represents the answer returned by the domain filter service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳