Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bind-dnssec
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Valentin Samir
bind-dnssec
Commits
4c472095
Commit
4c472095
authored
Sep 03, 2016
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lets -key print all DNSKEYS. We add -KSK and -ZSK options to print only theses keys
parent
6d0843b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
6 deletions
+27
-6
routine.py
routine.py
+27
-6
No files found.
routine.py
View file @
4c472095
...
...
@@ -191,9 +191,13 @@ class Zone(object):
p
=
subprocess
.
Popen
(
cmd
)
p
.
wait
()
def
key
(
self
):
def
key
(
self
,
show_ksk
=
False
,
show_zsk
=
False
):
if
show_ksk
:
for
ksk
in
self
.
KSK
:
print
ksk
if
show_zsk
:
for
zsk
in
self
.
ZSK
:
print
zsk
def
__init__
(
self
,
name
):
path
=
os
.
path
.
join
(
BASE
,
name
)
...
...
@@ -501,13 +505,23 @@ if __name__ == '__main__':
parser
.
add_argument
(
'-ds'
,
action
=
'store_true'
,
help
=
'Show DS for each supplied zone or for all zones if no zone supplied'
help
=
'Show
KSK
DS for each supplied zone or for all zones if no zone supplied'
)
parser
.
add_argument
(
'-key'
,
action
=
'store_true'
,
help
=
'Show DNSKEY for each zone supplied zone or for all zones if no zone supplied'
)
parser
.
add_argument
(
'-KSK'
,
action
=
'store_true'
,
help
=
'Show KSK DNSKEY for each zone supplied zone or for all zones if no zone supplied'
)
parser
.
add_argument
(
'-ZSK'
,
action
=
'store_true'
,
help
=
'Show ZSK DNSKEY for each zone supplied zone or for all zones if no zone supplied'
)
parser
.
add_argument
(
'--ds-seen'
,
metavar
=
'KEYID'
,
...
...
@@ -547,8 +561,15 @@ if __name__ == '__main__':
zone
.
ds
()
if
args
.
key
:
for
zone
in
zones
:
zone
.
key
()
if
not
any
([
args
.
make
,
args
.
cron
,
args
.
ds
,
args
.
key
,
args
.
ds_seen
,
args
.
nsec3
]):
zone
.
key
(
show_ksk
=
True
,
show_zsk
=
True
)
else
:
if
args
.
KSK
:
for
zone
in
zones
:
zone
.
key
(
show_ksk
=
True
)
if
args
.
ZSK
:
for
zone
in
zones
:
zone
.
key
(
show_zsk
=
True
)
if
not
any
([
args
.
make
,
args
.
cron
,
args
.
ds
,
args
.
key
,
args
.
ds_seen
,
args
.
nsec3
,
args
.
KSK
,
args
.
ZSK
]):
parser
.
print_help
()
except
ValueError
as
error
:
sys
.
stderr
.
write
(
"%s
\n
"
%
error
)
...
...
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