Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iprep
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ai3
tools
iprep
Commits
0a200936
Commit
0a200936
authored
5 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Add some documentation on external sources
parent
289f0292
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+28
-3
28 additions, 3 deletions
README.md
ext/ext.go
+1
-1
1 addition, 1 deletion
ext/ext.go
with
29 additions
and
4 deletions
README.md
+
28
−
3
View file @
0a200936
...
...
@@ -39,7 +39,32 @@ submission and querying. The query API is a simple IP lookup,
returning a score. This conceivably could be turned into a DNS-based
API as well.
##
Third-party
sources
##
External
sources
It would be nice to allow the scoring script to consult other IP-based
third-party sources, such as DNSBLs, or GeoIP lookups, etc.
The scoring script can consult other IP-based third-party sources, such
as DNSBLs, or GeoIP lookups, etc.
These are configured via YAML snippets in a directory, each file
corresponding to a separate external source.
Each source configuration should specify the following parameters:
*
*name*
, the name of the source
*
*type*
, one of the supported source types (either
*dnsbl*
or
*geoip*
at the moment)
*
*params*
, a dictionary of further type-specific configuration
parameters.
The parameters for
*dnsbl*
source type are:
*
*domain*
, the DNSBL domain to query
*
*match*
, a regexp pattern for the DNS query result. The default is
".
*
", i.e. any result will be regarded as a positive match.
The parameters for
*geoip*
source type are:
*
*paths*
, a list of paths to MaxMind GeoIP databases. The default
list contains a single path, /var/lib/GeoIP/GeoLite2-Country.mmdb
External sources can be used in the scoring script by calling the
*ext()*
function, with the source name and IP address as parameters.
This diff is collapsed.
Click to expand it.
ext/ext.go
+
1
−
1
View file @
0a200936
...
...
@@ -29,7 +29,7 @@ func New(sourceType string, params map[string]interface{}) (ExternalSource, erro
}
match
,
ok
:=
params
[
"match"
]
.
(
string
)
if
!
ok
{
return
nil
,
errors
.
New
(
"missing parameter 'match'"
)
match
=
".*"
}
return
dnsbl
.
New
(
domain
,
match
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment