Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
184d5e52
Commit
184d5e52
authored
May 14, 2021
by
Keith Coleman
Committed by
GitHub
May 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for two days of remaining validity (#4606)
Signed-off-by:
Keith C
<
keith@fraudmarc.com
>
parent
7b43d042
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
plugin/dnssec/cache.go
plugin/dnssec/cache.go
+1
-1
plugin/dnssec/dnssec.go
plugin/dnssec/dnssec.go
+2
-2
No files found.
plugin/dnssec/cache.go
View file @
184d5e52
...
...
@@ -31,7 +31,7 @@ func periodicClean(c *cache.Cache, stop <-chan struct{}) {
case
<-
tick
.
C
:
// we sign for 8 days, check if a signature in the cache reached 75% of that (i.e. 6), if found delete
// the signature
is75
:=
time
.
Now
()
.
UTC
()
.
Add
(
six
Days
)
is75
:=
time
.
Now
()
.
UTC
()
.
Add
(
two
Days
)
c
.
Walk
(
func
(
items
map
[
uint64
]
interface
{},
key
uint64
)
bool
{
for
_
,
rr
:=
range
items
[
key
]
.
([]
dns
.
RR
)
{
if
!
rr
.
(
*
dns
.
RRSIG
)
.
ValidityPeriod
(
is75
)
{
...
...
plugin/dnssec/dnssec.go
View file @
184d5e52
...
...
@@ -131,7 +131,7 @@ func (d Dnssec) set(key uint64, sigs []dns.RR) { d.cache.Add(key, sigs) }
func
(
d
Dnssec
)
get
(
key
uint64
,
server
string
)
([]
dns
.
RR
,
bool
)
{
if
s
,
ok
:=
d
.
cache
.
Get
(
key
);
ok
{
// we sign for 8 days, check if a signature in the cache reached 3/4 of that
is75
:=
time
.
Now
()
.
UTC
()
.
Add
(
six
Days
)
is75
:=
time
.
Now
()
.
UTC
()
.
Add
(
two
Days
)
for
_
,
rr
:=
range
s
.
([]
dns
.
RR
)
{
if
!
rr
.
(
*
dns
.
RRSIG
)
.
ValidityPeriod
(
is75
)
{
cacheMisses
.
WithLabelValues
(
server
)
.
Inc
()
...
...
@@ -154,6 +154,6 @@ func incepExpir(now time.Time) (uint32, uint32) {
const
(
eightDays
=
8
*
24
*
time
.
Hour
sixDays
=
6
*
24
*
time
.
Hour
twoDays
=
2
*
24
*
time
.
Hour
defaultCap
=
10000
// default capacity of the cache.
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment