View | Details | Raw Unified | Return to bug 157245 | Differences between
and this patch

Collapse All | Expand All

(-)en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml (-2 / +321 lines)
Lines 3872-3877 Link Here
3872
    </sect2>
3872
    </sect2>
3873
3873
3874
    <sect2>
3874
    <sect2>
3875
      <title>DNSSEC</title>
3876
      <indexterm>
3877
        <primary>BIND</primary>
3878
        <secondary>DNS security extensions</secondary>
3879
      </indexterm>
3880
3881
      <para>Domain Name System Security Extensions, or <acronym>DNSSEC</acronym>
3882
	for short, is a suite of specifications to protect
3883
	<acronym>DNS</acronym> clients, i.e. Internet resolvers, from forged
3884
	<acronym>DNS</acronym> data, such as spoofed <acronym>DNS</acronym>
3885
	records.  By using digital signatures, a resolver can verify the
3886
	integrity and authenticity of the record.  Note that
3887
	<acronym>DNSSEC</acronym> only provides integrity, it does not
3888
	provide neither confidentiality nor protection against false
3889
	assumptions.  This meanins that it cannot protect against people going
3890
	to <hostid role="domainname">example.net</hostid> instead of
3891
	<hostid role="domainname">example.com</hostid>.  The only 
3892
	thing <acronym>DNSSEC</acronym> does is authenticate that the data is 
3893
	from the domain owner and that it has not been compromised in transit. 
3894
	The security of <acronym>DNS</acronym> is believed to be an important 
3895
	step in securing the Internet in general.  For a more in-depth 
3896
	details of how <acronym>DNSSEC</acronym> works, the relevant
3897
	<acronym>RFC</acronym>s are a good place to start.  See the list in
3898
	<xref linkend="dns-read">.
3899
3900
      <para>The next two sections will demonstrate how to enable
3901
	<acronym>DNSSEC</acronym> for an authoritative <acronym>DNS</acronym>
3902
	server and a recursive (or caching) <acronym>DNS</acronym> server
3903
	running <acronym>BIND</acronym>9.  While all versions of
3904
	<acronym>BIND</acronym>9 support <acronym>DNSSEC</acronym>, it is
3905
	necessary to have at least version 9.6.2 in order to be able to use the
3906
	signed root zone when validating <acronym>DNS</acronym> queries.  This is
3907
	because earlier versions lack the required algorithms to enable
3908
	validation using the root zone key.  It is strongly recommended to use
3909
	<acronym>BIND</acronym> 9.7 or later to take advantage of automatic
3910
	key updating for the root key, as well as other features to 
3911
	automatically keep zones signed and signatures up to date.  Where
3912
	configurations differ between 9.6.2 and 9.7 and later, differences
3913
	will be pointed out.</para>
3914
3915
      <sect3>
3916
	<title>Recursive <acronym>DNS</acronym> server configuration</title>
3917
3918
	<para>Enabling <acronym>DNSSEC</acronym> validation of queries done by
3919
	  a recursive <acronym>DNS</acronym> server reqires a few changes to
3920
	  <filename>named.conf</filename>.  Before making these changes
3921
	  the root zone key, or trust anchor, must be aquired.  Currently the
3922
	  root zone key is not available in a file format
3923
	  <acronym>BIND</acronym> understands, so it has to be manually
3924
	  converted into the proper format.  The key itself can be obtained by
3925
	  querying the root zone for it, using <application>dig</application>.
3926
	  By running
3927
	  <screen>&prompt.user; <userinput>dig +multi +noall +answer DNSKEY . &gt; root.dnskey</userinput></screen>
3928
	  the key will end up in <filename>root.dnskey</filename>. The
3929
	  contents should look something like this:<programlisting>
3930
. 93910 IN DNSKEY 257 3 8 (
3931
            AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQ
3932
            bSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh
3933
            /RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWA
3934
            JQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXp
3935
            oY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3
3936
            LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGO
3937
            Yl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGc
3938
            LmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0=
3939
            ) ; key id = 19036
3940
. 93910 IN DNSKEY 256 3 8 (
3941
            AwEAAcaGQEA+OJmOzfzVfoYN249JId7gx+OZMbxy69Hf
3942
            UyuGBbRN0+HuTOpBxxBCkNOL+EJB9qJxt+0FEY6ZUVjE
3943
            g58sRr4ZQ6Iu6b1xTBKgc193zUARk4mmQ/PPGxn7Cn5V
3944
            EGJ/1h6dNaiXuRHwR+7oWh7DnzkIJChcTqlFrXDW3tjt
3945
            ) ; key id = 34525
