summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/cyber/cyber.dtx
blob: ddda419843ec9008fd5bb2bd5aeb4b9482800994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
% \iffalse meta-comment
% Copyright (c) 2015 Jared Jennings <jjennings@fastmail.fm>
%
% Permission is hereby granted, free of charge, to any person
% obtaining a copy of this software and associated documentation
% files (the "Software"), to deal in the Software without
% restriction, including without limitation the rights to use, copy,
% modify, merge, publish, distribute, sublicense, and/or sell copies
% of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be
% included in all copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
% BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
% ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.
% \fi
%
% ^^A We cannot \usepackage{cyber}, because it pulls in index,
% ^^A which screws up Doc's attempts to index all the macros we use.
% ^^A Therefore we do not get \filedate and \fileversion for free.
% \def\filedate{2015/03/21}
% \def\fileversion{v2.0}
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{cyber}
%<package>   [2015/03/21 v2.0 Use index package instead of multind]
%
%<*driver>
\documentclass{ltxdoc}

\usepackage{fancyvrb}
\DefineShortVerb{\|}


% Make PDF magic happen.
% Thanks, Patrick Joeckel:
% http://www.mpch-mainz.mpg.de/~joeckel/pdflatex/
% Note that I expect always to use pdflatex, not latex+dvipdf
\usepackage[bookmarks=true,bookmarksnumbered=true,breaklinks=true,pdftex]{hyperref}
\hypersetup{
    colorlinks=false,
    linkbordercolor={0.7 0.7 1.0}
}

\EnableCrossrefs
\RecordChanges
\CodelineIndex

\begin{document}
  \DocInput{cyber.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v1.0}{2011/07/18}{Renamed afseocmp to skiadoc}
