1 |
<?xml version='1.0' encoding='UTF-8'?> |
<?xml version='1.0' encoding='iso-8859-1'?> |
2 |
|
|
3 |
|
|
4 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
5 |
<guide link = "/doc/en/gentoo-security.xml"> |
<guide link = "/doc/en/gentoo-security.xml"> |
6 |
<title>Gentoo Linux Security Guide</title> |
<title>Gentoo Linux sikkerhedsvejledning</title> |
7 |
<author title="Author"><mail link="kn@insecurity.dk">Kim Nielsen</mail> |
<author title="Forfatter"><mail link="kn@insecurity.dk">Kim Nielsen</mail> |
8 |
</author> |
</author> |
9 |
|
|
10 |
<author title="Editor"><mail link="zhen@gentoo.org">John P. Davis</mail> |
<author title="Redaktør"><mail link="zhen@gentoo.org">John P. Davis</mail> |
11 |
</author> |
</author> |
12 |
|
|
13 |
<author title="Editor"><mail link="stocke2@gentoo.org">Eric R. Stockbridge</mail> |
<author title="Redaktør"><mail link="stocke2@gentoo.org">Eric R. Stockbridge</mail> |
14 |
</author> |
</author> |
15 |
|
|
16 |
<author title="Editor"><mail link="carl@gentoo.org">Carl Anderson</mail> |
<author title="Redaktør"><mail link="carl@gentoo.org">Carl Anderson</mail> |
17 |
</author> |
</author> |
18 |
|
|
19 |
<author title="Editor"><mail link="peesh@gentoo.org">Jorge Paulo</mail> |
<author title="Redaktør"><mail link="peesh@gentoo.org">Jorge Paulo</mail> |
20 |
</author> |
</author> |
21 |
|
|
22 |
<author title="Editor"><mail link="swift@gentoo.org">Sven Vermeulen</mail> |
<author title="Redaktør"><mail link="swift@gentoo.org">Sven Vermeulen</mail> |
23 |
</author> |
</author> |
24 |
|
|
25 |
<author title="Editor"><mail link="bennyc@gentoo.org">Benny Chuang</mail> |
<author title="Redaktør"><mail link="bennyc@gentoo.org">Benny Chuang</mail> |
26 |
</author> |
</author> |
27 |
|
|
28 |
<author title="Editor"><mail link="jaervosz@itu.dk">Sune Jeppesen</mail> |
<author title="Redaktør"><mail link="jaervosz@itu.dk">Sune Jeppesen</mail> |
29 |
</author> |
</author> |
30 |
|
|
31 |
<author title="Editor"><mail link="blubber@gentoo.org">Tiemo Kieft</mail> |
<author title="Redaktør"><mail link="blubber@gentoo.org">Tiemo Kieft</mail> |
32 |
</author> |
</author> |
33 |
|
|
34 |
|
<author title="Oversætter"><mail link="bro3man@yahoo.dk">Jesper Brodersen</mail> |
35 |
|
</author> |
36 |
<license/> |
<license/> |
37 |
|
|
38 |
<abstract> |
<abstract> |
39 |
This guide is step-by-step guide for hardening Gentoo Linux. |
Denne vejledning er en trin-for-trin vejledning til at gøre din Gentoo Linux modstandsdygtig. |
40 |
</abstract> |
</abstract> |
41 |
|
|
42 |
<version>0.4.5</version> |
<version>0.4.5_dk</version> |
43 |
<date>September 30, 2003</date> |
<date>2. November, 2003</date> |
44 |
|
|
45 |
-- Introduction start -- |
-- Introduction start -- |
46 |
|
|
47 |
<chapter> |
<chapter> |
48 |
<title>Introduction</title> |
<title>Introduktion</title> |
49 |
<section> |
<section> |
50 |
<body> |
<body> |
51 |
|
|
52 |
<p> |
<p> |
53 |
This guide is intended for people who are using Gentoo Linux in a server based environment or just feel the need for better security. |
Denne vejledning er lavet til folk, som bruger Gentoo Linux i et server-baseret miljø eller bare føler nødvendigheden for bedre sikkerhed. |
54 |
</p> |
</p> |
55 |
|
|
56 |
<note> |
<note> |
57 |
If you are interested in even more Gentoo security stuff after reading this guide then have a look at the <uri link="http://www.gentoo.org/proj/en/hardened/">Hardened Gentoo Project</uri> |
Hvis du er interesseret i endnu flere Gentoo sikkerhedsdokumenter efter at have læst denne vejledning, så tag et kig på <uri link="http://www.gentoo.org/proj/en/hardened/">Hardened Gentoo Project</uri> (Engelsk) |
58 |
</note> |
</note> |
59 |
|
|
60 |
</body> |
</body> |
113 |
-- Considerations before installation start -- |
-- Considerations before installation start -- |
114 |
|
|
115 |
<chapter> |
<chapter> |
116 |
<title>Pre-Installation Concerns</title> |
<title>Præ-installation bekymringer</title> |
117 |
<section> |
<section> |
118 |
<title>Physical Security</title> |
<title>Fysisk sikkerhed</title> |
119 |
<body> |
<body> |
120 |
|
|
121 |
<p> |
<p> |
122 |
No matter how many safeguards you implement, all can easily be circumvented if |
Lige meget hvor mange sikkerhedsforanstaltninger du implementerer, alt kan omgås, hvis angriberen kan få fysisk adgang til din box. |
123 |
the attacker can gain physical access to your box. Make sure your hardware is not |
Vær sikker på at dit hardware ikke er nemt tilgængeligt, som |
124 |
casually accessible. For example, you may want to place your box |
f.eks. at placere din box i et lukket serverskab. |
125 |
in a locked server closet. Locking cases is a good idea too. For the highest level |
Låsning af kabinetter er også en god idé, og for det højeste niveau af |
126 |
of security set your BIOS to restrict booting to your hard drive only. |
sikkerhed, indstil din BIOS til at begrænse opstart til din harddisk; |
127 |
Disable booting from the floppy and CD-ROM drives. For the paranoid, enabling the |
altså umuligør opstart fra disketter og CDROM-drev. Den paranoide kan også indstille et BIOS-kodeord, selvom det også er en god idé for bærbar brugere. |
|
BIOS password is a good idea. BIOS passwords are also a good idea for laptop users. |
|
128 |
</p> |
</p> |
129 |
|
|
130 |
</body> |
</body> |
131 |
</section> |
</section> |
132 |
|
|
133 |
<section> |
<section> |
134 |
<title>Daemon/Service Planning</title> |
<title>Baggrundsprocesser (daemon) / planlægning af tjenester</title> |
135 |
<body> |
<body> |
136 |
|
|
137 |
<p> |
<p> |
138 |
Document what services the machine should run or is supposed to run. This will help |
Du burde dokumentere hvilke tjenester som maskinen skal køre eller burde køre. |
139 |
you compose a better partition scheme for the system. It can also make your |
Dette vil hjælpe dig med at sammensætte en bedre partionsoversigt for systemet. |
140 |
intrusion detection strategy much easier. |
Det kan også gøre din indtrængningsstrategi meget nemmere. |
141 |
Of course you should not document this if you only have one or a few computers and |
Selvfølgelig skal du ikke dokumentere dette, hvis du kun har én eller få computere, og du kun bruger én af dem. |
|
you are the only one using them. |
|
142 |
</p> |
</p> |
143 |
|
|
144 |
<p> |
<p> |
145 |
Example: |
Eksempel: |
146 |
</p> |
</p> |
147 |
|
|
148 |
<p> |
<p> |
149 |
The Computer is supposed to act as a firewall. What services should it run? |
Denne computer skal funktionere som en firewall. Hvilke tjenester skal den køre? |
150 |
</p> |
</p> |
151 |
|
|
152 |
<p> |
<p> |
153 |
<e>none</e>, except maybe <c>sshd</c>. |
<e>ingen</e>, undtagen måske <c>sshd</c>. |
154 |
</p> |
</p> |
155 |
|
|
156 |
<p> |
<p> |
157 |
Document this and the current version of SSH - it will help you keep track of which system to upgrade in case someone finds a security hole in <c>sshd</c>. This will also aid in determining who should have access to the system. |
Dokumentér dette og den nuværende version af SSH - dette vil hjælpe dig med at holde styr over hvilket system, som skal opgraderes, når nogen finder et sikkerhedshul i <c>sshd</c>. Dette vil også hjælpe med at finde frem til hvem der skal have adgang til systemet. |
158 |
</p> |
</p> |
159 |
|
|
160 |
</body> |
</body> |
161 |
</section> |
</section> |
162 |
|
|
163 |
<section> |
<section> |
164 |
<title>Partitioning Schemes</title> |
<title>Partitionsoversigter</title> |
165 |
<body> |
<body> |
166 |
|
|
167 |
<p> |
<p> |
168 |
Golden rules: |
Gyldne regler: |
169 |
</p> |
</p> |
170 |
|
|
171 |
<ul> |
<ul> |
172 |
|
|
173 |
<li> |
<li> |
174 |
Any directory tree a user should be able to write to (<path>/home</path> and <path>/tmp</path> <path>/var</path>), should be on a separate partition and use disk quotas. Portage uses <path>/var/tmp</path> to compile files so that partition should be large. This reduces the risk of a user filling up your <path>/</path> mount point. |
Alle bibliotekstræer, som en bruger skal kunne skrive til (<path>/home</path> og <path>/tmp</path>, <path>/var</path>) burde være på en separat partition og bruge "disk quotas" (kvotesystem). Portage bruger <path>/var/tmp</path> til at kompilere filer, så denne partion burde være stor. Dette reducerer risikoen for at en bruger fylder hele <path>/</path> roden. |
175 |
</li> |
</li> |
176 |
|
|
177 |
<li> |
<li> |
178 |
Any directory tree where you want to install non-distribution software should be on a separate partition. According to the <uri link="http://www.pathname.com/fhs/">File Hierarchy Standard</uri>, this is <path>/opt</path> or <path>/usr/local</path>. If these are separate partitions, they will not be erased if you have to reinstall the system. |
Alle bibliotekstræer, hvor du vil installere ikke-distributionssoftware, burde være på en separat partition. Hvis man følger <uri link="http://www.pathname.com/fhs/">Fil-hierarki-standarden</uri>, er dette <path>/opt</path> eller <path>/usr/local</path>. Hvis disse er på separate partitioner, vil de ikke blive slettet ved en geninstallation. |
179 |
</li> |
</li> |
180 |
|
|
181 |
<li> |
<li> |
182 |
Try to move static data to its own partition, and mount that partition in read-only mode. If you're really paranoid you could try storing static data on read-only media like CDROMs. |
Prøv at flytte statiske data til éns egen partition, og mount denne kun i read-only mode. Hvis du er rigtig paranoid, kan du også gemme disse data på et read-only medie, som en CDR/DVDR. |
183 |
</li> |
</li> |
184 |
|
|
185 |
</ul> |
</ul> |
187 |
</section> |
</section> |
188 |
|
|
189 |
<section> |
<section> |
190 |
<title>The root user</title> |
<title>Root-brugeren</title> |
191 |
<body> |
<body> |
192 |
<p> |
<p> |
193 |
The user 'root' is the most vital user on the system and should not be used for anything except if it is necessary. If an attacker gains root access you can no longer trust your system, so reinstall. |
Brugeren 'root' er den mest vigtige bruger på systemet, og burde ikke blive brugt til noget som helst, medmindre det er nødvendigt. Hvis en angriber får root-adgang, kan du ikke længere stole på dit system, så geninstaller det. |
194 |
</p> |
</p> |
195 |
|
|
196 |
<p> |
<p> |
197 |
Golden rules about 'root' |
Gyldne regler omkring 'root' |
198 |
</p> |
</p> |
199 |
|
|
200 |
<ul> |
<ul> |
201 |
|
|
202 |
<li> |
<li> |
203 |
Always create a user for everyday use and if this user needs to have root access, add the user to the group wheel. This makes it possible for a normal user to su to root. |
Lav altid en bruger for hverdagsbrug og hvis denne bruger mangler root-adgang, tilføj en bruger til gruppen wheel. Dette gør det muligt for en normal bruger at su til root. |
204 |
</li> |
</li> |
205 |
|
|
206 |
<li> |
<li> |
207 |
Never run X or any other user application as root. |
Kør aldrig X eller noget anden bruger-program som root. |
208 |
</li> |
</li> |
209 |
|
|
210 |
<li> |
<li> |
211 |
Always use absolute paths when logged in as root. It's possible to trick root into running a different application than he thinks he is using. For example if someone tampered with the PATH and root su's without using <c>su -</c>. Then root will use the path of the user. |
Brug altid absolutte stier, når du logger ind som root. Det er muligt at snyde root til at køre et andet program, end den den tror den bruger. F.eks. hvis nogen har pillet ved PATH og root su uden brug af <c>su -</c>. I så fald, vil root bruge brugerens sti i stedet for. |
212 |
</li> |
</li> |
213 |
|
|
214 |
<li> |
<li> |
215 |
If a user only needs a few commands instead of everything that root normally can do, consider using <c>sudo</c>, but be careful with this! |
Hvis en bruger kun mangler nogle få kommandoer, i stedet for det hele, som root kan gøre, kan man bruge <c>sudo</c>, men vær forsigtig med denne! |
216 |
</li> |
</li> |
217 |
|
|
218 |
<li> |
<li> |
219 |
Never leave the terminal when you are logged in as root. |
Forlad aldrig en terminal, imens du er logget ind som root. |
220 |
</li> |
</li> |
221 |
|
|
222 |
</ul> |
</ul> |
223 |
|
|
224 |
<p> |
<p> |
225 |
Gentoo has general protection against normal users, trying to <c>su</c>. The default PAM setting states that a users has to be a member of wheel in order to be able to su. |
Gentoo har generel beskyttelse imod normale brugere, når de prøver at <c>su</c>. Standardindstillingen til PAM kræver at brugere skal være medlem af gruppen wheel for at kunne su til root. |
226 |
</p> |
</p> |
227 |
|
|
228 |
</body> |
</body> |
229 |
</section> |
</section> |
230 |
|
|
231 |
<section> |
<section> |
232 |
<title>Security policies</title> |
<title>Sikkerhedpolitik</title> |
233 |
<body> |
<body> |
234 |
|
|
235 |
<p>There are several reasons why security policies are needed.</p> |
<p>Der er flere grunde til hvor sikkerhedspolitik er nødvendigt.</p> |
236 |
|
|
237 |
<ul> |
<ul> |
238 |
|
|
239 |
<li> |
<li> |
240 |
You cannot claim to have a secure network without a definition of what you think is secure. |
Du kan ikke påstå at have et sikkert netværk uden at have defineret hvad du synes er sikkert. |
241 |
</li> |
</li> |
242 |
|
|
243 |
<li> |
<li> |
244 |
It is almost impossible to catch potential attackers, resolve network problems, or conduct audits, without spying on network traffic or looking in private home directories. And spying without the users agreement is illegal in most countries. And since about 60% of all attacks currently come from inside the organization, it is important that you keep an open eye. |
Det er nærmest umuligt at fange potentielle angribere, løse netværksproblemer eller føre revision, uden at spionere på netværkstrafikken eller kigge i private home-biblioteker, og at spionere uden brugerens tilladelse, er i de fleste lande forbudt. Siden omkring 60% af alle angreb på nuværende tidspunkt kommer indefra organisationen, er det vigtigt at du holder et vågent øje. |
245 |
</li> |
</li> |
246 |
|
|
247 |
<li> |
<li> |
248 |
You cannot expect your users to think about security, if you never explained why it was important or how they should protect themselves and their colleagues. |
Du kan ikke forvente at dine brugere tænker på sikkerhed, hvis du aldrig har forklaret dem, hvorfor det er vigtigt eller hvordan de skal beskytte dem selv eller deres kollegaer. |
249 |
</li> |
</li> |
250 |
|
|
251 |
<li> |
<li> |
252 |
Good guidelines and network documentation always pays off, no matter what. |
Gode retningslinier og netværksdokumentation betaler sig altid, lige meget hvad. |
253 |
</li> |
</li> |
254 |
|
|
255 |
<li> |
<li> |
256 |
Police or federal law enforcement can not help you catch the attacker, if they do not know your network configuration or the services that you provide. |
Politiet kan ikke hjælpe dig med at fange en angriber, hvis de ikke kender din netværksopsætning eller de tjenester du leverer. |
257 |
</li> |
</li> |
258 |
|
|
259 |
<li> |
<li> |
260 |
What will you do when there has been an attack? You need to define what you are going to do and who you are going to tell about it. Are you just going to call the police/a CERT team on every occasion? They won't take you serious! |
Hvad vil du gøre, når der kommer et angreb? Du bliver nødt til at definere hvad du vil gøre og hvem du vil fortælle det til. Vil du ringe til politiet hver gang det sker? De vil ikke tro på dig til sidst! |
261 |
</li> |
</li> |
262 |
|
|
263 |
</ul> |
</ul> |
264 |
|
|
265 |
<p> |
<p> |
266 |
This should clearly state why it is important to create policies for systems with more than one user and why it is important to educate users. |
Dette skulle klart fortælle hvorfor det er vigtigt at lave en politik for systemer med mere end én bruger, og hvorfor det er vigtigt at uddanne brugere. |
267 |
</p> |
</p> |
268 |
|
|
269 |
<p> |
<p> |
270 |
A policy is a document (or several documents) with answers to questions like who, where, why and what. |
En police er et dokument (eller flere dokumenter) med svar på spørgsmål til hvem, hvor, hvorfor og hvad. |
271 |
Every user on your system/network should read, understand and sign it. It is important that you take the time to help the users understand the policy and why the policy needs to be signed or what will happens if they act directly against the policy (the policy should also state this). This should be repeated at least once a year since the policy can change but also as a reminder to the user. |
Enhver bruger på dit system/netværk burde læse, forstår og underskrive denne. Det er vigtigt at du tager dig tid til at hjælpe brugeren med at forstå policen og hvorfor policen skal underskrives eller hvad der vil ske hvis de modarbejder policen (policen skal også fortælle dette). Dette burde blive gentaget mindst én gang om året, siden policen kan ændre sig, men også en god påmindelse til brugeren. |
272 |
</p> |
</p> |
273 |
|
|
274 |
<note>Create policies that are easy to read and be very precise on every subject.</note> |
<note>Lav policer, som er lette at læse og vær præcis omkring hvert emne.</note> |
275 |
|
|
276 |
<p> |
<p> |
277 |
Most parts of a policy can be enforced directly in the operating system or through firewalls and others cannot. |
De meste dele af en police kan blive tvunget direkte ind i operativsystemet eller igennem firewalls og andre. |
278 |
</p> |
</p> |
279 |
|
|
280 |
<p> |
<p> |
281 |
A security policy should at least contain the following subjects: |
En sikkerhedspolice burde i det mindste indeholde følgende emner: |
282 |
</p> |
</p> |
283 |
|
|
284 |
<ul> |
<ul> |
285 |
|
|
286 |
<li>Acceptable use.</li> |
<li>Acceptabelt brug.</li> |
287 |
<ul> |
<ul> |
288 |
<li>Screen savers.</li> |
<li>Skærmskånere.</li> |
289 |
<li>Password handling.</li> |
<li>Behandling af kodeord.</li> |
290 |
<li>Software download and installation.</li> |
<li>Softwarehentning og installation.</li> |
291 |
<li>Information stating if the users are being monitored.</li> |
<li>Informationer der fortæller, hvis en bruger bliver overvåget.</li> |
292 |
<li>Use of anti-virus software.</li> |
<li>Brug af antivirus software.</li> |
293 |
</ul> |
</ul> |
294 |
|
|
295 |
<li>Handling of sensitive information (any written form, paper or digital).</li> |
<li>Behandling af følsomme informationer (alt beskrivende, papir eller digitalt).</li> |
296 |
<ul> |
<ul> |
297 |
<li>Clean desk and locked up classified information.</li> |
<li>Rent bord og låsning af klassificeret informationer.</li> |
298 |
<li>PC shutdown before leaving.</li> |
<li>Slukning af PC før fyraften.</li> |
299 |
<li>Use of encryption.</li> |
<li>Brug af kryptering.</li> |
300 |
<li>Handling of keys to trusted co-workers.</li> |
<li>Behandling af nøgler til troværdige kollegaer.</li> |
301 |
<li>Handling of classified material when traveling.</li> |
<li>Behandling af klassificeret materiale, når man rejser.</li> |
302 |
</ul> |
</ul> |
303 |
|
|
304 |
<li>Handling of computer equipment when traveling.</li> |
<li>Behandling af computerudstyret, når man rejser</li> |
305 |
<ul> |
<ul> |
306 |
<li>Laptop handling during travels and hotel stays.</li> |
<li>Bærbar-behandling imens man rejser og ved hotelophold.</li> |
307 |
</ul> |
</ul> |
308 |
|
|
309 |
</ul> |
</ul> |
310 |
|
|
311 |
<p> |
<p> |
312 |
The policy for the IT-staff might be a bit different then the normal users. |
Policen til IT-afdelingen kan måske være lidt forskelligt fra en normal bruger. |
313 |
</p> |
</p> |
314 |
|
|
315 |
<p> |
<p> |
316 |
The security policy can become huge, and vital information can easily be forgotten. The IT-staff's policy could contain information that is classified for the ordinary user, so it is wise to split it up into smaller policies; i.e. Acceptable Use Policy, Password policy, Email policy and Remote Access policy. |
Sikkerhedspolicen kan blive meget stor, og vigtige infromationer kan let blive glemt. IT-afdelingens police kan indeholde informationer som er klassificeret for den normale bruger, så det er vigtigt at splitte den op i mindre policer; altså Acceptabelt brug police, Kodeord police, Email police og fjernadministrationspolice. |
317 |
</p> |
</p> |
318 |
|
|
319 |
<p> |
<p> |
320 |
Examples of policies can be found at the <uri link="http://www.sans.org/newlook/resources/policies/policies.htm">The SANS Security Policy Project</uri>. If you have a small network and think these policies is to much you should look at <uri link="http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2196.html">RFC2196</uri> which is a site security handbook. |
Eksempler på policer kan blive fundet på siden for<uri link="http://www.sans.org/newlook/resources/policies/policies.htm">SANS Security Policy Projektet</uri>. Hvis du har et lille netværk og synes at de policer er lidt for meget, så tag et kig på <uri link="http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2196.html">RFC2196</uri>, som er en sikkerhedshåndbog for en beliggenhed. |
321 |
</p> |
</p> |
322 |
|
|
323 |
</body> |
</body> |