Log IP address that we're matching against allowFrom values stored in the DB (#46)
* Add logging for IP matching * Fix typo
This commit is contained in:
parent
11c852ee91
commit
9a908d7d6b
@ -5,6 +5,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/satori/go.uuid"
|
"github.com/satori/go.uuid"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ACMETxt is the default structure for the user controlled record
|
// ACMETxt is the default structure for the user controlled record
|
||||||
@ -47,6 +48,7 @@ func (a ACMETxt) allowedFrom(ip string) bool {
|
|||||||
if len(a.AllowFrom.ValidEntries()) == 0 {
|
if len(a.AllowFrom.ValidEntries()) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
log.WithFields(log.Fields{"ip": remoteIP}).Debug("Checking if update is permitted from IP")
|
||||||
for _, v := range a.AllowFrom.ValidEntries() {
|
for _, v := range a.AllowFrom.ValidEntries() {
|
||||||
_, vnet, _ := net.ParseCIDR(v)
|
_, vnet, _ := net.ParseCIDR(v)
|
||||||
if vnet.Contains(remoteIP) {
|
if vnet.Contains(remoteIP) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user