-
Notifications
You must be signed in to change notification settings - Fork 1
/
14_security.po
1816 lines (1350 loc) · 123 KB
/
14_security.po
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
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
"POT-Creation-Date: 2015-10-06 16:10+0200\n"
"PO-Revision-Date: 2015-10-06 16:10+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
"Language: en-US \n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Publican v4.3.2\n"
msgid "Firewall"
msgstr ""
msgid "Netfilter"
msgstr ""
msgid "IDS/NIDS"
msgstr ""
msgid "Security"
msgstr ""
msgid "An information system can have a varying level of importance depending on the environment. In some cases, it is vital to a company's survival. It must therefore be protected from various kinds of risks. The process of evaluating these risks, defining and implementing the protection is collectively known as the “security process”."
msgstr ""
msgid "Defining a Security Policy"
msgstr ""
msgid "<emphasis>CAUTION</emphasis> Scope of this chapter"
msgstr ""
msgid "Security is a vast and very sensitive subject, so we cannot claim to describe it in any kind of comprehensive manner in the course of a single chapter. We will only delineate a few important points and describe some of the tools and methods that can be of use in the security domain. For further reading, literature abounds, and entire books have been devoted to the subject. An excellent starting point would be <citetitle>Linux Server Security</citetitle> by Michael D. Bauer (published by O'Reilly)."
msgstr ""
msgid "The word “security” itself covers a vast range of concepts, tools and procedures, none of which apply universally. Choosing among them requires a precise idea of what your goals are. Securing a system starts with answering a few questions. Rushing headlong into implementing an arbitrary set of tools runs the risk of focusing on the wrong aspects of security."
msgstr ""
msgid "The very first thing to determine is therefore the goal. A good approach to help with that determination starts with the following questions:"
msgstr ""
msgid "<emphasis>What</emphasis> are we trying to protect? The security policy will be different depending on whether we want to protect computers or data. In the latter case, we also need to know which data."
msgstr ""
msgid "What are we trying to protect <emphasis>against</emphasis>? Is it leakage of confidential data? Accidental data loss? Revenue loss caused by disruption of service?"
msgstr ""
msgid "Also, <emphasis>who</emphasis> are we trying to protect against? Security measures will be quite different for guarding against a typo by a regular user of the system than they would be when protecting against a determined attacker group."
msgstr ""
msgid "The term “risk” is customarily used to refer collectively to these three factors: what to protect, what needs to be prevented from happening, and who will try to make it happen. Modeling the risk requires answers to these three questions. From this risk model, a security policy can be constructed, and the policy can be implemented with concrete actions."
msgstr ""
msgid "<emphasis>NOTE</emphasis> Permanent questioning"
msgstr ""
msgid "Bruce Schneier, a world expert in security matters (not only computer security) tries to counter one of security's most important myths with a motto: “Security is a process, not a product”. Assets to be protected change in time, and so do threats and the means available to potential attackers. Even if a security policy has initially been perfectly designed and implemented, one should never rest on one's laurels. The risk components evolve, and the response to that risk must evolve accordingly."
msgstr ""
msgid "Extra constraints are also worth taking into account, as they can restrict the range of available policies. How far are we willing to go to secure a system? This question has a major impact on the policy to implement. The answer is too often only defined in terms of monetary costs, but the other elements should also be considered, such as the amount of inconvenience imposed on system users or performance degradation."
msgstr ""
msgid "Once the risk has been modeled, one can start thinking about designing an actual security policy."
msgstr ""
msgid "<emphasis>NOTE</emphasis> Extreme policies"
msgstr ""
msgid "There are cases where the choice of actions required to secure a system is extremely simple."
msgstr ""
msgid "For instance, if the system to be protected only comprises a second-hand computer, the sole use of which is to add a few numbers at the end of the day, deciding not to do anything special to protect it would be quite reasonable. The intrinsic value of the system is low. The value of the data is zero since they are not stored on the computer. A potential attacker infiltrating this “system” would only gain an unwieldy calculator. The cost of securing such a system would probably be greater than the cost of a breach."
msgstr ""
msgid "At the other end of the spectrum, we might want to protect the confidentiality of secret data in the most comprehensive way possible, trumping any other consideration. In this case, an appropriate response would be the total destruction of these data (securely erasing the files, shredding of the hard disks to bits, then dissolving these bits in acid, and so on). If there is an additional requirement that data must be kept in store for future use (although not necessarily readily available), and if cost still isn't a factor, then a starting point would be storing the data on iridium–platinum alloy plates stored in bomb-proof bunkers under various mountains in the world, each of which being (of course) both entirely secret and guarded by entire armies…"
msgstr ""
msgid "Extreme though these examples may seem, they would nevertheless be an adequate response to defined risks, insofar as they are the outcome of a thought process that takes into account the goals to reach and the constraints to fulfill. When coming from a reasoned decision, no security policy is less respectable than any other."
msgstr ""
msgid "In most cases, the information system can be segmented in consistent and mostly independent subsets. Each subsystem will have its own requirements and constraints, and so the risk assessment and the design of the security policy should be undertaken separately for each. A good principle to keep in mind is that a short and well-defined perimeter is easier to defend than a long and winding frontier. The network organization should also be designed accordingly: the sensitive services should be concentrated on a small number of machines, and these machines should only be accessible via a minimal number of check-points; securing these check-points will be easier than securing all the sensitive machines against the entirety of the outside world. It is at this point that the usefulness of network filtering (including by firewalls) becomes apparent. This filtering can be implemented with dedicated hardware, but a possibly simpler and more flexible solution is to use a software firewall such as the one integrated in the Linux kernel."
msgstr ""
msgid "Firewall or Packet Filtering"
msgstr ""
msgid "<primary>firewall</primary>"
msgstr ""
msgid "<primary>packet filter</primary>"
msgstr ""
msgid "<emphasis>BACK TO BASICS</emphasis> Firewall"
msgstr ""
msgid "<primary>packet</primary><secondary>IP</secondary>"
msgstr ""
msgid "A <emphasis>firewall</emphasis> is a piece of computer equipment with hardware and/or software that sorts the incoming or outgoing network packets (coming to or from a local network) and only lets through those matching certain predefined conditions."
msgstr ""
msgid "A firewall is a filtering network gateway and is only effective on packets that must go through it. Therefore, it can only be effective when going through the firewall is the only route for these packets."
msgstr ""
msgid "The lack of a standard configuration (and the “process, not product” motto) explains the lack of a turn-key solution. There are, however, tools that make it simpler to configure the <emphasis>netfilter</emphasis> firewall, with a graphical representation of the filtering rules. <command>fwbuilder</command> is undoubtedly among the best of them."
msgstr ""
msgid "<primary><emphasis>netfilter</emphasis></primary>"
msgstr ""
msgid "<emphasis>SPECIFIC CASE</emphasis> Local Firewall"
msgstr ""
msgid "A firewall can be restricted to one particular machine (as opposed to a complete network), in which case its role is to filter or limit access to some services, or possibly to prevent outgoing connections by rogue software that a user could, willingly or not, have installed."
msgstr ""
msgid "The Linux kernel embeds the <emphasis>netfilter</emphasis> firewall. It can be controlled from user space with the <command>iptables</command> and <command>ip6tables</command> commands. The difference between these two commands is that the former acts on the IPv4 network, whereas the latter acts on IPv6. Since both network protocol stacks will probably be around for many years, both tools will need to be used in parallel."
msgstr ""
msgid "<primary><command>iptables</command></primary>"
msgstr ""
msgid "<primary><command>ip6tables</command></primary>"
msgstr ""
msgid "Netfilter Behavior"
msgstr ""
msgid "<emphasis>netfilter</emphasis> uses four distinct tables which store rules regulating three kinds of operations on packets:"
msgstr ""
msgid "<literal>filter</literal> concerns filtering rules (accepting, refusing or ignoring a packet);"
msgstr ""
msgid "<literal>nat</literal> concerns translation of source or destination addresses and ports of packages;"
msgstr ""
msgid "<literal>mangle</literal> concerns other changes to the IP packets (including the ToS — <emphasis>Type of Service</emphasis> — field and options);"
msgstr ""
msgid "<literal>raw</literal> allows other manual modifications on packets before they reach the connection tracking system."
msgstr ""
msgid "Each table contains lists of rules called <emphasis>chains</emphasis>. The firewall uses standard chains to handle packets based on predefined circumstances. The administrator can create other chains, which will only be used when referred to by one of the standard chains (either directly or indirectly)."
msgstr ""
msgid "<primary>chain</primary>"
msgstr ""
msgid "<primary>filtering rule</primary>"
msgstr ""
msgid "The <literal>filter</literal> table has three standard chains:"
msgstr ""
msgid "<literal>INPUT</literal>: concerns packets whose destination is the firewall itself;"
msgstr ""
msgid "<literal>OUTPUT</literal>: concerns packets emitted by the firewall;"
msgstr ""
msgid "<literal>FORWARD</literal>: concerns packets transiting through the firewall (which is neither their source nor their destination)."
msgstr ""
msgid "The <literal>nat</literal> table also has three standard chains:"
msgstr ""
msgid "<literal>PREROUTING</literal>: to modify packets as soon as they arrive;"
msgstr ""
msgid "<literal>POSTROUTING</literal>: to modify packets when they are ready to go on their way;"
msgstr ""
msgid "<literal>OUTPUT</literal>: to modify packets generated by the firewall itself."
msgstr ""
msgid "How <emphasis>netfilter</emphasis> chains are called"
msgstr ""
msgid "Each chain is a list of rules; each rule is a set of conditions and an action to execute when the conditions are met. When processing a packet, the firewall scans the appropriate chain, one rule after another; when the conditions for one rule are met, it “jumps” (hence the <literal>-j</literal> option in the commands) to the specified action to continue processing. The most common behaviors are standardized, and dedicated actions exist for them. Taking one of these standard actions interrupts the processing of the chain, since the packet's fate is already sealed (barring an exception mentioned below):"
msgstr ""
msgid "<emphasis>BACK TO BASICS</emphasis> ICMP"
msgstr ""
msgid "ICMP (<emphasis>Internet Control Message </emphasis>Protocol) is the protocol used to transmit complementary information on communications. It allows testing network connectivity with the <command>ping</command> command (which sends an ICMP <emphasis>echo request</emphasis> message, which the recipient is meant to answer with an ICMP <emphasis>echo reply</emphasis> message). It signals a firewall rejecting a packet, indicates an overflow in a receive buffer, proposes a better route for the next packets in the connection, and so on. This protocol is defined by several RFC documents; the initial RFC777 and RFC792 were soon completed and extended. <ulink type=\"block\" url=\"http://www.faqs.org/rfcs/rfc777.html\" /> <ulink type=\"block\" url=\"http://www.faqs.org/rfcs/rfc792.html\" />"
msgstr ""
msgid "For reference, a receive buffer is a small memory zone storing data between the time it arrives from the network and the time the kernel handles it. If this zone is full, new data cannot be received, and ICMP signals the problem, so that the emitter can slow down its transfer rate (which should ideally reach an equilibrium after some time)."
msgstr ""
msgid "<primary>ICMP</primary>"
msgstr ""
msgid "<primary>Internet Control Message Protocol</primary>"
msgstr ""
msgid "<primary>receive buffer</primary>"
msgstr ""
msgid "<primary>buffer</primary><secondary>receive buffer</secondary>"
msgstr ""
msgid "<primary><command>ping</command></primary>"
msgstr ""
msgid "Note that although an IPv4 network can work without ICMP, ICMPv6 is strictly required for an IPv6 network, since it combines several functions that were, in the IPv4 world, spread across ICMPv4, IGMP (<emphasis>Internet Group Membership Protocol</emphasis>) and ARP (<emphasis>Address Resolution Protocol</emphasis>). ICMPv6 is defined in RFC4443. <ulink type=\"block\" url=\"http://www.faqs.org/rfcs/rfc4443.html\" />"
msgstr ""
msgid "<literal>ACCEPT</literal>: allow the packet to go on its way;"
msgstr ""
msgid "<literal>REJECT</literal>: reject the packet with an ICMP error packet (the <literal>--reject-with <replaceable>type</replaceable></literal> option to <command>iptables</command> allows selecting the type of error);"
msgstr ""
msgid "<literal>DROP</literal>: delete (ignore) the packet;"
msgstr ""
msgid "<literal>LOG</literal>: log (via <command>syslogd</command>) a message with a description of the packet; note that this action does not interrupt processing, and the execution of the chain continues at the next rule, which is why logging refused packets requires both a LOG and a REJECT/DROP rule;"
msgstr ""
msgid "<literal>ULOG</literal>: log a message via <command>ulogd</command>, which can be better adapted and more efficient than <command>syslogd</command> for handling large numbers of messages; note that this action, like LOG, also returns processing to the next rule in the calling chain;"
msgstr ""
msgid "<replaceable>chain_name</replaceable>: jump to the given chain and evaluate its rules;"
msgstr ""
msgid "<literal>RETURN</literal>: interrupt processing of the current chain, and return to the calling chain; in case the current chain is a standard one, there's no calling chain, so the default action (defined with the <literal>-P</literal> option to <command>iptables</command>) is executed instead;"
msgstr ""
msgid "<literal>SNAT</literal> (only in the <literal>nat</literal> table): apply <emphasis>Source NAT</emphasis> (extra options describe the exact changes to apply);"
msgstr ""
msgid "<literal>DNAT</literal> (only in the <literal>nat</literal> table): apply <emphasis>Destination NAT</emphasis> (extra options describe the exact changes to apply);"
msgstr ""
msgid "<literal>MASQUERADE</literal> (only in the <literal>nat</literal> table): apply <emphasis>masquerading</emphasis> (a special case of <emphasis>Source NAT</emphasis>);"
msgstr ""
msgid "<literal>REDIRECT</literal> (only in the <literal>nat</literal> table): redirect a packet to a given port of the firewall itself; this can be used to set up a transparent web proxy that works with no configuration on the client side, since the client thinks it connects to the recipient whereas the communications actually go through the proxy."
msgstr ""
msgid "Other actions, particularly those concerning the <literal>mangle</literal> table, are outside the scope of this text. The <citerefentry><refentrytitle>iptables</refentrytitle> <manvolnum>8</manvolnum></citerefentry> and <citerefentry><refentrytitle>ip6tables</refentrytitle> <manvolnum>8</manvolnum></citerefentry> have a comprehensive list."
msgstr ""
msgid "Syntax of <command>iptables</command> and <command>ip6tables</command>"
msgstr ""
msgid "The <command>iptables</command> and <command>ip6tables</command> commands allow manipulating tables, chains and rules. Their <literal>-t <replaceable>table</replaceable></literal> option indicates which table to operate on (by default, <literal>filter</literal>)."
msgstr ""
msgid "Commands"
msgstr ""
msgid "The <literal>-N <replaceable>chain</replaceable></literal> option creates a new chain. The <literal>-X <replaceable>chain</replaceable></literal> deletes an empty and unused chain. The <literal>-A <replaceable>chain</replaceable> <replaceable>rule</replaceable></literal> adds a rule at the end of the given chain. The <literal>-I <replaceable>chain</replaceable> <replaceable>rule_num</replaceable> <replaceable>rule</replaceable></literal> option inserts a rule before the rule number <replaceable>rule_num</replaceable>. The <literal>-D <replaceable>chain</replaceable> <replaceable>rule_num</replaceable></literal> (or <literal>-D <replaceable>chain</replaceable> <replaceable>rule</replaceable></literal>) option deletes a rule in a chain; the first syntax identifies the rule to be deleted by its number, while the latter identifies it by its contents. The <literal>-F <replaceable>chain</replaceable></literal> option flushes a chain (deletes all its rules); if no chain is mentioned, all the rules in the table are deleted. The <literal>-L <replaceable>chain</replaceable></literal> option lists the rules in the chain. Finally, the <literal>-P <replaceable>chain</replaceable> <replaceable>action</replaceable></literal> option defines the default action, or “policy”, for a given chain; note that only standard chains can have such a policy."
msgstr ""
msgid "Rules"
msgstr ""
msgid "Each rule is expressed as <literal><replaceable>conditions</replaceable> -j <replaceable>action</replaceable> <replaceable>action_options</replaceable></literal>. If several conditions are described in the same rule, then the criterion is the conjunction (logical <emphasis>and</emphasis>) of the conditions, which is at least as restrictive as each individual condition."
msgstr ""
msgid "The <literal>-p <replaceable>protocol</replaceable></literal> condition matches the protocol field of the IP packet. The most common values are <literal>tcp</literal>, <literal>udp</literal>, <literal>icmp</literal>, and <literal>icmpv6</literal>. Prefixing the condition with an exclamation mark negates the condition, which then becomes a match for “any packets with a different protocol than the specified one”. This negation mechanism is not specific to the <literal>-p</literal> option and it can be applied to all other conditions too."
msgstr ""
msgid "The <literal>-s <replaceable>address</replaceable></literal> or <literal>-s <replaceable>network/mask</replaceable></literal> condition matches the source address of the packet. Correspondingly, <literal>-d <replaceable>address</replaceable></literal> or <literal>-d <replaceable>network/mask</replaceable></literal> matches the destination address."
msgstr ""
msgid "The <literal>-i <replaceable>interface</replaceable></literal> condition selects packets coming from the given network interface. <literal>-o <replaceable>interface</replaceable></literal> selects packets going out on a specific interface."
msgstr ""
msgid "There are more specific conditions, depending on the generic conditions described above. For instance, the <literal>-p tcp</literal> condition can be complemented with conditions on the TCP ports, with clauses such as <literal>--source-port <replaceable>port</replaceable></literal> and <literal>--destination-port <replaceable>port</replaceable></literal>."
msgstr ""
msgid "The <literal>--state <replaceable>state</replaceable></literal> condition matches the state of a packet in a connection (this requires the <command>ipt_conntrack</command> kernel module, for connection tracking). The <literal>NEW</literal> state describes a packet starting a new connection; <literal>ESTABLISHED</literal> matches packets belonging to an already existing connection, and <literal>RELATED</literal> matches packets initiating a new connection related to an existing one (which is useful for the <literal>ftp-data</literal> connections in the “active” mode of the FTP protocol)."
msgstr ""
msgid "The previous section lists available actions, but not their respective options. The <literal>LOG</literal> action, for instance, has the following options:"
msgstr ""
msgid "<literal>--log-level</literal>, with default value <literal>warning</literal>, indicates the <command>syslog</command> severity level;"
msgstr ""
msgid "<literal>--log-prefix</literal> allows specifying a text prefix to differentiate between logged messages;"
msgstr ""
msgid "<literal>--log-tcp-sequence</literal>, <literal>--log-tcp-options</literal> and <literal>--log-ip-options</literal> indicate extra data to be integrated into the message: respectively, the TCP sequence number, TCP options, and IP options."
msgstr ""
msgid "The <literal>DNAT</literal> action provides the <literal>--to-destination <replaceable>address</replaceable>:<replaceable>port</replaceable></literal> option to indicate the new destination IP address and/or port. Similarly, <literal>SNAT</literal> provides <literal>--to-source <replaceable>address</replaceable>:<replaceable>port</replaceable></literal> to indicate the new source IP address and/or port."
msgstr ""
msgid "The <literal>REDIRECT</literal> action (only available if NAT is available) provides the <literal>--to-ports <replaceable>port(s)</replaceable></literal> option to indicate the port, or port range, where the packets should be redirected."
msgstr ""
msgid "Creating Rules"
msgstr ""
msgid "Each rule creation requires one invocation of <command>iptables</command>/<command>ip6tables</command>. Typing these commands manually can be tedious, so the calls are usually stored in a script so that the same configuration is set up automatically every time the machine boots. This script can be written by hand, but it can also be interesting to prepare it with a high-level tool such as <command>fwbuilder</command>."
msgstr ""
msgid "\n"
"<computeroutput># </computeroutput><userinput>apt install fwbuilder</userinput>"
msgstr ""
msgid "The principle is simple. In the first step, one needs to describe all the elements that will be involved in the actual rules:"
msgstr ""
msgid "the firewall itself, with its network interfaces;"
msgstr ""
msgid "the networks, with their corresponding IP ranges;"
msgstr ""
msgid "the servers;"
msgstr ""
msgid "the ports belonging to the services hosted on the servers."
msgstr ""
msgid "The rules are then created with simple drag-and-drop actions on the objects. A few contextual menus can change the condition (negating it, for instance). Then the action needs to be chosen and configured."
msgstr ""
msgid "As far as IPv6 is concerned, one can either create two distinct rulesets for IPv4 and IPv6, or create only one and let <command>fwbuilder</command> translate the rules according to the addresses assigned to the objects."
msgstr ""
msgid "Fwbuilder's main window"
msgstr ""
msgid "<primary><command>fwbuilder</command></primary>"
msgstr ""
msgid "<command>fwbuilder</command> can then generate a script configuring the firewall according to the rules that have been defined. Its modular architecture gives it the ability to generate scripts targeting different systems (<command>iptables</command> for Linux, <command>ipf</command> for FreeBSD and <command>pf</command> for OpenBSD)."
msgstr ""
msgid "Installing the Rules at Each Boot"
msgstr ""
msgid "In other cases, the recommended way is to register the configuration script in an <literal>up</literal> directive of the <filename>/etc/network/interfaces</filename> file. In the following example, the script is stored under <filename>/usr/local/etc/arrakis.fw</filename>."
msgstr ""
msgid "<filename>interfaces</filename> file calling firewall script"
msgstr ""
msgid ""
"auto eth0\n"
"iface eth0 inet static\n"
" address 192.168.0.1\n"
" network 192.168.0.0\n"
" netmask 255.255.255.0\n"
" broadcast 192.168.0.255\n"
" up /usr/local/etc/arrakis.fw"
msgstr ""
msgid "This obviously assumes that you are using <emphasis role=\"pkg\">ifupdown</emphasis> to configure the network interfaces. If you are using something else (like <emphasis>NetworkManager</emphasis> or <emphasis>systemd-networkd</emphasis>), then refer to their respective documentation to find out ways to execute a script after the interface has been brought up."
msgstr ""
msgid "Supervision: Prevention, Detection, Deterrence"
msgstr ""
msgid "<primary>monitoring</primary>"
msgstr ""
msgid "Monitoring is an integral part of any security policy for several reasons. Among them, that the goal of security is usually not restricted to guaranteeing data confidentiality, but it also includes ensuring availability of the services. It is therefore imperative to check that everything works as expected, and to detect in a timely manner any deviant behavior or change in quality of the service(s) rendered. Monitoring activity can help detecting intrusion attempts and enable a swift reaction before they cause grave consequences. This section reviews some tools that can be used to monitor several aspects of a Debian system. As such, it completes <xref linkend=\"sect.monitoring\" />."
msgstr ""
msgid "Monitoring Logs with <command>logcheck</command>"
msgstr ""
msgid "<primary><command>logcheck</command></primary>"
msgstr ""
msgid "<primary>logs</primary><secondary>monitoring</secondary>"
msgstr ""
msgid "<primary>monitoring</primary><secondary>log files</secondary>"
msgstr ""
msgid "The <command>logcheck</command> program monitors log files every hour by default. It sends unusual log messages in emails to the administrator for further analysis."
msgstr ""
msgid "The list of monitored files is stored in <filename>/etc/logcheck/logcheck.logfiles</filename>; the default values work fine if the <filename>/etc/rsyslog.conf</filename> file has not been completely overhauled."
msgstr ""
msgid "<command>logcheck</command> can work in one of three more or less detailed modes: <emphasis>paranoid</emphasis>, <emphasis>server</emphasis> and <emphasis>workstation</emphasis>. The first one is <emphasis>very</emphasis> verbose, and should probably be restricted to specific servers such as firewalls. The second (and default) mode is recommended for most servers. The last one is designed for workstations, and is even terser (it filters out more messages)."
msgstr ""
msgid "In all three cases, <command>logcheck</command> should probably be customized to exclude some extra messages (depending on installed services), unless the admin really wishes to receive hourly batches of long uninteresting emails. Since the message selection mechanism is rather complex, <filename>/usr/share/doc/logcheck-database/README.logcheck-database.gz</filename> is a required — if challenging — read."
msgstr ""
msgid "The applied rules can be split into several types:"
msgstr ""
msgid "those that qualify a message as a cracking attempt (stored in a file in the <filename>/etc/logcheck/cracking.d/</filename> directory);"
msgstr ""
msgid "those canceling such a qualification (<filename>/etc/logcheck/cracking.ignore.d/</filename>);"
msgstr ""
msgid "those classifying a message as a security alert (<filename>/etc/logcheck/violations.d/</filename>);"
msgstr ""
msgid "those canceling this classification (<filename>/etc/logcheck/violations.ignore.d/</filename>);"
msgstr ""
msgid "finally, those applying to the remaining messages (considered as <emphasis>system events</emphasis>)."
msgstr ""
msgid "<emphasis>CAUTION</emphasis> Ignoring a message"
msgstr ""
msgid "Any message tagged as a cracking attempt or a security alert (following a rule stored in a <filename>/etc/logcheck/violations.d/myfile</filename> file) can only be ignored by a rule in a <filename>/etc/logcheck/violations.ignore.d/myfile</filename> or <filename>/etc/logcheck/violations.ignore.d/myfile-<replaceable>extension</replaceable></filename> file."
msgstr ""
msgid "A system event is always signaled unless a rule in one of the <filename>/etc/logcheck/ignore.d.{paranoid,server,workstation}/</filename> directories states the event should be ignored. Of course, the only directories taken into account are those corresponding to verbosity levels equal or greater than the selected operation mode."
msgstr ""
msgid "Monitoring Activity"
msgstr ""
msgid "<primary>monitoring</primary><secondary>activity</secondary>"
msgstr ""
msgid "<primary>activity, monitoring</primary>"
msgstr ""
msgid "In Real Time"
msgstr ""
msgid "<command>top</command> is an interactive tool that displays a list of currently running processes. The default sorting is based on the current amount of processor use and can be obtained with the <keycap>P</keycap> key. Other sort orders include a sort by occupied memory (<keycap>M</keycap> key), by total processor time (<keycap>T</keycap> key) and by process identifier (<keycap>N</keycap> key). The <keycap>k</keycap> key allows killing a process by entering its process identifier. The <keycap>r</keycap> key allows <emphasis>renicing</emphasis> a process, i.e. changing its priority."
msgstr ""
msgid "<primary><command>top</command></primary>"
msgstr ""
msgid "When the system seems to be overloaded, <command>top</command> is a great tool to see which processes are competing for processor time or consume too much memory. In particular, it is often interesting to check if the processes consuming resources match the real services that the machine is known to host. An unknown process running as the www-data user should really stand out and be investigated, since it's probably an instance of software installed and executed on the system through a vulnerability in a web application."
msgstr ""
msgid "<command>top</command> is a very flexible tool and its manual page gives details on how to customize its display and adapt it to one's personal needs and habits."
msgstr ""
msgid "The <command>gnome-system-monitor</command> graphical tool is similar to <command>top</command> and it provides roughly the same features."
msgstr ""
msgid "<primary><command>gnome-system-monitor</command></primary>"
msgstr ""
msgid "History"
msgstr ""
msgid "<primary>activity, history</primary>"
msgstr ""
msgid "Processor load, network traffic and free disk space are information that are constantly varying. Keeping a history of their evolution is often useful in determining exactly how the computer is used."
msgstr ""
msgid "<primary>SNMP</primary>"
msgstr ""
msgid "<primary>Simple Network Management Protocol</primary>"
msgstr ""
msgid "There are many dedicated tools for this task. Most can fetch data via SNMP (<emphasis>Simple Network Management Protocol</emphasis>) in order to centralize this information. An added benefit is that this allows fetching data from network elements that may not be general-purpose computers, such as dedicated network routers or switches."
msgstr ""
msgid "This book deals with Munin in some detail (see <xref linkend=\"sect.munin\" />) as part of <xref linkend=\"advanced-administration\" xrefstyle=\"select: label quotedtitle\" />. Debian also provides a similar tool, <emphasis role=\"pkg\">cacti</emphasis>. Its deployment is slightly more complex, since it is based solely on SNMP. Despite having a web interface, grasping the concepts involved in configuration still requires some effort. Reading the HTML documentation (<filename>/usr/share/doc/cacti/html/index.html</filename>) should be considered a prerequisite."
msgstr ""
msgid "<emphasis>ALTERNATIVE</emphasis> <command>mrtg</command>"
msgstr ""
msgid "<primary><command>mrtg</command></primary>"
msgstr ""
msgid "<command>mrtg</command> (in the similarly-named package) is an older tool. Despite some rough edges, it can aggregate historical data and display them as graphs. It includes a number of scripts dedicated to collecting the most commonly monitored data such as processor load, network traffic, web page hits, and so on."
msgstr ""
msgid "The <emphasis role=\"pkg\">mrtg-contrib</emphasis> and <emphasis role=\"pkg\">mrtgutils</emphasis> packages contain example scripts that can be used directly."
msgstr ""
msgid "Detecting Changes"
msgstr ""
msgid "Once the system is installed and configured, and barring security upgrades, there's usually no reason for most of the files and directories to evolve, data excepted. It is therefore interesting to make sure that files actually do not change: any unexpected change would therefore be worth investigating. This section presents a few tools able to monitor files and to warn the administrator when an unexpected change occurs (or simply to list such changes)."
msgstr ""
msgid "Auditing Packages with <command>dpkg --verify</command>"
msgstr ""
msgid "<primary><command>dpkg</command></primary><secondary><command>dpkg --verify</command></secondary>"
msgstr ""
msgid "<emphasis>GOING FURTHER</emphasis> Protecting against upstream changes"
msgstr ""
msgid "<command>dpkg --verify</command> is useful in detecting changes to files coming from a Debian package, but it will be useless if the package itself is compromised, for instance if the Debian mirror is compromised. Protecting against this class of attacks involves using APT's digital signature verification system (see <xref linkend=\"sect.package-authentication\" />), and taking care to only install packages from a certified origin."
msgstr ""
msgid "<command>dpkg --verify</command> (or <command>dpkg -V</command>) is an interesting tool since it allows finding what installed files have been modified (potentially by an attacker), but this should be taken with a grain of salt. To do its job it relies on checksums stored in dpkg's own database which is stored on the hard disk (they can be found in <filename>/var/lib/dpkg/info/<replaceable>package</replaceable>.md5sums</filename>); a thorough attacker will therefore update these files so they contain the new checksums for the subverted files."
msgstr ""
msgid "<emphasis>BACK TO BASICS</emphasis> File fingerprint"
msgstr ""
msgid "<primary>fingerprint</primary>"
msgstr ""
msgid "<primary>control sum</primary>"
msgstr ""
msgid "<primary>MD5</primary>"
msgstr ""
msgid "<primary>SHA1</primary>"
msgstr ""
msgid "As a reminder: a fingerprint is a value, often a number (even though in hexadecimal notation), that contains a kind of signature for the contents of a file. This signature is calculated with an algorithm (MD5 or SHA1 being well-known examples) that more or less guarantee that even the tiniest change in the file contents implies a change in the fingerprint; this is known as the “avalanche effect”. This allows a simple numerical fingerprint to serve as a litmus test to check whether the contents of a file have been altered. These algorithms are not reversible; in other words, for most of them, knowing a fingerprint doesn't allow finding the corresponding contents. Recent mathematical advances seem to weaken the absoluteness of these principles, but their use is not called into question so far, since creating different contents yielding the same fingerprint still seems to be quite a difficult task."
msgstr ""
msgid "Running <command>dpkg -V</command> will verify all installed packages and will print out a line for each file with a failing test. The output format is the same as the one of <command>rpm -V</command> where each character denotes a test on some specific meta-data. Unfortunately <command>dpkg</command> does not store the meta-data needed for most tests and will thus output question marks for them. Currently only the checksum test can yield a \"5\" on the third character (when it fails)."
msgstr ""
msgid ""
"\n"
"<computeroutput># </computeroutput><userinput>dpkg -V</userinput>\n"
"<computeroutput>??5?????? /lib/systemd/system/ssh.service\n"
"??5?????? c /etc/libvirt/qemu/networks/default.xml\n"
"??5?????? c /etc/lvm/lvm.conf\n"
"??5?????? c /etc/salt/roster</computeroutput>"
msgstr ""
msgid "In the sample above, dpkg reports a change to SSH's service file that the administrator made to the packaged file instead of using an appropriate <filename>/etc/systemd/system/ssh.service</filename> override (which would be stored below <filename>/etc</filename> like any configuration change should be). It also lists multiple configuration files (identified by the \"c\" letter on the second field) that had been legitimately modified."
msgstr ""
msgid "Auditing Packages: <command>debsums</command> and its Limits"
msgstr ""
msgid "<primary><command>debsums</command></primary>"
msgstr ""
msgid "<command>debsums</command> is the ancestor of <command>dpkg -V</command> and is thus mostly obsolete. It suffers from the same limitations than dpkg. Fortunately, some of the limitations can be worked-around (whereas dpkg does not offer similar work-arounds)."
msgstr ""
msgid "Since the data on the disk cannot be trusted, <command>debsums</command> offers to do its checks based on <filename>.deb</filename> files instead of relying on dpkg's database. To download trusted <filename>.deb</filename> files of all the packages installed, we can rely on APT's authenticated downloads. This operation can be slow and tedious, and should therefore not be considered a proactive technique to be used on a regular basis."
msgstr ""
msgid ""
"\n"
"<computeroutput># </computeroutput><userinput>apt-get --reinstall -d install `grep-status -e 'Status: install ok installed' -n -s Package`</userinput>\n"
"<computeroutput>[ ... ]\n"
"# </computeroutput><userinput>debsums -p /var/cache/apt/archives --generate=all</userinput>"
msgstr ""
msgid "Note that this example uses the <command>grep-status</command> command from the <emphasis role=\"pkg\">dctrl-tools</emphasis> package, which is not installed by default."
msgstr ""
msgid "Monitoring Files: AIDE"
msgstr ""
msgid "<primary><emphasis role=\"pkg\">aide</emphasis> (Debian package)</primary>"
msgstr ""
msgid "The AIDE tool (<emphasis>Advanced Intrusion Detection Environment</emphasis>) allows checking file integrity, and detecting any change against a previously recorded image of the valid system. This image is stored as a database (<filename>/var/lib/aide/aide.db</filename>) containing the relevant information on all files of the system (fingerprints, permissions, timestamps and so on). This database is first initialized with <command>aideinit</command>; it is then used daily (by the <filename>/etc/cron.daily/aide</filename> script) to check that nothing relevant changed. When changes are detected, AIDE records them in log files (<filename>/var/log/aide/*.log</filename>) and sends its findings to the administrator by email."
msgstr ""
msgid "<emphasis>IN PRACTICE</emphasis> Protecting the database"
msgstr ""
msgid "Since AIDE uses a local database to compare the states of the files, the validity of its results is directly linked to the validity of the database. If an attacker gets root permissions on a compromised system, they will be able to replace the database and cover their tracks. A possible workaround would be to store the reference data on read-only storage media."
msgstr ""
msgid "Many options in <filename>/etc/default/aide</filename> can be used to tweak the behavior of the <emphasis role=\"pkg\">aide</emphasis> package. The AIDE configuration proper is stored in <filename>/etc/aide/aide.conf</filename> and <filename>/etc/aide/aide.conf.d/</filename> (actually, these files are only used by <command>update-aide.conf</command> to generate <filename>/var/lib/aide/aide.conf.autogenerated</filename>). Configuration indicates which properties of which files need to be checked. For instance, the contents of log files changes routinely, and such changes can be ignored as long as the permissions of these files stay the same, but both contents and permissions of executable programs must be constant. Although not very complex, the configuration syntax is not fully intuitive, and reading the <citerefentry><refentrytitle>aide.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manual page is therefore recommended."
msgstr ""
msgid "A new version of the database is generated daily in <filename>/var/lib/aide/aide.db.new</filename>; if all recorded changes were legitimate, it can be used to replace the reference database."
msgstr ""
msgid "<emphasis>ALTERNATIVE</emphasis> Tripwire and Samhain"
msgstr ""
msgid "Tripwire is very similar to AIDE; even the configuration file syntax is almost the same. The main addition provided by <emphasis role=\"pkg\">tripwire</emphasis> is a mechanism to sign the configuration file, so that an attacker cannot make it point at a different version of the reference database."
msgstr ""
msgid "Samhain also offers similar features, as well as some functions to help detecting rootkits (see the sidebar <xref linkend=\"sidebar.the-checksecurity-and-chkrootkit-rkhunter-packages\" />). It can also be deployed globally on a network, and record its traces on a central server (with a signature)."
msgstr ""
msgid "<emphasis>QUICK LOOK</emphasis> The <emphasis role=\"pkg\">checksecurity</emphasis> and <emphasis role=\"pkg\">chkrootkit</emphasis>/<emphasis role=\"pkg\">rkhunter</emphasis> packages"
msgstr ""
msgid "<primary><emphasis role=\"pkg\">checksecurity</emphasis></primary>"
msgstr ""
msgid "The first of these packages contains several small scripts performing basic checks on the system (empty passwords, new setuid files, and so on) and warning the administrator if required. Despite its explicit name, an administrator should not rely solely on it to make sure a Linux system is secure."
msgstr ""
msgid "The <emphasis role=\"pkg\">chkrootkit</emphasis> and <emphasis role=\"pkg\">rkhunter</emphasis> packages allow looking for <emphasis>rootkits</emphasis> potentially installed on the system. As a reminder, these are pieces of software designed to hide the compromise of a system while discreetly keeping control of the machine. The tests are not 100% reliable, but they can usually draw the administrator's attention to potential problems."
msgstr ""
msgid "Detecting Intrusion (IDS/NIDS)"
msgstr ""
msgid "<primary>detection, intrusion</primary>"
msgstr ""
msgid "<primary>intrusion detection</primary>"
msgstr ""
msgid "<primary>IDS</primary>"
msgstr ""
msgid "<primary>intrusion detection system</primary>"
msgstr ""
msgid "<primary>NIDS</primary>"
msgstr ""
msgid "<primary>Network</primary><secondary>IDS</secondary>"
msgstr ""
msgid "<emphasis>BACK TO BASICS</emphasis> Denial of service"
msgstr ""
msgid "<primary>denial of service</primary>"
msgstr ""
msgid "A “denial of service” attack has only one goal: to make a service unavailable. Whether such an attack involves overloading the server with queries or exploiting a bug, the end result is the same: the service is no longer operational. Regular users are unhappy, and the entity hosting the targeted network service suffers a loss in reputation (and possibly in revenue, for instance if the service was an e-commerce site)."
msgstr ""
msgid "Such an attack is sometimes “distributed”; this usually involves overloading the server with large numbers of queries coming from many different sources so that the server becomes unable to answer the legitimate queries. These types of attacks have gained well-known acronyms: <acronym>DDoS</acronym> and <acronym>DoS</acronym> (depending on whether the denial of service attack is distributed or not)."
msgstr ""
msgid "<command>suricata</command> (in the Debian package of the same name) is a NIDS — a <emphasis>Network Intrusion Detection System</emphasis>. Its function is to listen to the network and try to detect infiltration attempts and/or hostile acts (including denial of service attacks). All these events are logged in multiple files in <filename>/var/log/suricata</filename>. There are third party tools (Kibana/logstash) to better browse all the data collected. <ulink type=\"block\" url=\"http://suricata-ids.org\" /> <ulink type=\"block\" url=\"https://www.elastic.co/products/kibana\" />"
msgstr ""
msgid "<primary><command>snort</command></primary>"
msgstr ""
msgid "<primary><command>suricata</command></primary>"
msgstr ""
msgid "<emphasis>CAUTION</emphasis> Range of action"
msgstr ""
msgid "The effectiveness of <command>suricata</command> is limited by the traffic seen on the monitored network interface. It will obviously not be able to detect anything if it cannot observe the real traffic. When plugged into a network switch, it will therefore only monitor attacks targeting the machine it runs on, which is probably not the intention. The machine hosting <command>suricata</command> should therefore be plugged into the “mirror” port of the switch, which is usually dedicated to chaining switches and therefore gets all the traffic."
msgstr ""
msgid "Configuring suricata involves reviewing and editing <filename>/etc/suricata/suricata-debian.yaml</filename>, which is very long because each parameter is abundantly commented. A minimal configuration requires describing the range of addresses that the local network covers (<literal>HOME_NET</literal> parameter). In practice, this means the set of all potential attack targets. But getting the most of it requires reading it in full and adapting it to the local situation."
msgstr ""
msgid "On top of this, you should also edit <filename>/etc/default/suricata</filename> to define the network interface to monitor and to enable the init script (by setting <literal>RUN=yes</literal>). You might also want to set <literal>LISTENMODE=pcap</literal> because the default <literal>LISTENMODE=nfqueue</literal> requires further configuration to work properly (the netfilter firewall must be configured to pass packets to some user-space queue handled by suricata via the <literal>NFQUEUE</literal> target)."
msgstr ""
msgid "To detect bad behaviour, <command>suricata</command> needs a set of monitoring rules: you can find such rules in the <emphasis role=\"pkg\">snort-rules-default</emphasis> package. <command>snort</command> is the historical reference in the IDS ecosystem and <command>suricata</command> is able to reuse rules written for it. Unfortunately that package is missing from <emphasis role=\"distribution\">Debian Jessie</emphasis> and should be retrieved from another Debian release like <emphasis role=\"distribution\">Testing</emphasis> or <emphasis role=\"distribution\">Unstable</emphasis>."
msgstr ""
msgid "Alternatively, <command>oinkmaster</command> (in the package of the same name) can be used to download Snort rulesets from external sources."
msgstr ""
msgid "<emphasis>GOING FURTHER</emphasis> Integration with <command>prelude</command>"
msgstr ""
msgid "Prelude brings centralized monitoring of security information. Its modular architecture includes a server (the <emphasis>manager</emphasis> in <emphasis role=\"pkg\">prelude-manager</emphasis>) which gathers alerts generated by <emphasis>sensors</emphasis> of various types."
msgstr ""
msgid "Suricata can be configured as such a sensor. Other possibilities include <emphasis>prelude-lml</emphasis> (<emphasis>Log Monitor Lackey</emphasis>) which monitors log files (in a manner similar to <command>logcheck</command>, described in <xref linkend=\"sect.logcheck\" />)."
msgstr ""
msgid "<primary><command>prelude</command></primary>"
msgstr ""
msgid "Introduction to AppArmor"
msgstr ""
msgid "<primary>AppArmor</primary>"
msgstr ""
msgid "Principles"
msgstr ""
msgid "AppArmor is a <emphasis>Mandatory Access Control</emphasis> (MAC) system built on Linux's LSM (<emphasis>Linux Security Modules</emphasis>) interface. In practice, the kernel queries AppArmor before each system call to know whether the process is authorized to do the given operation. Through this mechanism, AppArmor confines programs to a limited set of resources."
msgstr ""
msgid "<primary><emphasis>Mandatory Access Control</emphasis></primary>"
msgstr ""
msgid "<primary><emphasis>Linux Security Modules</emphasis></primary>"
msgstr ""
msgid "AppArmor applies a set of rules (known as “profile”) on each program. The profile applied by the kernel depends on the installation path of the program being executed. Contrary to SELinux (discussed in <xref linkend=\"sect.selinux\" />), the rules applied do not depend on the user. All users face the same set of rules when they are executing the same program (but traditional user permissions still apply and might result in different behaviour!)."
msgstr ""
msgid "AppArmor profiles are stored in <filename>/etc/apparmor.d/</filename> and they contain a list of access control rules on resources that each program can make use of. The profiles are compiled and loaded into the kernel by the <command>apparmor_parser</command> command. Each profile can be loaded either in enforcing or complaining mode. The former enforces the policy and reports violation attempts, while the latter does not enforce the policy but still logs the system calls that would have been denied."
msgstr ""
msgid "Enabling AppArmor and managing AppArmor profiles"
msgstr ""
msgid "AppArmor support is built into the standard kernels provided by Debian. Enabling AppArmor is thus just a matter of installing a few packages and adding some parameters to the kernel command line:"
msgstr ""
msgid ""
"<computeroutput># </computeroutput><userinput>apt install apparmor apparmor-profiles apparmor-utils\n"
"</userinput><computeroutput>[...]\n"
"# </computeroutput><userinput>perl -pi -e 's,GRUB_CMDLINE_LINUX=\"(.*)\"$,GRUB_CMDLINE_LINUX=\"$1 apparmor=1 security=apparmor\",' /etc/default/grub\n"
"</userinput><computeroutput># </computeroutput><userinput>update-grub\n"
"</userinput>"
msgstr ""
msgid "After a reboot, AppArmor is now functional and <command>aa-status</command> will confirm it quickly:"
msgstr ""
msgid ""
"\n"
"<computeroutput># </computeroutput><userinput>aa-status</userinput>\n"
"<computeroutput>apparmor module is loaded.\n"
"44 profiles are loaded.\n"
"9 profiles are in enforce mode.\n"
" /usr/bin/lxc-start\n"
" /usr/lib/chromium-browser/chromium-browser//browser_java\n"
"[...]\n"
"35 profiles are in complain mode.\n"
" /sbin/klogd\n"
"[...]\n"
"3 processes have profiles defined.\n"
"1 processes are in enforce mode.\n"
" /usr/sbin/libvirtd (1295) \n"
"2 processes are in complain mode.\n"
" /usr/sbin/avahi-daemon (941) \n"
" /usr/sbin/avahi-daemon (1000) \n"
"0 processes are unconfined but have a profile defined.</computeroutput>"
msgstr ""
msgid "<emphasis>NOTE</emphasis> More AppArmor profiles"
msgstr ""
msgid "The <emphasis role=\"pkg\">apparmor-profiles</emphasis> package contains profiles managed by the upstream AppArmor community. To get even more profiles you can install <emphasis role=\"pkg\">apparmor-profiles-extra</emphasis> which contains profiles developed by Ubuntu and Debian."
msgstr ""
msgid "The state of each profile can be switched between enforcing and complaining with calls to <command>aa-enforce</command> and <command>aa-complain</command> giving as parameter either the path of the executable or the path to the policy file. Additionaly a profile can be entirely disabled with <command>aa-disable</command> or put in audit mode (to log accepted system calls too) with <command>aa-audit</command>."
msgstr ""
msgid ""
"\n"
"<computeroutput># </computeroutput><userinput>aa-enforce /usr/sbin/avahi-daemon</userinput>\n"
"<computeroutput>Setting /usr/sbin/avahi-daemon to enforce mode.</computeroutput>\n"
"<computeroutput># </computeroutput><userinput>aa-complain /etc/apparmor.d/usr.bin.lxc-start</userinput>\n"
"<computeroutput>Setting /etc/apparmor.d/usr.bin.lxc-start to complain mode.</computeroutput>\n"
" "
msgstr ""
msgid "Creating a new profile"
msgstr ""
msgid "Even though creating an AppArmor profile is rather easy, most programs do not have one. This section will show you how to create a new profile from scratch just by using the target program and letting AppArmor monitor the system call it makes and the resources it accesses."
msgstr ""
msgid "The most important programs that need to be confined are the network facing programs as those are the most likely targets of remote attackers. That is why AppArmor conveniently provides an <command>aa-unconfined</command> command to list the programs which have no associated profile and which expose an open network socket. With the <literal>--paranoid</literal> option you get all unconfined processes that have at least one active network connection."
msgstr ""
msgid ""
"\n"
"<computeroutput># </computeroutput><userinput>aa-unconfined</userinput>\n"
"<computeroutput>801 /sbin/dhclient not confined\n"
"890 /sbin/rpcbind not confined\n"
"899 /sbin/rpc.statd not confined\n"
"929 /usr/sbin/sshd not confined\n"
"941 /usr/sbin/avahi-daemon confined by '/usr/sbin/avahi-daemon (complain)'\n"
"988 /usr/sbin/minissdpd not confined\n"
"1276 /usr/sbin/exim4 not confined\n"
"1485 /usr/lib/erlang/erts-6.2/bin/epmd not confined\n"
"1751 /usr/lib/erlang/erts-6.2/bin/beam.smp not confined\n"
"19592 /usr/lib/dleyna-renderer/dleyna-renderer-service not confined</computeroutput>\n"
" "
msgstr ""
msgid "In the following example, we will thus try to create a profile for <command>/sbin/dhclient</command>. For this we will use <command>aa-genprof dhclient</command>. It will invite you to use the application in another window and when done to come back to <command>aa-genprof</command> to scan for AppArmor events in the system logs and convert those logs into access rules. For each logged event, it will make one or more rule suggestions that you can either approve or further edit in multiple ways:"
msgstr ""
msgid ""
"\n"
"<computeroutput># </computeroutput><userinput>aa-genprof dhclient</userinput>\n"
"<computeroutput>Writing updated profile for /sbin/dhclient.\n"
"Setting /sbin/dhclient to complain mode.\n"
"\n"
"Before you begin, you may wish to check if a\n"
"profile already exists for the application you\n"
"wish to confine. See the following wiki page for\n"
"more information:\n"
"http://wiki.apparmor.net/index.php/Profiles\n"
"\n"
"Please start the application to be profiled in\n"
"another window and exercise its functionality now.\n"
"\n"
"Once completed, select the \"Scan\" option below in \n"
"order to scan the system logs for AppArmor events. \n"
"\n"
"For each AppArmor event, you will be given the \n"
"opportunity to choose whether the access should be \n"
"allowed or denied.\n"
"\n"
"Profiling: /sbin/dhclient\n"
"\n"
"[(S)can system log for AppArmor events] / (F)inish\n"
"Reading log entries from /var/log/audit/audit.log.\n"
"\n"
"Profile: /sbin/dhclient <co id=\"aa-genprof-execute\"></co>\n"
"Execute: /usr/lib/NetworkManager/nm-dhcp-helper\n"
"Severity: unknown\n"
"\n"
"(I)nherit / (C)hild / (P)rofile / (N)amed / (U)nconfined / (X) ix On / (D)eny / Abo(r)t / (F)inish\n"
"<userinput>P</userinput>\n"
"Should AppArmor sanitise the environment when\n"
"switching profiles?\n"
"\n"
"Sanitising environment is more secure,\n"
"but some applications depend on the presence\n"
"of LD_PRELOAD or LD_LIBRARY_PATH.\n"
"\n"
"(Y)es / [(N)o]\n"
"<userinput>Y</userinput>\n"
"Writing updated profile for /usr/lib/NetworkManager/nm-dhcp-helper.\n"
"Complain-mode changes:\n"
"WARN: unknown capability: CAP_net_raw\n"
"\n"
"Profile: /sbin/dhclient <co id=\"aa-genprof-capability\"></co>\n"
"Capability: net_raw\n"
"Severity: unknown\n"
"\n"
"[(A)llow] / (D)eny / (I)gnore / Audi(t) / Abo(r)t / (F)inish\n"
"<userinput>A</userinput>\n"
"Adding capability net_raw to profile.\n"
"\n"
"Profile: /sbin/dhclient <co id=\"aa-genprof-read\"></co>\n"
"Path: /etc/nsswitch.conf\n"
"Mode: r\n"
"Severity: unknown\n"
"\n"
" 1 - #include <abstractions/apache2-common> \n"
" 2 - #include <abstractions/libvirt-qemu> \n"
" 3 - #include <abstractions/nameservice> \n"
" 4 - #include <abstractions/totem> \n"
" [5 - /etc/nsswitch.conf]\n"
"[(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore\n"
"<userinput>3</userinput>\n"
"\n"
"Profile: /sbin/dhclient\n"
"Path: /etc/nsswitch.conf\n"
"Mode: r\n"
"Severity: unknown\n"
"\n"
" 1 - #include <abstractions/apache2-common> \n"
" 2 - #include <abstractions/libvirt-qemu> \n"
" [3 - #include <abstractions/nameservice>]\n"
" 4 - #include <abstractions/totem> \n"
" 5 - /etc/nsswitch.conf \n"
"[(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore\n"
"<userinput>A</userinput>\n"
"Adding #include <abstractions/nameservice> to profile.\n"
"\n"
"Profile: /sbin/dhclient\n"
"Path: /proc/7252/net/dev\n"
"Mode: r\n"
"Severity: 6\n"
"\n"
" 1 - /proc/7252/net/dev \n"
" [2 - /proc/*/net/dev]\n"
"[(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore\n"
"<userinput>A</userinput>\n"
"Adding /proc/*/net/dev r to profile\n"
"\n"
"[...]\n"
"Profile: /sbin/dhclient <co id=\"aa-genprof-write\"></co>\n"
"Path: /run/dhclient-eth0.pid\n"
"Mode: w\n"
"Severity: unknown\n"
"\n"
" [1 - /run/dhclient-eth0.pid]\n"
"[(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore\n"
"<userinput>N</userinput>\n"
"\n"
"Enter new path: /run/dhclient*.pid\n"
"\n"
"Profile: /sbin/dhclient\n"
"Path: /run/dhclient-eth0.pid\n"
"Mode: w\n"
"Severity: unknown\n"
"\n"
" 1 - /run/dhclient-eth0.pid \n"
" [2 - /run/dhclient*.pid]\n"
"[(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore\n"
"<userinput>A</userinput>\n"
"Adding /run/dhclient*.pid w to profile\n"
"\n"
"[...]\n"
"Profile: /usr/lib/NetworkManager/nm-dhcp-helper <co id=\"aa-genprof-other-profile\"></co>\n"
"Path: /proc/filesystems\n"
"Mode: r\n"
"Severity: 6\n"
"\n"
" [1 - /proc/filesystems]\n"
"[(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore\n"
"<userinput>A</userinput>\n"
"Adding /proc/filesystems r to profile\n"
"\n"
"= Changed Local Profiles =\n"
"\n"
"The following local profiles were changed. Would you like to save them?\n"
"\n"
" [1 - /sbin/dhclient]\n"
" 2 - /usr/lib/NetworkManager/nm-dhcp-helper \n"
"(S)ave Changes / Save Selec(t)ed Profile / [(V)iew Changes] / View Changes b/w (C)lean profiles / Abo(r)t\n"
"<userinput>S</userinput>\n"
"Writing updated profile for /sbin/dhclient.\n"
"Writing updated profile for /usr/lib/NetworkManager/nm-dhcp-helper.\n"
"\n"
"Profiling: /sbin/dhclient\n"
"\n"
"[(S)can system log for AppArmor events] / (F)inish\n"
"<userinput>F</userinput>\n"
"Setting /sbin/dhclient to enforce mode.\n"
"Setting /usr/lib/NetworkManager/nm-dhcp-helper to enforce mode.\n"
"\n"
"Reloaded AppArmor profiles in enforce mode.\n"
"\n"
"Please consider contributing your new profile!\n"
"See the following wiki page for more information:\n"
"http://wiki.apparmor.net/index.php/Profiles\n"
"\n"
"Finished generating profile for /sbin/dhclient.</computeroutput>"
msgstr ""
msgid "Note that the program does not display back the control characters that you type but for the clarity of the explanation I have included them in the previous transcript."
msgstr ""
msgid "The first event detected is the execution of another program. In that case, you have multiple choices: you can run the program with the profile of the parent process (the “Inherit” choice), you can run it with its own dedicated profile (the “Profile” and the “Named” choices, differing only by the possibility to use an arbitrary profile name), you can run it with a sub-profile of the parent process (the “Child” choice), you can run it without any profile (the “Unconfined” choice) or you can decide to not run it at all (the “Deny” choice)."
msgstr ""
msgid "Note that when you opt to run it under a dedicated profile that doesn't exist yet, the tool will create the missing profile for you and will make rule suggestions for that profile in the same run."
msgstr ""
msgid "At the kernel level, the special powers of the root user have been split in “capabilities”. When a system call requires a specific capability, AppArmor will verify whether the profile allows the program to make use of this capability."
msgstr ""
msgid "Here the program seeks read permissions for <filename>/etc/nsswitch.conf</filename>. <command>aa-genprof</command> detected that this permission was also granted by multiple “abstractions” and offers them as alternative choices. An abstraction provides a reusable set of access rules grouping together multiple resources that are commonly used together. In this specific case, the file is generally accessed through the nameservice related functions of the C library and we type “3” to first select the “#include <abstractions/nameservice>” choice and then “A” to allow it."
msgstr ""
msgid "The program wants to create the <filename>/run/dhclient-eth0.pid</filename> file. If we allow the creation of this specific file only, the program will not work when the user will use it on another network interface. Thus we select “New” to replace the filename with the more generic “/run/dhclient*.pid” before recording the rule with “Allow”."
msgstr ""
msgid "Notice that this access request is not part of the dhclient profile but of the new profile that we created when we allowed <filename>/usr/lib/NetworkManager/nm-dhcp-helper</filename> to run with its own profile."
msgstr ""
msgid "After having gone through all the logged events, the program offers to save all the profiles that were created during the run. In this case, we have two profiles that we save at once with “Save” (but you can save them individually too) before leaving the program with “Finish”."
msgstr ""
msgid "<command>aa-genprof</command> is in fact only a smart wrapper around <command>aa-logprof</command>: it creates an empty profile, loads it in complain mode and then run <command>aa-logprof</command> which is a tool to update a profile based on the profile violations that have been logged. So you can re-run that tool later to improve the profile that you just created."
msgstr ""
msgid "If you want the generated profile to be complete, you should use the program in all the ways that it is legitimately used. In the case of dhclient, it means running it via Network Manager, running it via ifupdown, running it manually, etc. In the end, you might get a <filename>/etc/apparmor.d/sbin.dhclient</filename> close to this:"
msgstr ""
msgid ""
"\n"
"# Last Modified: Tue Sep 8 21:40:02 2015\n"
"#include <tunables/global>\n"
"\n"
"/sbin/dhclient {\n"
" #include <abstractions/base>\n"
" #include <abstractions/nameservice>\n"
"\n"
" capability net_bind_service,\n"
" capability net_raw,\n"
"\n"
" /bin/dash r,\n"
" /etc/dhcp/* r,\n"
" /etc/dhcp/dhclient-enter-hooks.d/* r,\n"
" /etc/dhcp/dhclient-exit-hooks.d/* r,\n"
" /etc/resolv.conf.* w,\n"
" /etc/samba/dhcp.conf.* w,\n"
" /proc/*/net/dev r,\n"
" /proc/filesystems r,\n"
" /run/dhclient*.pid w,\n"
" /sbin/dhclient mr,\n"
" /sbin/dhclient-script rCx,\n"
" /usr/lib/NetworkManager/nm-dhcp-helper Px,\n"
" /var/lib/NetworkManager/* r,\n"
" /var/lib/NetworkManager/*.lease rw,\n"
" /var/lib/dhcp/*.leases rw,\n"
"\n"
" profile /sbin/dhclient-script flags=(complain) {\n"
" #include <abstractions/base>\n"
" #include <abstractions/bash>\n"
"\n"
" /bin/dash rix,\n"
" /etc/dhcp/dhclient-enter-hooks.d/* r,\n"
" /etc/dhcp/dhclient-exit-hooks.d/* r,\n"
" /sbin/dhclient-script r,\n"