3946
          </programlisting>Do not be alarmed if the obtained keys differ from
3947
          this example, they might have changed since these instructions were
3948
          last updated.  This output actually contains two keys.  The first
3949
          key in the listing, with the value 257 behind the DNSKEY record
3950
          type, is the one needed. This value indicates that this is a 
3951
          Secure Entry Point
3952
          (<acronym role="Secure Entry Point">SEP</acronym>),
3953
          more commonly known as a Key Signing Key
3954
          (<acronym role="Key Signing Key">KSK</acronym>). The second key,
3955
          with value 256, is a subordinate key, commonly called a Zone Signing
3956
          Key (<acronym role="Zone Signing Key">ZSK</acronym>).  More on the
3957
          different key types later in the <xref linkend="dns-dnssec-auth">.
3958
        </para>
3959
3960
        <para>Now the key must be verified verified and formatted so that
3961
          <acronym>BIND</acronym> can use it.  To verify the key, generate a
3962
          <acronym role="Delegation signer">DS</acronym> 
3963
          <acronym role="Resource Record">RR</acronym> set.  Create a file
3964
          containing these <acronym role="Resource Record">RR</acronym>s with 
3965
          <screen>&prompt.user; <userinput>dnssec-dsfromkey -f root-dnskey . &gt; root.ds</userinput></screen>
3966
          These records use SHA-1 and SHA-256 respectively, and should look
3967
          similar to the following example, where the longer is using SHA-256.
3968
          <programlisting>
3969
. IN DS 19036 8 1 B256BD09DC8DD59F0E0F0D8541B8328DD986DF6E
3970
. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
3971
	  </programlisting>The SHA-256 <acronym>RR</acronym> can now be
3972
	  compared to the digest in <ulink
3973
	  url="https://data.iana.org/root-anchors/root-anchors.xml">
3974
	  https://data.iana.org/root-anchors/root-anchors.xml</ulink>.  To be
3975
	  absolutely sure that the key has not been tampered with, the data in
3976
	  the <acronym>XML</acronym> file can be verified using the
3977
	  <acronym>PGP</acronym> signature in <ulink
3978
	  url="https://data.iana.org/root-anchors/root-anchors.asc">
3979
	  https://data.iana.org/root-anchors/root-anchors.asc</ulink>.</para>
3980
	    
3981
	<para>Next, the key must be formatted properly.  This differs a
3982
	  little between <acronym>BIND</acronym> versions 9.6.2 and 9.7 and
3983
	  later.  Both use a <literal>managed-keys</literal> clause, but
3984
	  support for <literal>initial-key</literal> was added in 9.7.
3985
	  <literal>initial-key</literal> makes <acronym>BIND</acronym>
3986
	  automatically track changes to the key and update it as necesarry.
3987
	  Users of <acronym>BIND</acronym> 9.6.2 must do this manually.
3988
	  For <acronym>BIND</acronym> 9.6.2 the format should look like:
3989
	  <programlisting>
3990
managed-keys {
3991
	"." 257 3 8
3992
	"AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjF
3993
	FVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoX
3994
	bfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaD
3995
	X6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpz
3996
	W5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relS
3997
	Qageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulq
3998
	QxA+Uk1ihz0=";
3999
};
4000
	  </programlisting>For 9.7 the format will instead be:
4001
	  <programlisting>
4002
managed-keys {
4003
        "." initial-key 257 3 8
4004
	"AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjF
4005
	FVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoX
4006
	bfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaD
4007
	X6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpz
4008
	W5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relS
4009
	Qageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulq
4010
	QxA+Uk1ihz0=";
4011
};
4012
	  </programlisting>The <literal>managed-keys</literal> directive can
4013
	  now be added to <filename>named.conf</filename> either directly or
4014
	  by including a file containing the key.  After these steps, tell
4015
	  <acronym>BIND</acronym> to do <acronym>DNSSEC</acronym> validation
4016
	  on queries by editing <filename>named.conf</filename> and adding the
4017
	  following to the <literal>options</literal> directive:
4018
	  <programlisting>
4019
dnssec-enable yes;
4020
dnssec-validation yes;
4021
          </programlisting></para>
4022
4023
	<para>To verify that it is actually working, use
