asciidoctor-rfc 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.oss-guides.rubocop.yml +1077 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +19 -1063
  6. data/.travis.yml +3 -2
  7. data/Guardfile +22 -0
  8. data/README.adoc +1151 -0
  9. data/Rakefile +1 -1
  10. data/asciidoctor-rfc.gemspec +20 -3
  11. data/bin/asciidoctor-rfc2 +15 -0
  12. data/bin/asciidoctor-rfc3 +15 -0
  13. data/bin/rspec +0 -1
  14. data/lib/asciidoctor-rfc.rb +4 -0
  15. data/lib/asciidoctor/rfc/common/base.rb +218 -0
  16. data/lib/asciidoctor/rfc/common/front.rb +120 -0
  17. data/lib/asciidoctor/rfc/v2/base.rb +341 -0
  18. data/lib/asciidoctor/rfc/v2/blocks.rb +192 -0
  19. data/lib/asciidoctor/rfc/v2/converter.rb +64 -0
  20. data/lib/asciidoctor/rfc/v2/front.rb +69 -0
  21. data/lib/asciidoctor/rfc/v2/inline_anchor.rb +102 -0
  22. data/lib/asciidoctor/rfc/v2/lists.rb +134 -0
  23. data/lib/asciidoctor/rfc/v2/table.rb +112 -0
  24. data/lib/asciidoctor/rfc/v2/validate.rb +738 -0
  25. data/lib/asciidoctor/rfc/v2/validate2.rng +716 -0
  26. data/lib/asciidoctor/rfc/v3/base.rb +358 -0
  27. data/lib/asciidoctor/rfc/v3/blocks.rb +203 -0
  28. data/lib/asciidoctor/rfc/v3/converter.rb +64 -0
  29. data/lib/asciidoctor/rfc/v3/front.rb +115 -0
  30. data/lib/asciidoctor/rfc/v3/inline_anchor.rb +90 -0
  31. data/lib/asciidoctor/rfc/v3/lists.rb +190 -0
  32. data/lib/asciidoctor/rfc/v3/svg.rng +9081 -0
  33. data/lib/asciidoctor/rfc/v3/table.rb +65 -0
  34. data/lib/asciidoctor/rfc/v3/validate.rb +2168 -0
  35. data/lib/asciidoctor/rfc/v3/validate.rng +2143 -0
  36. data/lib/asciidoctor/rfc/version.rb +2 -2
  37. data/spec/asciidoctor/rfc/v2/appendix_spec.rb +124 -0
  38. data/spec/asciidoctor/rfc/v2/area_spec.rb +60 -0
  39. data/spec/asciidoctor/rfc/v2/author_spec.rb +444 -0
  40. data/spec/asciidoctor/rfc/v2/comments_spec.rb +316 -0
  41. data/spec/asciidoctor/rfc/v2/crossref_spec.rb +205 -0
  42. data/spec/asciidoctor/rfc/v2/date_spec.rb +166 -0
  43. data/spec/asciidoctor/rfc/v2/dlist_spec.rb +108 -0
  44. data/spec/asciidoctor/rfc/v2/document_spec.rb +161 -0
  45. data/spec/asciidoctor/rfc/v2/example_spec.rb +50 -0
  46. data/spec/asciidoctor/rfc/v2/front_spec.rb +75 -0
  47. data/spec/asciidoctor/rfc/v2/image_spec.rb +81 -0
  48. data/spec/asciidoctor/rfc/v2/indexterm_spec.rb +66 -0
  49. data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +177 -0
  50. data/spec/asciidoctor/rfc/v2/keyword_spec.rb +63 -0
  51. data/spec/asciidoctor/rfc/v2/listing_spec.rb +59 -0
  52. data/spec/asciidoctor/rfc/v2/literal_spec.rb +53 -0
  53. data/spec/asciidoctor/rfc/v2/olist_spec.rb +147 -0
  54. data/spec/asciidoctor/rfc/v2/paragraph_spec.rb +68 -0
  55. data/spec/asciidoctor/rfc/v2/preamble_spec.rb +140 -0
  56. data/spec/asciidoctor/rfc/v2/quote_spec.rb +24 -0
  57. data/spec/asciidoctor/rfc/v2/references_spec.rb +96 -0
  58. data/spec/asciidoctor/rfc/v2/section_spec.rb +260 -0
  59. data/spec/asciidoctor/rfc/v2/sidebar_spec.rb +32 -0
  60. data/spec/asciidoctor/rfc/v2/table_spec.rb +293 -0
  61. data/spec/asciidoctor/rfc/v2/ulist_spec.rb +96 -0
  62. data/spec/asciidoctor/rfc/v2/workgroup_spec.rb +60 -0
  63. data/spec/asciidoctor/rfc/v3/appendix_spec.rb +130 -0
  64. data/spec/asciidoctor/rfc/v3/area_spec.rb +63 -0
  65. data/spec/asciidoctor/rfc/v3/author_spec.rb +540 -0
  66. data/spec/asciidoctor/rfc/v3/comments_spec.rb +308 -0
  67. data/spec/asciidoctor/rfc/v3/crossref_spec.rb +269 -0
  68. data/spec/asciidoctor/rfc/v3/date_spec.rb +149 -0
  69. data/spec/asciidoctor/rfc/v3/dlist_spec.rb +121 -0
  70. data/spec/asciidoctor/rfc/v3/document_spec.rb +109 -0
  71. data/spec/asciidoctor/rfc/v3/example_spec.rb +34 -0
  72. data/spec/asciidoctor/rfc/v3/front_spec.rb +43 -0
  73. data/spec/asciidoctor/rfc/v3/image_spec.rb +81 -0
  74. data/spec/asciidoctor/rfc/v3/indexterm_spec.rb +69 -0
  75. data/spec/asciidoctor/rfc/v3/inline_formatting_spec.rb +319 -0
  76. data/spec/asciidoctor/rfc/v3/keyword_spec.rb +33 -0
  77. data/spec/asciidoctor/rfc/v3/link_spec.rb +34 -0
  78. data/spec/asciidoctor/rfc/v3/listing_spec.rb +59 -0
  79. data/spec/asciidoctor/rfc/v3/literal_spec.rb +51 -0
  80. data/spec/asciidoctor/rfc/v3/olist_spec.rb +168 -0
  81. data/spec/asciidoctor/rfc/v3/paragraph_spec.rb +73 -0
  82. data/spec/asciidoctor/rfc/v3/preamble_spec.rb +112 -0
  83. data/spec/asciidoctor/rfc/v3/quote_spec.rb +91 -0
  84. data/spec/asciidoctor/rfc/v3/references_spec.rb +147 -0
  85. data/spec/asciidoctor/rfc/v3/section_spec.rb +198 -0
  86. data/spec/asciidoctor/rfc/v3/series_info_spec.rb +151 -0
  87. data/spec/asciidoctor/rfc/v3/sidebar_spec.rb +30 -0
  88. data/spec/asciidoctor/rfc/v3/table_spec.rb +275 -0
  89. data/spec/asciidoctor/rfc/v3/ulist_spec.rb +74 -0
  90. data/spec/asciidoctor/rfc/v3/workgroup_spec.rb +33 -0
  91. data/spec/examples/davies-template-bare-06.adoc +361 -0
  92. data/spec/examples/davies-template-bare-06.xml.orig +426 -0
  93. data/spec/examples/example-v2.adoc +181 -0
  94. data/spec/examples/example-v2.xml +675 -0
  95. data/spec/examples/example-v3.adoc +185 -0
  96. data/spec/examples/example-v3.xml +1009 -0
  97. data/spec/examples/mib-doc-template-xml-06.adoc +596 -0
  98. data/spec/examples/mib-doc-template-xml-06.xml.orig +654 -0
  99. data/spec/examples/rfc1149.md +76 -0
  100. data/spec/examples/rfc1149.md.2.xml +94 -0
  101. data/spec/examples/rfc1149.md.3.xml +93 -0
  102. data/spec/examples/rfc1149.md.adoc +65 -0
  103. data/spec/examples/rfc2100.md +149 -0
  104. data/spec/examples/rfc2100.md.2.xml +169 -0
  105. data/spec/examples/rfc2100.md.3.xml +163 -0
  106. data/spec/examples/rfc2100.md.adoc +136 -0
  107. data/spec/examples/rfc3514.md +203 -0
  108. data/spec/examples/rfc3514.md.2.xml +238 -0
  109. data/spec/examples/rfc3514.md.3.xml +258 -0
  110. data/spec/examples/rfc3514.md.adoc +324 -0
  111. data/spec/examples/rfc5841.md +342 -0
  112. data/spec/examples/rfc5841.md.2.xml +393 -0
  113. data/spec/examples/rfc5841.md.3.xml +449 -0
  114. data/spec/examples/rfc5841.md.adoc +414 -0
  115. data/spec/examples/rfc6350.adoc +3499 -0
  116. data/spec/examples/rfc6350.bib +763 -0
  117. data/spec/examples/rfc748.md +79 -0
  118. data/spec/examples/rfc748.md.2.xml +116 -0
  119. data/spec/examples/rfc748.md.3.xml +109 -0
  120. data/spec/examples/rfc748.md.adoc +80 -0
  121. data/spec/examples/rfc7511.md +257 -0
  122. data/spec/examples/rfc7511.md.2.xml +300 -0
  123. data/spec/examples/rfc7511.md.3.xml +347 -0
  124. data/spec/examples/rfc7511.md.adoc +417 -0
  125. data/spec/spec_helper.rb +115 -5
  126. metadata +274 -9
  127. data/.hound.yml +0 -3
  128. data/README.md +0 -84
  129. data/lib/asciidoctor/rfc.rb +0 -7
  130. data/spec/asciidoctor-rfc/.keep +0 -0