% \changes{v1.1}{2012/06/06}{Made skiadoc into a \LaTeX\ package}
% \changes{v1.2}{2012/12/14}{Added support for other distribution statements
% besides D; organization logo must now be provided by the document being
% typeset}
% \changes{v1.3}{2012/12/17}{Renamed skiadoc to iadoc}
% \changes{v1.4}{2012/12/31}{Added indexing suppression macros}
% \changes{v1.5}{2013/02/01}{Flattened all compliance indices into one}
% \changes{v1.6}{2015/03/07}{Renamed iadoc to cyber: `IA' does not immediately mean anything outside the DoD, and the DoD has stopped using the term in preference to `cyber' anyway}
% \changes{v2.0}{2015/03/21}{Use index package instead of multind}
%
% \title{The \textsf{cyber} package\thanks{This document corresponds to
%   \textsf{cyber}~\fileversion, dated~\filedate.}}
% \author{Jared Jennings \\ \texttt{jjennings@fastmail.fm}}
%
% \maketitle
% \tableofcontents
% \clearpage
%
%
% \section{What \textsf{cyber} is for}
%
% This package helps you construct documents that talk about compliance with
% named requirements.
%
% For example, U.S. National Institute of Standards and Technology
% (NIST) Special Publication (SP) 800-53 sets out \emph{security
% controls} for U.S. Federal agency information systems, one of which
% is AC-2c, ``[The organization] establishes conditions for group and
% role membership.'' You may wish to write a document that says, ``We
% comply with AC-2c, and here's how.'' This package is for you.
%
%
% \section{Document identifiers}
%
% Your document may talk about compliance with named requirements from multiple
% sources. For example, besides compliance with NIST SP 800-53 you might want to
% also talk about compliance with the U.S. Defense Information Systems Agency
% (DISA) UNIX Operating System (OS) Security Requirements Guide (SRG). Now to
% fully identify a requirement, you need to identify both the requirement and
% the document it comes from, for example ``IA control IAAC-1,'' or ``UNIX SRG
% Potential Discrepancy Item (PDI) GEN006480.''
%
% At the beginning of your document, you must identify all sources of named
% requirements; then you can talk about those sources when you are identifying
% the requirements. As examples here we use NIST SP 800-53, and assign it the
% document identifier |secctrl|; and we use the UNIX SRG, identifying it by
% |unixsrg|. See~\S\ref{document_identifiers} for more.
%
%
% \section{Macros used in the body of your document}
%
% When you use the macros below to indicate requirements levied by policies
% handed down from above, or parts of code or documentation that relate to
% those requirements, you get some style for free, and an entry in an index.
% Also, other automated document features are made possible which are not
% strictly based on \LaTeX ; for example, a Puppet manifest annotated using
% \textsf{cyber} may have a table of compliance which a script constructs
% automatically by searching the manifest for uses of these macros.
%
% \subsection{Mentioning named requirements}
%
% Here are macros to use to indicate when you are talking about a specific
% requirement. These tags do not indicate any compliance posture, just that
% we're mentioning the requirement. So use these to refer to requirements in
% passing. Just like the names of celebrities are sometimes set in bold type in
% magazines, so that you can skip around and look for your favorite famous
% person, we want to make it easy to find all mentions of a given named
% requirement. 
%
% \begin{itemize}
% \item
% \DescribeMacro{\secctrl}
% |\secctrl| \marg{control identifier}
% \item
% \DescribeMacro{\unixsrg}
% |\unixsrg| \marg{PDI}
% \end{itemize}
%
% The exact set of these macros depends on the set of requirements documents
% named at the beginning of your document; see~\S\ref{document_identifiers}.
%
% Example:
% \begin{Verbatim}[gobble=2]
% Compliance with such and such requirement is similar to compliance with
% \unixsrg{GEN002600}, \emph{q.v.}.
% \end{Verbatim}
%
%
% \subsection{Making assertions about compliance posture}
%
% Most mentions of named requirements are going to be something like, ``We
% comply with bla requirement,'' or ``We don't comply with this one, and here's
% why.'' The following tags make it quick and simple for you to write such
% assertions.
%
%
% \DescribeMacro{\documents}
% Use |\documents| for notating some text in your document that says a fact
% about a system which supports a requirement. It takes two parameters: the
% type of requirement, and the name of the requirement. Example:
%
% \begin{Verbatim}[gobble=2]
% \documents{secctrl}{SC-18} We use only JavaScript, which is Category I
% mobile code according to DoD guidelines.
% \end{Verbatim}
%
% Some requirements say something like, ``All \emph{mumble}s must be justified
% and documented with the Information Assurance Officer (IAO).'' Use
% |\documents| to assert either that those things are documented, right here,
% or that you should look in \emph{bla} document to find that documentation.
%
% For example, the UNIX SRG requires that UNIX systems unable to require a
% password to enter single-user mode must be documented with the IAO.
%
% \begin{Verbatim}[gobble=2]
% \documents{unixsrg}{GEN000040} UNIX hosts unable to require a password
% to enter single-user mode must be documented with the IAO. We administer
% no such UNIX hosts.
% \end{Verbatim}
% (This is written in a document which is produced under the IAO's purview
% and approval; otherwise it would have to point to another document which is
% ``with the IAO.'')
%
%
% \DescribeMacro{\notapplicable}
% Just before some discussion about why a requirement is not applicable in a
% certain situation, put the |\notapplicable| tag. For example:
%
% \begin{Verbatim}[gobble=2]
% \notapplicable{secctrl}{SC-18(5)} We do not use mobile code at all.
% \end{Verbatim}
%
% \DescribeMacro{\implements}
% The |\implements| tag notates a section of code or documentation which
% directly implements a requirement. It's usually used in automated policy. For
% example, the UNIX SRG says under GEN001362, ``The \Verb!/etc/resolv.conf!
% file must be owned by root.'' A piece of Puppet policy that implements this
% requirement may go like:
%
% \begin{Verbatim}[gobble=2]
% # \implements{unixsrg}{GEN001362} Make sure resolv.conf 
% # is owned by root.
%     file { '/etc/resolv.conf':
%         owner => root,
%     }
% \end{Verbatim}
%
%
% \DescribeMacro{\doneby}
% The |\doneby| tag is for requirements that are not fulfilled in an automated
% fashion: people are responsible for carrying them out on a day-by-day basis.
% It takes three parameters: who exactly does this thing, the kind of
% requirement, and the requirement's name. For example, the RHEL5 STIG requires
% that SELinux be turned on when installing RHEL5. Administrators have to make
% sure it's enabled during the install process.
%
% \begin{Verbatim}[gobble=2]
% \doneby{admins}{rhel5stig}{GEN000000-LNX00800} Make sure SELinux is
% enabled when installing RHEL5.
% \end{Verbatim}
%
% \DescribeMacro{\bydefault}
% Use the |\bydefault| tag to talk about how a product we use implements a
% given requirement in its default configuration. It takes three parameters:
% the product we're talking about, the kind of requirement, and the
% requirement's name.---For example, the UNIX SRG says under GEN001300 that all
% library files must have mode \Verb!0755! or less permissive. Both RHEL 5 and
% RHEL 6 systems have this property by default.
%
% \begin{Verbatim}[gobble=2]
% \bydefault{RHEL5, RHEL6}{unixsrg}{GEN001300} All library files under
% RHEL are mode \Verb!0755! or less permissive by default.
% \end{Verbatim}
%
%
% \DescribeMacro{\unimplemented}
% Use the |\unimplemented| tag to talk about a requirement we need to fulfill
% but haven't yet. (Don't use |\unimplemented| to talk about a requirement
% we don't intend ever to fulfill: it turns some things red to bring our
% attention to them; we don't want false alarms.)
%
% Note carefully that this tag has three parameters: the kind of
% requirement, the exact requirement, and \emph{the reason} the requirement
% is unimplemented. You can't use \Verb!\Verb! in the reason. Stick with plain
% text.
%
% \begin{Verbatim}[gobble=2]
% \unimplemented{unixsrg}{GEN008380}{Unless root kit checking
% functionality is provided by the virus scanner, we would likely
% want to deploy {\tt chkrootkit}. But this software is not yet
% approved...}
% \end{Verbatim}
%
%
%
%
% \section{Security labels}
%
% Some regulations require that documents be marked and labelled. These
% tags help you do that.
%
% \DescribeMacro{\articlesecuritylabel}
% When you are writing an article (|\documentclass{article}|), this tag helps
% you label it. It will put the text you give at the top of every page. Put
% the tag right after |\usepackage{cyber}|, as close to the top of the
% document source as possible. That way it will be visible to viewers of the
% document source as well.
%
% Most reStructuredText documents use the article class.
%
% Example, in \LaTeX :
% \begin{Verbatim}[gobble=2]
% \articlesecuritylabel{UNCLASSIFIED//FOUO}
% \end{Verbatim}
%
% \DescribeMacro{\booksecuritylabel}
% |\booksecuritylabel| acts the same as |\articlesecuritylabel|, but this is
% the one you should use if you are using the \textsf{book} document class.
%
% Part of marking a document properly is writing the distribution statement and
% statement of disposition on the title page.
%
% See \url{http://www.dtic.mil/dtic/submit/guidance/distribstatement.html} on
% distribution statements and on destruction of limited-distribution
% unclassified documents.
%
% \section{Distribution statements}
%
% Write the distribution statement right after the security label. Statements
% allowed by DoDI 5320.24 as of 23 August 2012 are A through F. Macros for
% these are provided. Dates are set to |\today|. For guidance on the reasons,
% see the DoD instruction.
%
% Just like you need |\maketitle| to make your |\title| show up, you need to
% (instead) use |\makedodtitle| to make your distribution statement show up.
%
% \DescribeMacro{\distributionA}
% To mark your document with Distro A (public release), write |\distributionA|
% \marg{other information}. Local policies may require that you include a
% reference number, or the name of the organization which cleared the document,
% or some such. That's ``other information.''
%
% \DescribeMacro{\distributionB}
% To U.S. Government agencies only: |\distributionB| \marg{reason why}
% \marg{controlling office}.
%
% \DescribeMacro{\distributionC}
% To U.S. Government agencies and their contractors: |\distributionC| \marg{reason
% why} \marg{controlling office}.
%
% \DescribeMacro{\distributionD}
% To DoD and DoD contractors only: |\distributionD| \marg{reason why}
% \marg{controlling office}. 
%
% \DescribeMacro{\distributionE}
% To DoD Components only: |\distributionE| \marg{reason why} \marg{controlling
% office}.
%
% \DescribeMacro{\distributionF}
% Only as directed by the controlling office or higher DoD authority:
% |\distributionF| \marg{controlling office}.
%
% You are responsible for understanding what these statements mean and whether
% you're allowed to use them.
%
%
% \section{Document formatting aids}
%
% \subsection{DoD title page}
% \DescribeMacro{\makedodtitle} In a book-class document, use
% |\makedodtitle| instead of \Verb!\maketitle!  and you will get an
% organization logo on your title page. You'll also get the distribution
% statement. You must provide the organization logo, as a graphics file of a
% suitable format (\emph{e.g.}, PNG or PDF if you're using \Verb!pdflatex!, EPS
% if you're using \Verb!latex!, that sort of thing), entitled \Verb!org_logo!,
% \emph{e.g.} \Verb!org_logo.png!.
%
% \subsection{Narrower margins}
% \DescribeMacro{\narrowermargins}
% Nobody appreciates the rules of typography these days. And making a bad
% impression on auditors by submitting a document that doesn't look how they
% expect is a needless risk.
%
% This macro narrows the margins, while leaving a sizable margin in which to
% write text. It probably only works on books (not articles). It takes the
% security label into account.
%
% In the top of your document, put |\narrowermargins| to make all of the
% margins narrower by a half inch, increasing the text area by one inch
% horizontally and one inch vertically.  You have to put it above the security
% label.
%
% This has not been tested much, and only on a book-class document.
%
% \subsection{Change log}
%
% Most documents submitted in support of cybersecurity goals must
% indicate what version they are, and what changes have happened between
% versions. In software development terminology, these correspond to
% \emph{releases}, not \emph{revisions} or \emph{changesets}; that is to say,
% these versions are likely not to change more than once a month, and changes
% are likely to be, ``Added a new chapter about foo,'' rather than ``Corrected
% spelling on page 358.''
%
% Write a changelog and call it \Verb!changelog.tex!. Include it in your
% front matter just after the table of contents. Its format is like so:
%
% \begin{Verbatim}[gobble=2]
% \begin{changelog}
%
% \change{3 Aug 2011}{Jared Jennings}{Added Backup Plan}
%
% \change{2 Aug 2011}{Jared Jennings}{New server purchased; changed Hardware
% Baseline to match}
%
% \end{changelog}
% \end{Verbatim}
%
% Add new entries to the top of the changelog, not the bottom.
%
% \subsection{Executive summary}
% An ``executive summary'' is supported. This is just a section containing a
% table which lists the larger security controls this document is about.
% Its format is like so:
%
% \begin{Verbatim}[gobble=2]
% \begin{executivesummary}
% \executivesummaryiacontrol{IAIA-1}{Individual Authentication}
% \end{executivesummary}
% \end{Verbatim}
%
% Put it after the changelog, after the ToC.
%
%
% \section{Document identifiers}
% \label{document_identifiers}
%
% To identify a requirement you want to talk about without ambiguity,
% you need to give a name for both the requirement and the document it
% came from.  Since document identifiers are written in potentially
% hundreds of compliance tags across a document, they need to be
% short, but unique. Here are some example document identifiers:
%
% \begin{description}
% \item[iacontrol] Information Assurance Controls, laid out in DoDI
% 8500.2, e.g. DCMC-1.
% \item[secctrl] Security Controls, laid out in NIST SP 800-53, e.g. SC-18c.
% \item[unixsrg] UNIX Security Requirements Guide (SRG) Potential
% Discrepancy Identifiers (PDIs), e.g. GEN008520.
% \item[rhel5stig] Red Hat Enterprise Linux (RHEL) 5 STIG PDIs.
% \end{description}
%
% \subsection{Defining requirements documents}
%
% In the preamble of your document, you must tell \textsf{cyber} from which
% documents your requirements will come. \DescribeMacro{\requirementsdocument}
% Use the |\requirementsdocument| macro to do this. For example,
%
% \begin{Verbatim}[gobble=2]
% \requirementsdocument{joesaidso}{Joe's Demands}{Demand }
% \end{Verbatim}
%
% The first parameter is the document identifier, which is used in the
% compliance tags. For example, after this |\requirementsdocument|, in the body
% of our document we could write
%
% \begin{Verbatim}[gobble=2]
% \documents{joesaidso}{Joe34} We close the door when going outside, because
% Joe said to. Door-closing logs are kept just inside the door.
% \end{Verbatim}
%
% The second parameter is the header under which all requirements from this
% document will be placed in the Compliance index. Given the above code, the
% index might look like:
%
% \begin{Verbatim}[gobble=2]
% Compliance
%
%  Joe's Demands
%    Joe34
%      documented, 3
% \end{Verbatim}
%
% The third parameter is the prefix with which requirements from this document
% will be named. For example, if we were to write |\joesaidso{Joe34}| in the
% body of a document, we would see ``Demand Joe34'' in the rendering of that
% document.
%
%
% \section{Adding \textsf{cyber} to a document}
%
% If you are editing or adding to an existing document which already uses
% \textsf{cyber}, you need not concern yourself with this section.
%
% To use \textsf{cyber} in a new document: you should have the \textsf{cyber} package
% installed; see
% \url{http://en.wikibooks.org/wiki/LaTeX/Packages/Installing_Extra_Packages}. 
%
% At the top of your document, in its preamble, put the following lines:
%
% \begin{Verbatim}[gobble=2]
% \usepackage{cyber}
% \end{Verbatim}
%
% This makes the indices that the \textsf{cyber} tags put entries into. 
%
% Somewhere in the preamble of your document, after you use the \textsf{cyber}
% package, tell \textsf{cyber} about all your |\requirementsdocument|s.
%
% Somewhere at the end of your document, put
%
% \begin{Verbatim}[gobble=2]
% \printindex{cyber_compliance}{Compliance}
% \end{Verbatim}
%
% This grabs the index made and makes it part of the final document.
%
%
% \subsection{Controls in contents}
%
% If you want the IA controls covered in a section to be summarized in the
% section's title written in the table of contents, use this additional
% package:
%
% \begin{Verbatim}[gobble=2]
% \usepackage{iacic}
% \end{Verbatim}
%
% Write this after the usepackage directive for \textsf{cyber}. If you use the
% hyperref package, write this statement after the usepackage directive for
% hyperref.
%
% If you use iacic, your section titles cannot contain any formatting, and your
% document cannot be originally written in reStructuredText. Section titles
% written in the body text will not change: only the ones in the contents.
% Section titles written in page headers will vary. In general this is a buggy,
% wonky feature.  See \url{http://tex.stackexchange.com/questions/29818}. Dive
% into the wonderful world of \TeX\ and \LaTeX . Learn you a fix for great
% good!
%
%
% \subsection{Temporarily suppressing index entries}
%
% If some part of your document is an auto-summary of another part of your
% document, to index mentions of requirements in the summarized part may be
% redundant and undesirable.
%
% \DescribeMacro{\Cyberindexingenabledfalse}
%
% \DescribeMacro{\Cyberindexingenabledtrue}
%
% Use these macros to turn off and on (respectively) indexing of compliance
% assertions for part of your document. For example:
%
% \begin{Verbatim}[gobble=2]
% \Cyberindexingenabledfalse
% \include{auto_summary}
% \Cyberindexingenabledtrue
% \end{Verbatim}
%
%
% \section{Interactions with other packages}
% If you use \textsf{hyperref}, do so \emph{before} you use \textsf{cyber}.
%
% Because \textsf{cyber} requires \textsf{longtable}, you can't use two
% columns in a document that uses \textsf{cyber}. The requirement for
% longtable stems from the executive summary and changelog, which may have
% enough rows to span pages.
%
% Because \textsf{cyber} requires \textsf{index}, any other package which
% automatically indexes things may not work in conjunction with
% \textsf{cyber}.
%
% \textsf{cyber} also pulls in \textsf{color}, \textsf{fancyhdr} and
% \textsf{graphicx}.
%
%
%
%
% \section{Implementation}
%
% \StopEventually{}
%    \begin{macrocode}
\makeatletter
%    \end{macrocode}
% We require longtable for the changelog and executive summary, which could span pages.
%    \begin{macrocode}
\RequirePackage{longtable}
%    \end{macrocode}
% We require color so that we can make red some text regarding unimplemented
% requirements.
%    \begin{macrocode}
\RequirePackage{color}
%    \end{macrocode}
% There are potentially hundreds of requirements with which to comply. So we
% want them in their own index.
%    \begin{macrocode}
\RequirePackage{index}
%    \end{macrocode}
% The \textsf{fancyhdr} package is how we add security labels.
%    \begin{macrocode}
\RequirePackage{fancyhdr}
%    \end{macrocode}
% And the graphicx package is needed so the organization's logo can be put on
% the front page.
%    \begin{macrocode}
\RequirePackage{graphicx}

%    \end{macrocode}
% Index entries are written into the compliance index.
%    \begin{macrocode}
\newindex{cybercompliance}{cybercompliance.idx}{cybercompliance.ind}{Compliance}
%    \end{macrocode}
% Notations of compliance throughout the document are written in compliance.aux
% and explanations.aux.
%    \begin{macrocode}
\AtBeginDocument{
\newwrite\complianceaux
\immediate\openout\complianceaux=cyber_compliance.aux
\newwrite\explanationsaux
\immediate\openout\explanationsaux=cyber_explanations.aux
}

\AtEndDocument{
\immediate\closeout\complianceaux
\immediate\closeout\explanationsaux
}
%    \end{macrocode}

% The foreach code below is from:
% \url{http://stackoverflow.com/questions/2402354/split-comma-separated-parameters-in-latex}
% and/or \url{http://maraist.org/comma-separated-lists-in-latex_08-2009/}.
% Added two extra pass-through parameters.
%
% \begin{macro}{\foreach}
% Functional foreach construct.
% Usage: |\foreach| \marg{macro} \marg{firstarg} \marg{secondarg}
% \marg{third1,third2,third3,...}.  Evaluates to
% |\macro{firstarg}{secondarg}{third1}| |\macro{firstarg}{secondarg}{third2}|
% etc.
%
% Put another way: \meta{\#1} is a function to call once for each
% comma-separated item in \meta{\#4}. \meta{\#2} and \meta{\#3} are parameters to
% pass to function in \meta{\#1} as the first parameters.  \meta{\#4} is a
% comma-separated list of items, each of which to pass as the third parameter
% to an invocation of function \meta{\#1}.
%    \begin{macrocode}
\def\foreach#1#2#3#4{%
  \@test@foreach{#1}{#2}{#3}#4,\@end@token%
}
%    \end{macrocode}
% \end{macro}

% Internal helper function - Eats one input.
%    \begin{macrocode}
\def\@swallow#1{}
%    \end{macrocode}

% Internal helper function - Checks the next character after \#1 and \#2 and
% continues loop iteration if |\@end@token| is not found.
%    \begin{macrocode}
\def\@test@foreach#1#2#3{%
  \@ifnextchar\@end@token%
    {\@swallow}%
    {\@foreach{#1}{#2}{#3}}%
}
%    \end{macrocode}

% Internal helper function - Calls |#1{#2}{#3}{#4}| and recurses.
% The magic of splitting the third parameter occurs in the pattern matching of
% the |\def|.
%    \begin{macrocode}
\def\@foreach#1#2#3#4,#5\@end@token{%
  #1{#2}{#3}{#4}%
  \@test@foreach{#1}{#2}{#3}#5\@end@token%
}
%    \end{macrocode}


% \begin{macro}{\requirementsdocument}
% Usage: |\requirementsdocument| \marg{tag} \marg{index heading}
% \marg{requirement title}. The tag is a one-word lowercase name, like
% iacontrol or unixsrg or rhel5stig, that you'll use in |\implements|
% and other tags to say from which document comes the requirement
% you're talking about.  An index of compliance will be made;
% |index heading| is the title under which all compliance with this document
% will be listed in the compliance index, for example ``NIST SP 800-53
% Security Controls.'' The |requirement title| is how to name a
% requirement from that document. For example, the DISA UNIX SRG
% contains many requirements, called Potential Discrepancy Items
% (PDI). So you may give ``UNIX SRG PDI '' (note the space at the end)
% as the requirement title, and when a requirement is named using
% |\requirement| it will be prefixed with the title, e.g. ``UNIX SRG
% PDI GEN006480.''
% 
% Write all |\requirementsdocument|s in the preamble of the document.
%
%    \begin{macrocode}
\newcommand{\requirementsdocument}[3]{%
    % Say how to name requirements that come from this document.
    \expandafter\providecommand\csname #1\endcsname[1]{%
        \namedrequirement{#1}{#3}{##1}}
    \expandafter\newcommand\csname indexhead#1\endcsname{#2}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\requirement}
% Usage: |\requirement| \marg{document tag} \marg{requirement name}. Example:
% |\requirement{unixsrg}{GEN006480}|. Use this macro to mention requirements
% that come from other documents, without implying a particular compliance
% posture. For example, ``The check content of
% |\requirement{unixsrg}{GEN006480}| suggests the following solution.''
%    \begin{macrocode}
\newcommand{\requirement}[2]{%
    \expandafter\csname requirement@#1\endcsname{#2}}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\namedrequirement}
% Usage: |\namedrequirement| \marg{index name} \marg{official title prefix} \marg{requirement name}.
% Example: |\namedrequirement{iacontrol}{IA Control }{IAAC-1}| will say ``IA
% Control IAAC-1'' in the body of the document, and make an index entry in the
% compliance index under the ``IA Controls'' heading. (``IA Controls'' in this
% example is the value of a parameter given to |\requirementsdocument|, not to
% this macro.)
%
% This macro exists so it will be possible to redefine it to change how such a
% thing looks. When referring to a named requirement in a document that you are
% writing, use |\requirement| above, not this macro.
%
% The index macro is the same as in indexhelper below but without the last
% |!{#2}| for the subhead.
%    \begin{macrocode}
\newcommand{\namedrequirement}[3]{%
    \index[cybercompliance]{\csname indexhead#1\endcsname @\iaindexheadstyle{\csname indexhead#1\endcsname}!{#3}!}%
    {\small #2\mbox{#3}}%
}
%    \end{macrocode}
% \end{macro}
%
% This will be redefined by \textsf{iacic} if that package is included.
%    \begin{macrocode}
\def\addtosectionname#1{}
%    \end{macrocode}
%
% This is here so you can turn off indexing for a portion of your document.
%    \begin{macrocode}
\newif\ifCyberindexingenabled
\Cyberindexingenabledtrue
%    \end{macrocode}
%
% Style the text for per-document heads in the compliance index.
%    \begin{macrocode}
\newcommand{\iaindexheadstyle}[1]{%
    \vspace{1em}{\large \textbf{#1}}\vspace{1em}}
%    \end{macrocode}
%
% parameters: index name, implementation status, requirement name
%    \begin{macrocode}
\newcommand{\indexhelper}[3]{%
\ifCyberindexingenabled\index[cybercompliance]{\csname indexhead#1\endcsname @\iaindexheadstyle{\csname indexhead#1\endcsname}!{#3}!{#2}}\fi}
%    \end{macrocode}
%
% parameters: index name, prefix (e.g. {RHEL5: }), requirement name
%    \begin{macrocode}
\newcommand{\marginhelper}[3]{#2~\mbox{#3}\\ }
%    \end{macrocode}
%
% parameters: index name, compliance status, requirement name.
% Compliance status is not necessarily the same as implementation status.
%    \begin{macrocode}
\newcommand{\compliancehelper}[3]{%
\write\complianceaux{#1:#3:#2}}
%    \end{macrocode}
%
% parameters: index name, explanation, requirement name
%    \begin{macrocode}
\newcommand{\explanationshelper}[3]{%
\write\explanationsaux{#1:#3:}%
\write\explanationsaux{#2}%
\write\explanationsaux{:}%
}
%    \end{macrocode}

% parameters: index name, nothing, requirement name
%    \begin{macrocode}
\newcommand{\sectionnamehelper}[3]{%
    \def\@numberone{#1}%
    \def\@iacontrol{iacontrol}%
    \ifx\@numberone\@iacontrol\addtosectionname{#3}\fi}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\iamarginsize{\footnotesize}
%    \end{macrocode}
%
% These all take two parameters.
% The first parameter is the identifier of the document from which the
% requirement comes (e.g. iacontrol, unixstig, spanstig, apachestig,
% etc)---same names as the indices. The second parameter is which
% requirement(s) is/are in the given status (e.g. GEN000320). You may supply
% multiple values for this one, separated by commas.
%
% Example: |\implements{unixsrg}{GEN000320,GEN000340}|
%
%    \begin{macrocode}
\newcommand{\implements}[2]{%
    \@bsphack
    \hspace{0pt}% this makes sure the marginpar doesn't go with the previous
                % paragraph
    \foreach{\indexhelper}{#1}{implemented}{#2}%
    \marginpar{\iamarginsize \raggedright%
        \foreach{\marginhelper}{#1}{auto:}{#2}%
    }%
    \foreach{\compliancehelper}{#1}{compliant}{#2}%
    \foreach{\sectionnamehelper}{#1}{}{#2}%
    \@esphack}
\newcommand{\unimplemented}[3]{%
    \@bsphack
    \hspace{0pt}% this makes sure the marginpar doesn't go with the previous
                % paragraph
    \foreach{\indexhelper}{#1}{\textcolor{red}{unimplemented}}{#2}%
    \marginpar{\iamarginsize \color{red} \raggedright%
        \foreach{\marginhelper}{#1}{}{#2}%
    }%
    \foreach{\compliancehelper}{#1}{non-compliant}{#2}%
    \foreach{\explanationshelper}{#1}{#3}{#2}%
    \foreach{\sectionnamehelper}{#1}{}{#2}%
    {#3}%
    \@esphack}
%    \end{macrocode}
%
% Except this one takes three parameters: operating system(s),
% identifier of requiring document, requirement(s).
%    \begin{macrocode}
\newcommand{\bydefault}[3]{%
    \@bsphack
    \hspace{0pt}% this makes sure the marginpar doesn't go with the previous
                % paragraph
    \foreach{\indexhelper}{#2}{default for {#1}}{#3}%
    \marginpar{\iamarginsize \raggedright%
        \foreach{\marginhelper}{#2}{#1: }{#3}%
    }%
    \foreach{\compliancehelper}{#2}{compliant}{#3}%
    \foreach{\sectionnamehelper}{#1}{}{#2}%
    \@esphack}
%    \end{macrocode}
%
%    \begin{macrocode}
\newcommand{\notapplicable}[2]{%
    \@bsphack
    \hspace{0pt}% this makes sure the marginpar doesn't go with the previous
                % paragraph
    \foreach{\indexhelper}{#1}{N/A}{#2}%
    \marginpar{\iamarginsize \raggedright%
        \foreach{\marginhelper}{#1}{N/A: }{#2}%
    }%
    \foreach{\compliancehelper}{#1}{N/A}{#2}%
    \@esphack}
%    \end{macrocode}

%    \begin{macrocode}
\newcommand{\doneby}[3]{%
    \@bsphack
    \hspace{0pt}% this makes sure the marginpar doesn't go with the previous
                % paragraph
    \foreach{\indexhelper}{#2}{prescribed}{#3}%
    \marginpar{\iamarginsize \raggedright%
        \foreach{\marginhelper}{#2}{#1 do }{#3}%
    }%
    \foreach{\compliancehelper}{#2}{compliant}{#3}%
    \foreach{\sectionnamehelper}{#1}{}{#2}%
    \@esphack}
%    \end{macrocode}

% deprecated
%    \begin{macrocode}
\newcommand{\prescribed}[2]{\doneby{admins}{#1}{#2}}
%    \end{macrocode}

%    \begin{macrocode}
\newcommand{\documented}[2]{%
    \@bsphack
    \hspace{0pt}% this makes sure the marginpar doesn't go with the previous
                % paragraph
    \foreach{\indexhelper}{#1}{documented}{#2}%
    \marginpar{\iamarginsize \raggedright%
        \foreach{\marginhelper}{#1}{}{#2}%
    }%
    \foreach{\compliancehelper}{#1}{compliant}{#2}%
    \foreach{\sectionnamehelper}{#1}{}{#2}%
    \@esphack}
%    \end{macrocode}

%    \begin{macrocode}
\newcommand{\documents}[2]{\documented{#1}{#2}}
%    \end{macrocode}


% \begin{macro}{\articlesecuritylabel}
% Use this to label documents of class \textsl{article}.
% Use like |\articlesecuritylabel| \marg{thing to write on each page}.
% The thing will be written as part of the page header.
%    \begin{macrocode}
\newcommand{\articlesecuritylabel}[1]{%
    \pagestyle{fancy}%
    \renewcommand{\headrulewidth}{0pt}%
    \fancyhf{}%
    \chead{#1}%
    \cfoot{\thepage}%
    \fancypagestyle{plain}{%
        \fancyhf{}%
        \fancyhead[C]{#1}%
    }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\booksecuritylabel}
% Use this one to label books. Syntax is the same as above.
%    \begin{macrocode}
\newcommand{\booksecuritylabel}[1]{%
    \pagestyle{fancy}%
    \renewcommand{\headrulewidth}{0.1pt}%
    \fancyhf{}%
    \fancyhead[CE,CO]{#1\vspace{2\baselineskip}}%
    \fancyhead[LE,RO]{\thepage}%
    \fancyhead[RE]{\nouppercase{\leftmark}}%
    \fancyhead[LO]{\nouppercase{\rightmark}}%
    %
    \fancypagestyle{empty}{%
        \renewcommand{\headrulewidth}{0pt}%
        \fancyhf{}%
        \fancyhead[C]{#1\vspace{2\baselineskip}}%
    }%
    \fancypagestyle{plain}{%
        \renewcommand{\headrulewidth}{0pt}%
        \fancyhf{}%
        \fancyhead[C]{#1\vspace{2\baselineskip}}%
    \fancyfoot[C]{\thepage}%
    }%
}
%    \end{macrocode}
% \end{macro}
%
% See \url{http://www.dtic.mil/dtic/submit/guidance/distribstatement.html} on
% distribution statements and on destruction of limited-distribution
% unclassified documents.
%
%    \begin{macrocode} 
\def\@distribution{\@latex@warning@no@line{No distribution statement given}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@destruction{%
    \textbf{DESTRUCTION NOTICE}: Destroy by any method that will prevent disclosure or reconstruction of the document.}
%    \end{macrocode}
%
% \begin{macro}{\distributionA}
%    \begin{macrocode}
\def\distributionA#1{%
    \gdef\@distribution{%
        \textbf{DISTRIBUTION STATEMENT A}: Approved for public release. #1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\distributionB}
%    \begin{macrocode}
\def\distributionB#1#2{%
    \gdef\@distribution{%
        \textbf{DISTRIBUTION STATEMENT B}: Distribution authorized to U.S. Government agencies only #1 \@date. Other requests for this document shall be referred to #2.}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\distributionC}
%    \begin{macrocode}
\def\distributionC#1#2{%
    \gdef\@distribution{%
        \textbf{DISTRIBUTION STATEMENT C}: Distribution authorized to U.S. Government agencies and their contractors #1 \@date. Other requests for this document shall be referred to #2.}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\distributionD}
% Use this macro to indicate that your document uses Distribution Statement D,
% and why, like so: |\distributionD| \marg{reason why distribution is limited}.
% Write this in the top of your document, before |\begin{document}|.
%    \begin{macrocode}
\def\distributionD#1#2{%
    \gdef\@distribution{%
        \textbf{DISTRIBUTION STATEMENT D}: Distribution authorized to the Department of Defense and U.S. DoD contractors only #1 \@date. Other requests shall be referred to #2.}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\distributionE}
%    \begin{macrocode}
\def\distributionE#1#2{%
    \gdef\@distribution{%
        \textbf{DISTRIBUTION STATEMENT E}: Distribution authorized to DoD Components only #1 \@date. Other requests shall be referred to #2.}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\distributionF}
%    \begin{macrocode}
\def\distributionF#1{%
    \gdef\@distribution{%
        \textbf{DISTRIBUTION STATEMENT F}: Further dissemination only as directed by #1 \@date\ or higher DoD authority.}}
%    \end{macrocode}
% \end{macro}
%
%

%    \begin{macrocode}
\def\@version{}
%    \end{macrocode}

% \begin{macro}{\version}
% Use the |\version| \marg{some indication of version} to indicate the version
% of the document.
%    \begin{macrocode}
\def\version#1{\gdef\@version{#1}}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\today}
% This redefinition of the |\today| macro formats the date like ``4 Oct 2011,''
% as military folks are used to. Use it in the |\date| macro.
%    \begin{macrocode}
\def\today{\number\day\space\ifcase\month\or Jan\or Feb\or Mar\or Apr\or 
  May\or Jun\or Jul\or Aug\or Sep\or Oct\or Nov\or Dec\fi
  \space\number\year}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\narrowermargins}
%    \begin{macrocode}
\newcommand{\narrowermargins}{%
    \addtolength{\hoffset}{-0.5in}%
    \addtolength{\textwidth}{1in}%
    \addtolength{\marginparwidth}{-0.5in}%
    \addtolength{\voffset}{-0.5in}%
    \addtolength{\textheight}{1in}%
    % bring up bottom of text to match whitespace at top caused by security
    % label
    \addtolength{\textheight}{-2\baselineskip}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\makedodtitle}
% Use this macro instead of |\maketitle|, right after |\begin{document}|.
%    \begin{macrocode}
\newcommand{\makedodtitle}[0]{%
    \begin{titlepage}%
    \begin{center}%
    ~\vskip 1.5in%
    {\LARGE \@title \par}%
    \vskip 3em%
    {\large \lineskip .75em \begin{tabular}[t]{c}%
      \@author%
     \end{tabular}\par}%
    {\large \@date \par \large \@version}\vskip 0.5in%
    \includegraphics[width=0.4\textwidth]{org_logo}
    \end{center}\par%
    \@thanks\vskip 0.5in\par%
    \@distribution\par%
    \@destruction%
    \vfil\null
    \end{titlepage}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{environment}{changelog}
% \begin{macro}{\change}
% Usage: |\change| \marg{when} \marg{who} \marg{what}. For example,
% \begin{Verbatim}[gobble=2]
% \change{3 Aug 2011}{Jared Jennings}{Added backup plan}
% \end{Verbatim}
%
%    \begin{macrocode}
\newcommand{\change}[3]{%
    {#1} & {#2} & {#3}\\
}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\newenvironment{changelog}{
    \phantomsection
    \chapter*{Changelog}
    \addcontentsline{toc}{chapter}{Changelog}
    \begin{longtable}{@{\extracolsep{\fill}} l l p{4in}}
    \hline
    {\bf Date} & {\bf Person} & {\bf Change Description}\\
    \hline\hline
    \endhead
}{\end{longtable}}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{executivesummary}
% An ``executive summary,'' in the context of documents submitted as
% information assurance artifacts, means specifically a table of IA controls to
% which this document applies. Executive summaries can be built automatically
% by the shaney script, but must be included in the main document by means of
% the |\include| command.
%
% \begin{macro}{\executivesummaryiacontrol}
% Usage: |\executivesummaryiacontrol| \marg{IA control ID} \marg{IA control
% name}. Use only inside the executivesummary environment.
%    \begin{macrocode}
\newcommand{\executivesummaryiacontrol}[2]{%
    {#1} & {#2}\\
}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\newenvironment{executivesummary}{
    \phantomsection
    \chapter*{Executive Summary}
    \addcontentsline{toc}{chapter}{Executive Summary}
    The following table lists the NIST SP 800-53 Security Controls that are satisfied
    through this artifact.

    \begin{longtable}{@{\extracolsep{\fill}} l p{4in}}
    \hline
    {\bf IA Control Number} & {\bf IA Control Name}\\
    \hline\hline
    \endhead
}{\end{longtable}}
%    \end{macrocode}
% \end{environment}
\makeatother
% \Finale