4024
	  <application>dig</application> to make a query for a signed zone
4025
	  using the resolver just configured.  A successful reply will contain
4026
	  the <literal>AD</literal> flag to indicate the data was
4027
	  authenticated.  Running a query such as
4028
	  <screen>&prompt.user; <userinput>dig @<replaceable>resolver</replaceable> +dnssec se ds </userinput></screen>
4029
	  should return the <acronym>DS</acronym> <acronym>RR</acronym> for
4030
	  the .se zone.  In the <literal>flags:</literal> section the
4031
	  <literal>AD</literal> flag should be set, as seen
4032
	  in:<programlisting>
4033
...
4034
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
4035
...
4036
	  </programlisting>  This means that the resolver is now capable of
4037
	  authenticating <acronym>DNS</acronym> queries.</para>
4038
      </sect3>
4039
4040
      <sect3 id="dns-dnssec-auth">
4041
        <title>Authoritative <acronym>DNS</acronym> server configuration</title>
4042
        <para>In order to get an authoritative nameserver to serve a
4043
          <acronym>DNSSEC</acronym> signed zone, a little more work is
4044
          required.  To sign a zone, two cryptographic keys for that zone must
4045
          be generated. These two keys are usually called the Key Signing Key
4046
          (<acronym role="Key Signing Key">KSK</acronym>) and Zone Signing Key
4047
          (<acronym role="Zone Signing Key">ZSK</acronym>) respectively.  The
4048
          <acronym role="Key Signing Key">KSK</acronym> is used to build a chain
4049
          of authority to the data in need of validation and as such is also
4050
          called a Secure Entry Point
4051
          (<acronym role="Secure Entry Point">SEP</acronym>) key.  This key
4052
          needs to be published in the parent zone as well, to establish the
4053
          trust chain.  How this is accomplished depends on the parent zone
4054
          owner. The <acronym role="Zone Signing Key">ZSK</acronym> is used
4055
          to sign the zone, and only needs to be published there.</para>
4056
4057
        <para>To enable <acronym>DNSSEC</acronym> for the <hostid
4058
          role="domainname">example.com</hostid> zone depicted in previous
4059
          examples, the first step is to use
4060
          <application>dnssec-keygen</application> to generate the
4061
          <acronym>KSK</acronym> and <acronym>ZSK</acronym> keypair.  This keypair
4062
          can utilize different cryptograhic algorithms.  Currently the mandatory
4063
          algorithm is <literal>RSA/SHA-1</literal>.  In the examples the key
4064
          length used is 2048 bits for the <acronym>KSK</acronym> and 1024 bits
4065
          for the <acronym>ZSK</acronym>.  To generate the
4066
          <acronym>KSK</acronym> for <hostid
4067
          role="domainname">example.com</hostid>, run
4068
          <screen>&prompt.user; <userinput>dnssec-keygen -f KSK -a RSASHA1 -b 2048 -n ZONE example.com</userinput></screen>
4069
          and to generate the
4070
          <acronym>ZSK</acronym>, run
4071
          <screen>&prompt.user; <userinput>dnssec-keygen -a RSASHA1 -b 1024 -n ZONE example.com</userinput></screen>
4072
          <application>dnssec-keygen</application> outputs two files, the public
4073
          and the private keys in files named similar to
4074
          <filename>Kexample.com.+005+nnnnn.key</filename> (public) and
4075
          <filename>Kexample.com.+005+nnnnn.private</filename> (private). The
4076
          <literal>nnnnn</literal> part of the file name is a five digit key ID.
4077
          Keep track of which key ID belongs to which key.  This is especially
4078
          important when having more than one key in a zone.  The public key
4079
          files can now be included in the zone file, using the
4080
          <literal>$include</literal> statement. It should look something like
4081
          this:<programlisting>
4082
$include Kexample.net.+005+nnnnn.key    ; ZSK
4083
$include Kexample.net.+005+nnnnn.key    ; KSK
4084
	  </programlisting></para>
4085
4086
	<para>Finally, sign the zone and tell <acronym>BIND</acronym> to use
4087
	  the signed zonefile.  To sign a zone
4088
	  <application>dnssec-signzone</application> is used.  The command to
4089
	  sign the zone <hostid role="domainname">example.com</hostid>, located in
4090
	  <filename>example.com.db</filename> would look similar to
4091
	  <screen>&prompt.user; <userinput>dnssec-signzone -o example.com -k Kexample.com+005+nnnnn example.com.db Kexample.com+005+nnnnn.key</userinput></screen>