@@ -0,0 +1,203 @@
1
+ %%%
2
+
3
+ Title = "The Security Flag in the IPv4 Header"
4
+ abbrev = "The Security Flag in the IPv4 Header"
5
+ category = "info"
6
+ docName = "rfc-3514"
7
+ ipr= "trust200902"
8
+ area = "Internet"
9
+ workgroup = "Network Working Group"
10
+ keyword = [""]
11
+
12
+ date = 2003-04-01T00:00:00Z
13
+
14
+ [[author]]
15
+ initials="S."
16
+ surname="Bellovin"
17
+ fullname="Steven M. Bellovin"
18
+ #role="editor"
19
+ organization = "AT&T Labs Research"
20
+ [author.address]
21
+ email = "bellovin@acm.org"
22
+ phone = "+1 973-360-8656"
23
+ [author.address.postal]
24
+ street = "180 Park Avenue"
25
+ city = "Florham Park"
26
+ code = "NJ 07932"
27
+
28
+ %%%
29
+
30
+ .# Abstract
31
+
32
+ Firewalls, packet filters, intrusion detection systems, and the like
33
+ often have difficulty distinguishing between packets that have
34
+ malicious intent and those that are merely unusual. We define a
35
+ security flag in the IPv4 header as a means of distinguishing the two
36
+ cases.
37
+
38
+ {mainmatter}
39
+
40
+ # Introduction
41
+
42
+ Firewalls [@!CBR03], packet filters, intrusion detection systems, and
43
+ the like often have difficulty distinguishing between packets that
44
+ have malicious intent and those that are merely unusual. The problem
45
+ is that making such determinations is hard. To solve this problem,
46
+ we define a security flag, known as the "evil" bit, in the IPv4
47
+ [@!RFC0791] header. Benign packets have this bit set to 0; those that
48
+ are used for an attack will have the bit set to 1.
49
+
50
+ ## Terminology
51
+
52
+ The keywords **MUST**, **MUST NOT**, **REQUIRED**, **SHALL**, **SHALL NOT**, **SHOULD**,
53
+ **SHOULD NOT**, **RECOMMENDED**, **MAY**, and **OPTIONAL**, when they appear in this
54
+ document, are to be interpreted as described in [@!RFC2119].
55
+
56
+ # Syntax
57
+
58
+ The high-order bit of the IP fragment offset field is the only unused
59
+ bit in the IP header. Accordingly, the selection of the bit position
60
+ is not left to IANA.
61
+
62
+ The bit field is laid out as follows:
63
+
64
+ {align="left"}
65
+ 0
66
+ +-+
67
+ |E|
68
+ +-+
69
+
70
+ Currently-assigned values are defined as follows:
71
+
72
+ 0x0:
73
+ : If the bit is set to 0, the packet has no evil intent. Hosts,
74
+ network elements, etc., **SHOULD** assume that the packet is
75
+ harmless, and **SHOULD NOT** take any defensive measures. (We note
76
+ that this part of the spec is already implemented by many common
77
+ desktop operating systems.)
78
+
79
+ 0x1:
80
+ : If the bit is set to 1, the packet has evil intent. Secure
81
+ systems **SHOULD** try to defend themselves against such packets.
82
+ Insecure systems **MAY** chose to crash, be penetrated, etc.
83
+
84
+ # Setting the Evil Bit
85
+
86
+ There are a number of ways in which the evil bit may be set. Attack
87
+ applications may use a suitable API to request that it be set.
88
+ Systems that do not have other mechanisms **MUST** provide such an API;
89
+ attack programs **MUST** use it.
90
+
91
+ Multi-level insecure operating systems may have special levels for
92
+ attack programs; the evil bit **MUST** be set by default on packets
93
+ emanating from programs running at such levels. However, the system
94
+ *MAY* provide an API to allow it to be cleared for non-malicious
95
+ activity by users who normally engage in attack behavior.
96
+
97
+ Fragments that by themselves are dangerous **MUST** have the evil bit
98
+ set. If a packet with the evil bit set is fragmented by an
99
+ intermediate router and the fragments themselves are not dangerous,
100
+ the evil bit **MUST** be cleared in the fragments, and **MUST** be turned
101
+ back on in the reassembled packet.
102
+
103
+ Intermediate systems are sometimes used to launder attack
104
+ connections. Packets to such systems that are intended to be relayed
105
+ to a target SHOULD have the evil bit set.
106
+
107
+ Some applications hand-craft their own packets. If these packets are
108
+ part of an attack, the application **MUST** set the evil bit by itself.
109
+
110
+ In networks protected by firewalls, it is axiomatic that all
111
+ attackers are on the outside of the firewall. Therefore, hosts
112
+ inside the firewall **MUST NOT** set the evil bit on any packets.
113
+
114
+ Because NAT [@!RFC3022] boxes modify packets, they **SHOULD** set the evil
115
+ bit on such packets. "Transparent" http and email proxies **SHOULD** set
116
+ the evil bit on their reply packets to the innocent client host.
117
+
118
+ Some hosts scan other hosts in a fashion that can alert intrusion
119
+ detection systems. If the scanning is part of a benign research
120
+ project, the evil bit **MUST NOT** be set. If the scanning per se is
121
+ innocent, but the ultimate intent is evil and the destination site
122
+ has such an intrusion detection system, the evil bit **SHOULD** be set.
123
+
124
+ # Processing of the Evil Bit
125
+
126
+ Devices such as firewalls **MUST** drop all inbound packets that have the
127
+ evil bit set. Packets with the evil bit off **MUST NOT** be dropped.
128
+ Dropped packets **SHOULD** be noted in the appropriate MIB variable.
129
+
130
+ Intrusion detection systems (IDSs) have a harder problem. Because of
131
+ their known propensity for false negatives and false positives, IDSs
132
+ **MUST** apply a probabilistic correction factor when evaluating the evil
133
+ bit. If the evil bit is set, a suitable random number generator
134
+ [@!RFC1750] must be consulted to determine if the attempt should be
135
+ logged. Similarly, if the bit is off, another random number
136
+ generator must be consulted to determine if it should be logged
137
+ despite the setting.
138
+
139
+ The default probabilities for these tests depends on the type of IDS.
140
+ Thus, a signature-based IDS would have a low false positive value but
141
+ a high false negative value. A suitable administrative interface
142
+ **MUST** be provided to permit operators to reset these values.
143
+
144
+ Routers that are not intended as as security devices **SHOULD NOT**
145
+ examine this bit. This will allow them to pass packets at higher
146
+ speeds.
147
+
148
+ As outlined earlier, host processing of evil packets is operating-
149
+ system dependent; however, all hosts **MUST** react appropriately
150
+ according to their nature.
151
+
152
+ # Related Work
153
+
154
+ Although this document only defines the IPv4 evil bit, there are
155
+ complementary mechanisms for other forms of evil. We sketch some of
156
+ those here.
157
+
158
+ For IPv6 [@!RFC2460], evilness is conveyed by two options. The first,
159
+ a hop-by-hop option, is used for packets that damage the network,
160
+ such as DDoS packets. The second, an end-to-end option, is for
161
+ packets intended to damage destination hosts. In either case, the
162
+ option contains a 128-bit strength indicator, which says how evil the
163
+ packet is, and a 128-bit type code that describes the particular type
164
+ of attack intended.
165
+
166
+ Some link layers, notably those based on optical switching, may
167
+ bypass routers (and hence firewalls) entirely. Accordingly, some
168
+ link-layer scheme **MUST** be used to denote evil. This may involve evil
169
+ lambdas, evil polarizations, etc.
170
+
171
+ DDoS attack packets are denoted by a special diffserv code point.
172
+
173
+ An application/evil MIME type is defined for Web- or email-carried
174
+ mischief. Other MIME types can be embedded inside of evil sections;
175
+ this permit easy encoding of word processing documents with macro
176
+ viruses, etc.
177
+
178
+ # IANA Considerations
179
+
180
+ This document defines the behavior of security elements for the 0x0
181
+ and 0x1 values of this bit. Behavior for other values of the bit may
182
+ be defined only by IETF consensus [@!RFC2434].
183
+
184
+ # Security Considerations
185
+
186
+ Correct functioning of security mechanisms depend critically on the
187
+ evil bit being set properly. If faulty components do not set the
188
+ evil bit to 1 when appropriate, firewalls will not be able to do
189
+ their jobs properly. Similarly, if the bit is set to 1 when it
190
+ shouldn't be, a denial of service condition may occur.
191
+
192
+ <reference anchor='CBR03' target=''>
193
+ <front>
194
+ <title>Firewalls and Internet Security: Repelling the Wily Hacker, Second Edition</title>
195
+ <author initials='W.R.' surname='Cheswick' fullname='W.R. Cheswick'></author>
196
+ <author initials='S.M.' surname='Bellovin' fullname='S.M. Bellovin'></author>
197
+ <author initials='A.D.' surname='Rubin' fullname='A.D. Rubin'></author>
198
+ <date year='2003' />
199
+ </front>
200
+ <seriesInfo name="Addison-Wesley" value='' />
201
+ </reference>
202
+
203
+ {backmatter}
@@ -0,0 +1,238 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
3
+ <rfc ipr="trust200902" category="info" docName="rfc-3514">
4
+ <?rfc toc="yes"?>
5
+ <?rfc symrefs="yes"?>
6
+ <?rfc sortrefs="yes"?>
7
+ <?rfc compact="yes"?>
8
+ <?rfc subcompact="no"?>
9
+ <?rfc private=""?>
10
+ <?rfc topblock="yes"?>
11
+ <?rfc comments="no"?>
12
+ <front>
13
+ <title abbrev="The Security Flag in the IPv4 Header">The Security Flag in the IPv4 Header</title>
14
+
15
+ <author initials="S." surname="Bellovin" fullname="Steven M. Bellovin">
16
+ <organization>AT&amp;T Labs Research</organization>
17
+ <address>
18
+ <postal>
19
+ <street>180 Park Avenue</street>
20
+ <city>Florham Park</city>
21
+ <code>NJ 07932</code>
22
+ <country></country>
23
+ <region></region>
24
+ </postal>
25
+ <phone>+1 973-360-8656</phone>
26
+ <email>bellovin@acm.org</email>
27
+ <uri></uri>
28
+ </address>
29
+ </author>
30
+ <date year="2003" month="April" day="1"/>
31
+
32
+ <area>Internet</area>
33
+ <workgroup>Network Working Group</workgroup>
34
+ <keyword></keyword>
35
+
36
+
37
+ <abstract>
38
+ <t>Firewalls, packet filters, intrusion detection systems, and the like
39
+ often have difficulty distinguishing between packets that have
40
+ malicious intent and those that are merely unusual. We define a
41
+ security flag in the IPv4 header as a means of distinguishing the two
42
+ cases.
43
+ </t>
44
+ </abstract>
45
+
46
+
47
+ </front>
48
+
49
+ <middle>
50
+
51
+ <section anchor="introduction" title="Introduction">
52
+ <t>Firewalls <xref target="CBR03"/>, packet filters, intrusion detection systems, and
53
+ the like often have difficulty distinguishing between packets that
54
+ have malicious intent and those that are merely unusual. The problem
55
+ is that making such determinations is hard. To solve this problem,
56
+ we define a security flag, known as the &quot;evil&quot; bit, in the IPv4
57
+ <xref target="RFC0791"/> header. Benign packets have this bit set to 0; those that
58
+ are used for an attack will have the bit set to 1.
59
+ </t>
60
+
61
+ <section anchor="terminology" title="Terminology">
62
+ <t>The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
63
+ SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this
64
+ document, are to be interpreted as described in <xref target="RFC2119"/>.
65
+ </t>
66
+ </section>
67
+ </section>
68
+
69
+ <section anchor="syntax" title="Syntax">
70
+ <t>The high-order bit of the IP fragment offset field is the only unused
71
+ bit in the IP header. Accordingly, the selection of the bit position
72
+ is not left to IANA.
73
+ </t>
74
+ <t>The bit field is laid out as follows:
75
+ </t>
76
+
77
+ <figure align="left"><artwork align="left">
78
+ 0
79
+ +-+
80
+ |E|
81
+ +-+
82
+ </artwork></figure>
83
+ <t>Currently-assigned values are defined as follows:
84
+ </t>
85
+ <t>
86
+ <list style="hanging">
87
+ <t hangText="0x0:">
88
+ <vspace />
89
+ If the bit is set to 0, the packet has no evil intent. Hosts,
90
+ network elements, etc., SHOULD assume that the packet is
91
+ harmless, and SHOULD NOT take any defensive measures. (We note
92
+ that this part of the spec is already implemented by many common
93
+ desktop operating systems.)</t>
94
+ <t hangText="0x1:">
95
+ <vspace />
96
+ If the bit is set to 1, the packet has evil intent. Secure
97
+ systems SHOULD try to defend themselves against such packets.
98
+ Insecure systems MAY chose to crash, be penetrated, etc.</t>
99
+ </list>
100
+ </t>
101
+ </section>
102
+
103
+ <section anchor="setting-the-evil-bit" title="Setting the Evil Bit">
104
+ <t>There are a number of ways in which the evil bit may be set. Attack
105
+ applications may use a suitable API to request that it be set.
106
+ Systems that do not have other mechanisms MUST provide such an API;
107
+ attack programs MUST use it.
108
+ </t>
109
+ <t>Multi-level insecure operating systems may have special levels for
110
+ attack programs; the evil bit MUST be set by default on packets
111
+ emanating from programs running at such levels. However, the system
112
+ <spanx style="emph">MAY</spanx> provide an API to allow it to be cleared for non-malicious
113
+ activity by users who normally engage in attack behavior.
114
+ </t>
115
+ <t>Fragments that by themselves are dangerous MUST have the evil bit
116
+ set. If a packet with the evil bit set is fragmented by an
117
+ intermediate router and the fragments themselves are not dangerous,
118
+ the evil bit MUST be cleared in the fragments, and MUST be turned
119
+ back on in the reassembled packet.
120
+ </t>
121
+ <t>Intermediate systems are sometimes used to launder attack
122
+ connections. Packets to such systems that are intended to be relayed
123
+ to a target SHOULD have the evil bit set.
124
+ </t>
125
+ <t>Some applications hand-craft their own packets. If these packets are
126
+ part of an attack, the application MUST set the evil bit by itself.
127
+ </t>
128
+ <t>In networks protected by firewalls, it is axiomatic that all
129
+ attackers are on the outside of the firewall. Therefore, hosts
130
+ inside the firewall MUST NOT set the evil bit on any packets.
131
+ </t>
132
+ <t>Because NAT <xref target="RFC3022"/> boxes modify packets, they SHOULD set the evil
133
+ bit on such packets. &quot;Transparent&quot; http and email proxies SHOULD set
134
+ the evil bit on their reply packets to the innocent client host.
135
+ </t>
136
+ <t>Some hosts scan other hosts in a fashion that can alert intrusion
137
+ detection systems. If the scanning is part of a benign research
138
+ project, the evil bit MUST NOT be set. If the scanning per se is
139
+ innocent, but the ultimate intent is evil and the destination site
140
+ has such an intrusion detection system, the evil bit SHOULD be set.
141
+ </t>
142
+ </section>
143
+
144
+ <section anchor="processing-of-the-evil-bit" title="Processing of the Evil Bit">
145
+ <t>Devices such as firewalls MUST drop all inbound packets that have the
146
+ evil bit set. Packets with the evil bit off MUST NOT be dropped.
147
+ Dropped packets SHOULD be noted in the appropriate MIB variable.
148
+ </t>
149
+ <t>Intrusion detection systems (IDSs) have a harder problem. Because of
150
+ their known propensity for false negatives and false positives, IDSs
151
+ MUST apply a probabilistic correction factor when evaluating the evil
152
+ bit. If the evil bit is set, a suitable random number generator
153
+ <xref target="RFC1750"/> must be consulted to determine if the attempt should be
154
+ logged. Similarly, if the bit is off, another random number
155
+ generator must be consulted to determine if it should be logged
156
+ despite the setting.
157
+ </t>
158
+ <t>The default probabilities for these tests depends on the type of IDS.
159
+ Thus, a signature-based IDS would have a low false positive value but
160
+ a high false negative value. A suitable administrative interface
161
+ MUST be provided to permit operators to reset these values.
162
+ </t>
163
+ <t>Routers that are not intended as as security devices SHOULD NOT
164
+ examine this bit. This will allow them to pass packets at higher
165
+ speeds.
166
+ </t>
167
+ <t>As outlined earlier, host processing of evil packets is operating-
168
+ system dependent; however, all hosts MUST react appropriately
169
+ according to their nature.
170
+ </t>
171
+ </section>
172
+
173
+ <section anchor="related-work" title="Related Work">
174
+ <t>Although this document only defines the IPv4 evil bit, there are
175
+ complementary mechanisms for other forms of evil. We sketch some of
176
+ those here.
177
+ </t>
178
+ <t>For IPv6 <xref target="RFC2460"/>, evilness is conveyed by two options. The first,
179
+ a hop-by-hop option, is used for packets that damage the network,
180
+ such as DDoS packets. The second, an end-to-end option, is for
181
+ packets intended to damage destination hosts. In either case, the
182
+ option contains a 128-bit strength indicator, which says how evil the
183
+ packet is, and a 128-bit type code that describes the particular type
184
+ of attack intended.
185
+ </t>
186
+ <t>Some link layers, notably those based on optical switching, may
187
+ bypass routers (and hence firewalls) entirely. Accordingly, some
188
+ link-layer scheme MUST be used to denote evil. This may involve evil
189
+ lambdas, evil polarizations, etc.
190
+ </t>
191
+ <t>DDoS attack packets are denoted by a special diffserv code point.
192
+ </t>
193
+ <t>An application/evil MIME type is defined for Web- or email-carried
194
+ mischief. Other MIME types can be embedded inside of evil sections;
195
+ this permit easy encoding of word processing documents with macro
196
+ viruses, etc.
197
+ </t>
198
+ </section>
199
+
200
+ <section anchor="iana-considerations" title="IANA Considerations">
201
+ <t>This document defines the behavior of security elements for the 0x0
202
+ and 0x1 values of this bit. Behavior for other values of the bit may
203
+ be defined only by IETF consensus <xref target="RFC2434"/>.
204
+ </t>
205
+ </section>
206
+
207
+ <section anchor="security-considerations" title="Security Considerations">
208
+ <t>Correct functioning of security mechanisms depend critically on the
209
+ evil bit being set properly. If faulty components do not set the
210
+ evil bit to 1 when appropriate, firewalls will not be able to do
211
+ their jobs properly. Similarly, if the bit is set to 1 when it
212
+ shouldn't be, a denial of service condition may occur.
213
+ </t>
214
+ </section>
215
+
216
+ </middle>
217
+ <back>
218
+ <references title="Normative References">
219
+ <reference anchor='CBR03' target=''>
220
+ <front>
221
+ <title>Firewalls and Internet Security: Repelling the Wily Hacker, Second Edition</title>
222
+ <author initials='W.R.' surname='Cheswick' fullname='W.R. Cheswick'></author>
223
+ <author initials='S.M.' surname='Bellovin' fullname='S.M. Bellovin'></author>
224
+ <author initials='A.D.' surname='Rubin' fullname='A.D. Rubin'></author>
225
+ <date year='2003' />
226
+ </front>
227
+ <seriesInfo name="Addison-Wesley" value='' />
228
+ </reference>
229
+ <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.0791.xml"?>
230
+ <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1750.xml"?>
231
+ <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
232
+ <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2434.xml"?>
233
+ <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2460.xml"?>
234
+ <?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3022.xml"?>
235
+ </references>
236
+
237
+ </back>
238
+ </rfc>
@@ -0,0 +1,258 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" category="info" docName="rfc-3514">
3
+ <front>
4
+ <title abbrev="The Security Flag in the IPv4 Header">The Security Flag in the IPv4 Header</title>
5
+
6
+ <author initials="S." surname="Bellovin" fullname="Steven M. Bellovin">
7
+ <organization>AT&amp;T Labs Research</organization>
8
+ <address>
9
+ <postal>
10
+ <street>180 Park Avenue</street>
11
+ <city>Florham Park</city>
12
+ <code>NJ 07932</code>
13
+ <country></country>
14
+ <region></region>
15
+ </postal>
16
+ <phone>+1 973-360-8656</phone>
17
+ <email>bellovin@acm.org</email>
18
+ <uri></uri>
19
+ </address>
20
+ </author>
21
+ <date year="2003" month="April" day="1"/>
22
+
23
+ <area>Internet</area>
24
+ <workgroup>Network Working Group</workgroup>
25
+ <keyword></keyword>
26
+
27
+
28
+ <abstract>
29
+ <t>
30
+ Firewalls, packet filters, intrusion detection systems, and the like
31
+ often have difficulty distinguishing between packets that have
32
+ malicious intent and those that are merely unusual. We define a
33
+ security flag in the IPv4 header as a means of distinguishing the two
34
+ cases.
35
+ </t>
36
+ </abstract>
37
+
38
+ </front>
39
+
40
+ <middle>
41
+
42
+ <section anchor="introduction">
43
+ <name>Introduction</name>
44
+ <t>
45
+ Firewalls <xref target="CBR03"/>, packet filters, intrusion detection systems, and
46
+ the like often have difficulty distinguishing between packets that
47
+ have malicious intent and those that are merely unusual. The problem
48
+ is that making such determinations is hard. To solve this problem,
49
+ we define a security flag, known as the &quot;evil&quot; bit, in the IPv4
50
+ <xref target="RFC0791"/> header. Benign packets have this bit set to 0; those that
51
+ are used for an attack will have the bit set to 1.
52
+ </t>
53
+
54
+ <section anchor="terminology">
55
+ <name>Terminology</name>
56
+ <t>
57
+ The keywords <bcp14>MUST</bcp14>, <bcp14>MUST NOT</bcp14>, <bcp14>REQUIRED</bcp14>, <bcp14>SHALL</bcp14>, <bcp14>SHALL NOT</bcp14>, <bcp14>SHOULD</bcp14>,
58
+ <bcp14>SHOULD NOT</bcp14>, <bcp14>RECOMMENDED</bcp14>, <bcp14>MAY</bcp14>, and <bcp14>OPTIONAL</bcp14>, when they appear in this
59
+ document, are to be interpreted as described in <xref target="RFC2119"/>.
60
+ </t>
61
+ </section>
62
+ </section>
63
+
64
+ <section anchor="syntax">
65
+ <name>Syntax</name>
66
+ <t>
67
+ The high-order bit of the IP fragment offset field is the only unused
68
+ bit in the IP header. Accordingly, the selection of the bit position
69
+ is not left to IANA.
70
+ </t>
71
+ <t>
72
+ The bit field is laid out as follows:
73
+ </t>
74
+ <artwork align="left">
75
+ 0
76
+ +-+
77
+ |E|
78
+ +-+
79
+ </artwork>
80
+ <t>
81
+ Currently-assigned values are defined as follows:
82
+ </t>
83
+ <dl>
84
+ <dt>0x0:</dt>
85
+ <dd>If the bit is set to 0, the packet has no evil intent. Hosts,
86
+ network elements, etc., <bcp14>SHOULD</bcp14> assume that the packet is
87
+ harmless, and <bcp14>SHOULD NOT</bcp14> take any defensive measures. (We note
88
+ that this part of the spec is already implemented by many common
89
+ desktop operating systems.)</dd>
90
+ <dt>0x1:</dt>
91
+ <dd>If the bit is set to 1, the packet has evil intent. Secure
92
+ systems <bcp14>SHOULD</bcp14> try to defend themselves against such packets.
93
+ Insecure systems <bcp14>MAY</bcp14> chose to crash, be penetrated, etc.</dd>
94
+ </dl>
95
+ </section>
96
+
97
+ <section anchor="setting-the-evil-bit">
98
+ <name>Setting the Evil Bit</name>
99
+ <t>
100
+ There are a number of ways in which the evil bit may be set. Attack
101
+ applications may use a suitable API to request that it be set.
102
+ Systems that do not have other mechanisms <bcp14>MUST</bcp14> provide such an API;
103
+ attack programs <bcp14>MUST</bcp14> use it.
104
+ </t>
105
+ <t>
106
+ Multi-level insecure operating systems may have special levels for
107
+ attack programs; the evil bit <bcp14>MUST</bcp14> be set by default on packets
108
+ emanating from programs running at such levels. However, the system
109
+ <em>MAY</em> provide an API to allow it to be cleared for non-malicious
110
+ activity by users who normally engage in attack behavior.
111
+ </t>
112
+ <t>
113
+ Fragments that by themselves are dangerous <bcp14>MUST</bcp14> have the evil bit
114
+ set. If a packet with the evil bit set is fragmented by an
115
+ intermediate router and the fragments themselves are not dangerous,
116
+ the evil bit <bcp14>MUST</bcp14> be cleared in the fragments, and <bcp14>MUST</bcp14> be turned
117
+ back on in the reassembled packet.
118
+ </t>
119
+ <t>
120
+ Intermediate systems are sometimes used to launder attack
121
+ connections. Packets to such systems that are intended to be relayed
122
+ to a target SHOULD have the evil bit set.
123
+ </t>
124
+ <t>
125
+ Some applications hand-craft their own packets. If these packets are
126
+ part of an attack, the application <bcp14>MUST</bcp14> set the evil bit by itself.
127
+ </t>
128
+ <t>
129
+ In networks protected by firewalls, it is axiomatic that all
130
+ attackers are on the outside of the firewall. Therefore, hosts
131
+ inside the firewall <bcp14>MUST NOT</bcp14> set the evil bit on any packets.
132
+ </t>
133
+ <t>
134
+ Because NAT <xref target="RFC3022"/> boxes modify packets, they <bcp14>SHOULD</bcp14> set the evil
135
+ bit on such packets. &quot;Transparent&quot; http and email proxies <bcp14>SHOULD</bcp14> set
136
+ the evil bit on their reply packets to the innocent client host.
137
+ </t>
138
+ <t>
139
+ Some hosts scan other hosts in a fashion that can alert intrusion
140
+ detection systems. If the scanning is part of a benign research
141
+ project, the evil bit <bcp14>MUST NOT</bcp14> be set. If the scanning per se is
142
+ innocent, but the ultimate intent is evil and the destination site
143
+ has such an intrusion detection system, the evil bit <bcp14>SHOULD</bcp14> be set.
144
+ </t>
145
+ </section>
146
+
147
+ <section anchor="processing-of-the-evil-bit">
148
+ <name>Processing of the Evil Bit</name>
149
+ <t>
150
+ Devices such as firewalls <bcp14>MUST</bcp14> drop all inbound packets that have the
151
+ evil bit set. Packets with the evil bit off <bcp14>MUST NOT</bcp14> be dropped.
152
+ Dropped packets <bcp14>SHOULD</bcp14> be noted in the appropriate MIB variable.
153
+ </t>
154
+ <t>
155
+ Intrusion detection systems (IDSs) have a harder problem. Because of
156
+ their known propensity for false negatives and false positives, IDSs
157
+ <bcp14>MUST</bcp14> apply a probabilistic correction factor when evaluating the evil
158
+ bit. If the evil bit is set, a suitable random number generator
159
+ <xref target="RFC1750"/> must be consulted to determine if the attempt should be
160
+ logged. Similarly, if the bit is off, another random number
161
+ generator must be consulted to determine if it should be logged
162
+ despite the setting.
163
+ </t>
164
+ <t>
165
+ The default probabilities for these tests depends on the type of IDS.
166
+ Thus, a signature-based IDS would have a low false positive value but
167
+ a high false negative value. A suitable administrative interface
168
+ <bcp14>MUST</bcp14> be provided to permit operators to reset these values.
169
+ </t>
170
+ <t>
171
+ Routers that are not intended as as security devices <bcp14>SHOULD NOT</bcp14>
172
+ examine this bit. This will allow them to pass packets at higher
173
+ speeds.
174
+ </t>
175
+ <t>
176
+ As outlined earlier, host processing of evil packets is operating-
177
+ system dependent; however, all hosts <bcp14>MUST</bcp14> react appropriately
178
+ according to their nature.
179
+ </t>
180
+ </section>
181
+
182
+ <section anchor="related-work">
183
+ <name>Related Work</name>
184
+ <t>
185
+ Although this document only defines the IPv4 evil bit, there are
186
+ complementary mechanisms for other forms of evil. We sketch some of
187
+ those here.
188
+ </t>
189
+ <t>
190
+ For IPv6 <xref target="RFC2460"/>, evilness is conveyed by two options. The first,
191
+ a hop-by-hop option, is used for packets that damage the network,
192
+ such as DDoS packets. The second, an end-to-end option, is for
193
+ packets intended to damage destination hosts. In either case, the
194
+ option contains a 128-bit strength indicator, which says how evil the
195
+ packet is, and a 128-bit type code that describes the particular type
196
+ of attack intended.
197
+ </t>
198
+ <t>
199
+ Some link layers, notably those based on optical switching, may
200
+ bypass routers (and hence firewalls) entirely. Accordingly, some
201
+ link-layer scheme <bcp14>MUST</bcp14> be used to denote evil. This may involve evil
202
+ lambdas, evil polarizations, etc.
203
+ </t>
204
+ <t>
205
+ DDoS attack packets are denoted by a special diffserv code point.
206
+ </t>
207
+ <t>
208
+ An application/evil MIME type is defined for Web- or email-carried
209
+ mischief. Other MIME types can be embedded inside of evil sections;
210
+ this permit easy encoding of word processing documents with macro
211
+ viruses, etc.
212
+ </t>
213
+ </section>
214
+
215
+ <section anchor="iana-considerations">
216
+ <name>IANA Considerations</name>
217
+ <t>
218
+ This document defines the behavior of security elements for the 0x0
219
+ and 0x1 values of this bit. Behavior for other values of the bit may
220
+ be defined only by IETF consensus <xref target="RFC2434"/>.
221
+ </t>
222
+ </section>
223
+
224
+ <section anchor="security-considerations">
225
+ <name>Security Considerations</name>
226
+ <t>
227
+ Correct functioning of security mechanisms depend critically on the
228
+ evil bit being set properly. If faulty components do not set the
229
+ evil bit to 1 when appropriate, firewalls will not be able to do
230
+ their jobs properly. Similarly, if the bit is set to 1 when it
231
+ shouldn't be, a denial of service condition may occur.
232
+ </t>
233
+ </section>
234
+
235
+ </middle>
236
+ <back>
237
+ <references>
238
+ <name>Normative References</name>
239
+ <reference anchor='CBR03' target=''>
240
+ <front>
241
+ <title>Firewalls and Internet Security: Repelling the Wily Hacker, Second Edition</title>
242
+ <author initials='W.R.' surname='Cheswick' fullname='W.R. Cheswick'></author>
243
+ <author initials='S.M.' surname='Bellovin' fullname='S.M. Bellovin'></author>
244
+ <author initials='A.D.' surname='Rubin' fullname='A.D. Rubin'></author>
245
+ <date year='2003' />
246
+ </front>
247
+ <seriesInfo name="Addison-Wesley" value='' />
248
+ </reference>
249
+ <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.0791.xml"/>
250
+ <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1750.xml"/>
251
+ <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
252
+ <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2434.xml"/>
253
+ <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2460.xml"/>
254
+ <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3022.xml"/>
255
+ </references>
256
+
257
+ </back>
258
+ </rfc>