4092
	  The key supplied to
4093
	  the <option>-k</option> argument is the <acronym>KSK</acronym> and
4094
	  the other key file is the <acronym>ZSK</acronym> that should be used
4095
	  in the signing.  It is possible to supply more than one
4096
	  <acronym>KSK</acronym> and <acronym>ZSK</acronym>, which will result
4097
	  in the zone being signed with all supplied keys.  This can be needed
4098
	  to supply zone data signed using more than one algorithm.  The output
4099
	  of <application>dnssec-signzone</application> is a zone file with all
4100
	  <acronym>RR</acronym>s signed.  This output will end up in a file with
4101
	  the extension <literal>.signed</literal>, such as
4102
	  <filename>example.com.db.signed</filename>.  To use this signed zone
4103
	  just modify the zone directive in <filename>named.conf</filename> to
4104
	  use this file.  By default, the signatures are only valid 30 days,
4105
	  meaning that the zone needs to be resigned within this time.  It is
4106
	  possible to make a script and a cron job to do this.  See relevant
4107
	  manuals for details.</para>
4108
4109
	<para>Some cautionary words at the end.  Be sure to keep private keys
4110
	  confidential, as with all cryptographic keys.  When changing a key it
4111
	  is best to include the new key into the zone, while still signing with
4112
	  the old key, and then move over to using the new key to sign.  After
4113
	  these steps are done the old key can be removed from the zone.
4114
	  Failiure to do this might render the <acronym>DNS</acronym> data
4115
	  unavailable for a time, until the new key has propagated through the
4116
	  <acronym>DNS</acronym> hierarchy.  For more information on key
4117
	  rollovers and other <acronym>DNSSEC</acronym> operational issues, see
4118
	  <ulink
4119
	  url="http://www.ietf.org/rfc/rfc4641.txt"><acronym>RFC</acronym> 4641:
4120
	  <acronym>DNSSEC</acronym> Operational practices</ulink>.</para>
4121
      </sect3>
4122
4123
      <sect3>
4124
        <title>Automation using <acronym>BIND</acronym> 9.7 or later</title>
4125
        <para>Beginning with <acronym>BIND</acronym> version 9.7, a new feature
4126
          called <emphasis>Smart Signing</emphasis> was introduced.  This
4127
          feature aims to make the key management and signing process simpler by
4128
          automating parts of the task.  By putting the keys into a directory
4129
          called a <emphasis>key repository</emphasis>, and using the new option
4130
          <literal>auto-dnssec</literal>, it is possible to create a dynamic zone
4131
          which will be resigned as needed.  To update this zone use
4132
          <application>nsupdate</application> with the new option
4133
          <option>-l</option>. <application>rndc</application> has
4134
          also grown the ability to sign zones with keys in the key repository,
4135
          using the option <option>sign</option>.  To tell
4136
          <acronym>BIND</acronym> to use this automatic signing and zone
4137
          updating for <hostid role="domainname">exanple.com</hostid>, add the
4138
          following to <filename>named.conf</filename>:<programlisting>
4139
zone example.com {
4140
	type master;
4141
	key-directory "keys";
4142
	update-policy local;
4143
	auto-dnssec maintain;
4144
	file "dynamic/example.com.zone";
4145
};
4146
	  </programlisting> After making these changes, generate keys for the
4147
	  zone as explained in <xref linkend="dns-dnssec-auth">, put those keys
4148
	  in the key repository given as the argument to the
4149
	  <literal>key-directory</literal> in the zone configuration and sign
4150
	  the zone using <application>rndc</application>.  Updates to a zone
4151
	  configured this way must be done using
4152
	  <application>nsupdate</application>, which will take care of
4153
	  re-signing the zone with the new data added.  For further details,
4154
	  see <xref linkend="dns-read"> and the <acronym>BIND</acronym>
4155
	  documentation.</para>
4156
	</sect3>
4157
4158
    </sect2>
4159
4160
    <sect2>
3875
      <title>Security</title>
4161
      <title>Security</title>
3876
4162
3877
      <para>Although BIND is the most common implementation of DNS,
4163
      <para>Although BIND is the most common implementation of DNS,
Lines 3897-3907 Link Here
3897
      </tip>
4183
      </tip>
3898
    </sect2>
4184
    </sect2>
3899
4185
3900
    <sect2>
4186
    <sect2 id="dns-read">
3901
      <title>Further Reading</title>
4187
      <title>Further Reading</title>
3902
4188
3903
      <para>BIND/<application>named</application> manual pages:
4189
      <para>BIND/<application>named</application> manual pages:
3904
      &man.rndc.8; &man.named.8; &man.named.conf.5;</para>
4190
        &man.rndc.8; &man.named.8; &man.named.conf.5; &man.nsupdate.8;
4191
        &man.dnssec-signzone.8; &man.dnssec-keygen.8;</para>
3905
4192
3906
      <itemizedlist>
4193
      <itemizedlist>
3907
	<listitem>
4194
	<listitem>
Lines 3932-3937 Link Here
3932
	      url="http://tools.ietf.org/html/rfc1035">RFC1035
4219
	      url="http://tools.ietf.org/html/rfc1035">RFC1035
3933
	      - Domain Names - Implementation and Specification</ulink></para>
4220
	      - Domain Names - Implementation and Specification</ulink></para>
3934
	</listitem>
4221
	</listitem>
4222
4223
	<listitem>
4224
	  <para><ulink
4225
	      url="http://tools.ietf.org/html/rfc4033">RFC4033
4226
	      - DNS Security Introduction and Requirements</ulink></para>
4227
	</listitem>
4228
4229
	<listitem>
4230
	  <para><ulink
4231
	      url="http://tools.ietf.org/html/rfc4034">RFC4034
4232
	      - Recource Records for the DNS Security Extensions</ulink></para>
4233
	</listitem>
4234
4235
	<listitem>
4236
	  <para><ulink
4237
	      url="http://tools.ietf.org/html/rfc4035">RFC4035
4238
	      - Protocol Modifications for the DNS Security Extensions</ulink></para>
4239
	</listitem>
4240
4241
	<listitem>
4242
	  <para><ulink
4243
	      url="http://tools.ietf.org/html/rfc4641">RFC4641
4244
	      - DNSSEC Operational Practices</ulink></para>
4245
	</listitem>
4246
4247
	<listitem>
4248
	  <para><ulink
4249
	      url="http://tools.ietf.org/html/rfc5011">RFC 5011
4250
	      - Automated Updates of DNS Security (<acronym>DNSSEC</acronym>
4251
	      Trust Anchors</ulink></para>
4252
	</listitem>
4253
3935
      </itemizedlist>
4254
      </itemizedlist>
3936
    </sect2>
4255
    </sect2>
3937
  </sect1>
4256
  </sect1>
(-)share/sgml/man-refs.ent (+2 lines)
Lines 4257-4262 Link Here
4257
<!ENTITY man.diskpart.8 "<citerefentry/<refentrytitle/diskpart/<manvolnum/8//">
4257
<!ENTITY man.diskpart.8 "<citerefentry/<refentrytitle/diskpart/<manvolnum/8//">
4258
<!ENTITY man.dm.8 "<citerefentry/<refentrytitle/dm/<manvolnum/8//">
4258
<!ENTITY man.dm.8 "<citerefentry/<refentrytitle/dm/<manvolnum/8//">
4259
<!ENTITY man.dmesg.8 "<citerefentry/<refentrytitle/dmesg/<manvolnum/8//">
4259
<!ENTITY man.dmesg.8 "<citerefentry/<refentrytitle/dmesg/<manvolnum/8//">
4260
<!ENTITY man.dnssec-keygen.8 "<citerefentry/<refentrytitle/dnssec-keygen<manvolnum/8//">
4261
<!ENTITY man.dnssec-signzone.8 "<citerefentry/<refentrytitle/dnssec-signzone<manvolnum/8//">
4260
<!ENTITY man.dump.8 "<citerefentry/<refentrytitle/dump/<manvolnum/8//">
4262
<!ENTITY man.dump.8 "<citerefentry/<refentrytitle/dump/<manvolnum/8//">
4261
<!ENTITY man.dumpfs.8 "<citerefentry/<refentrytitle/dumpfs/<manvolnum/8//">
4263
<!ENTITY man.dumpfs.8 "<citerefentry/<refentrytitle/dumpfs/<manvolnum/8//">
4262
<!ENTITY man.dumpon.8 "<citerefentry/<refentrytitle/dumpon/<manvolnum/8//">
4264
<!ENTITY man.dumpon.8 "<citerefentry/<refentrytitle/dumpon/<manvolnum/8//">

Return to bug 157245