This chapter will introduce some of the most common questions that usually appear in the security mailing list. You should read them before posting there or else people might tell you just to RTFM.
A system is as secure as its administrator is capable of making it. Debian tries to install services in a secure by default way and might not try to be as paranoid as other operating systems which install all the services disabled by default. However, the system administrator needs to adapt the security of the system to his local security policy.
Debian contains quite a number of packages and different software, probably more that provided by some propietary operating systems. This means that there might be lurking more potential security issues than in systems with less software.
However, there are many advisories related to source code audits done to major software components included in Debian. Whenever such source code audit turn out a major flaw it is fixed and a advisory is sent to list such as bugtraq.
Bugs that are present in the Debian distribution usually affect other vendors and other distributions as well. Check the "Debian specific: yes/no" part on top of each advisory (DSA). If there is a "yes", it only affects Debian, if there is a "no" it probably also affects other distributions as well.
Debian contains quite a lot of packages, and nowadays there are many groups looking for security problems in software (for whichever reasons).
Simple answer: no.
Long answer: certification costs money and nobody has dedicated resources in order to certificate the Debian GNU/Linux distribution to any level of, for example, the Common Criteria. If you are interested in having a certified GNU/Linux distribution try to provide resources in order to make it possible.
originally oriented towards some Linux distributions (Red Hat and Mandrake)
currently works for Debian. Steps are being taken to integrate the changes
made to the upstream version, in any case the package in Debian is, of course,
Some people believe, however, that a hardening tool does not eliminate the need for good administration.
One of the benefits of Debian, which might confuse the novice administrator, is that it provides a lot of software to offer the same service (dns servers, mail servers, ftp servers, web servers...). If you want information on what server you should be installing there's no general answer, it really depends on your feature and security needs (which might need to be balanced).
Things you should check:
You will find information in this document to make some services (FTP, Bind) more secure in Debian GNU/Linux. For services not covered here, however, check the program's documentation, or general Linux information. Most of the security guidelines for Unix systems apply also to Debian so securing service X in Debian is, most of the time, like securing the service for any other Linux distribution (or Unix, for that matter).
The Debian security team cannot analise all the packages included in Debian for
potential security vulnerabilities, since there are just not enough resources
to source-code audit all the project. However, Debian does benefit from the
source code audits made by upstream developers or other projects like the
Linux Kernel Security
Audit Project or the
As a matter of fact, a Debian developer could distribute a trojan in a package and there is no possible way to check it out. Even if they would be introduced in Debian it would be impossible to cover all the possible situations in which the trojan would execute.
This sticks to the no guarantees license clause. In any case, Debian users can take confidence in that the stable code has a wide audience and most problems would be uncovered through use. It is not recommended to install untested software in a valuable system in any case (if you cannot provide the necessary code audit). And, in any case, if there were an induced security vulnerability in the distibution, the process used to include them (using digital signatures) ensures that the problem can be ultimately traced to the developer, and the Debian project has not taken this issues lightly.
Yes and no. Debian comes with some predefined users (id < 99 as described
Policy) for some services so that installing new services is easy
(they are already run by the appropriate user). If you do not intend to
install new services, you can safely remove those users who do not own any
files in your system and do not run any services.
You can easily find users not owning any files by executing the following command (be sure to run it as root, since a common user might not have enough permissions to go through some sensitive directories):
cut -f 1 -d : /etc/passwd | while read i; do find / -user "$i" | grep -q . && echo "$i"; done
These users are provided by
base-passwd. You will find in its
documentation more information on how these users are handled in Debian.
The list of default users (with a corresponding group) follows:
/var/spool/cupsare owned by group sys.
/bin/sync. Thus, if its password is set to something easy to guess (such as ""), anyone can sync the system at the console even if they have no account on the system.
/var/mailare owned by group mail, as is explained in policy. The user and group are used for other purposes as well by various MTA's.
/var/lib/postgresqlare owned by this user to enforce proper security.
Other groups which have no associated user:
/var/log, and can use xconsole. Historically,
/var/adm), thus the name of the group.
wvdial, etc. to dial up a connection. The users in this group cannot configure the modem, they can just run the programs that make use of it.
/usr/src. It can be used locally to give a user the ability to manage system source code.
/etc/shadowis readable by this group. Some programs that need to be able to access the file are set gid shadow.
/var/run/utmpand similar files. Programs that need to be able to write to it are sgid utmp.
/home) without needing root privileges. Compare with group "adm", which is more related to monitoring/security.
'adm' are administrators and is mostly useful to allow them to read logfiles
without having to
su. 'staff' is useful for more helpdesk/junior
sysadmins type of people and gives them the ability to do things in
/usr/local and create directories in
That's just an approach to the problem of being, on one side, security conscious and on the other side user friendly. Unlike OpenBSD, which disables all services unless activated by the administrator, Debian GNU/Linux will activate all installed services unless deactivated (see Disabling daemon services, Section 3.6.1 for more information). After all you installed the service, didn't you?
There has been a lot of discussion on Debian mailing lists (both at debian-devel and at debian-security) regarding which should be the standard setup. However, there is not a consensus as of this writting (march 10th 2002) on how it should be tackled.
Inetd is not easy to remove since
netbase depends on the package
that provides it (
netkit-inetd. If you want to remove it you can
either disable it (see Disabling daemon
services, Section 3.6.1 or remove the package by using the
Port 111 is sunrpc's portmapper, it is installed by default in all base installations of a Debian system since there is no need to know when a user's program might need RPC to work out correctly. In any case, it is used mostly for NFS. If you do not need it, remove it as explained in Disabling RPC services, Section 5.14.
Identd is used for administrators to provide userid details to remote systems who want to know who's responsible for a given connection from your machine. Notably this includes mail, FTP and IRC servers, however, it can also be used to trace down which user in your local system is attacking a remote system.
There has been extensive discussion for this see the
list archives, basicly if you do not know what it is for, don't
activate it. But if you firewall it, please make it a reject rule and
not a deny rule, otherwise communications might hang until a timeout expires
reject or deny
Of course you can, the ports you are leaving open should adhere to your site's policy regarding public services available to other systems. Check if they are open by inetd (see Disabling inetd services, Section 3.6.2) or by other installed packages and take appropriate measures (configure inetd, remove the package, avoid it running on bootup...)
/etc/services, am I ok?
/etc/services just provides a mapping from a virtual
name to a given port number, removing names from there will not (usually)
prevent services from being started. Some daemons might not run if
/etc/services is modified but that's not the norm, and it's not
the recommended way to do it, see Disabling
daemon services, Section 3.6.1.
The steps you need to take in order to recover from this depends on whether or not you have applied the suggested procedure for limiting access to Lilo and BIOS.
If you have limited both. You need to disable the BIOS features (only boot from hard disk) before proceeding, if you also forgot your BIOS password, you will have to open your system and manually remove the BIOS battery.
If you have bootup of CD-ROM or diskette enable, you can:
ae, Debian 3.0 comes with
nano-tinywhich is similar to
/etc/shadowand change the line:
root:asdfjl290341274075:XXXX:X:XXXX:X::: (X=any number)
This will remove the root password. You can startup the system and root from the login: prompt as root (with an empty password). This will work unless you have configured the system more tightly, i.e. if you have allowed users with null passwords and root can login from the console.
If you have introduced also this features you will need to enter in single
mode. LILO needs not to be restricted, if you have done this too you will need
lilo just after the root reset above. This is quite
tricky since your
/etc/lilo.conf will need to be tweaked due to
having a / filesystem that is a ramdisk and not the real harddisk.
Once LILO is not restricted it. You can:
mount -o remount,rw /
passwd(since you are superuser it will not ask for the previous password).
If you want to give a POP service, for example, you do not need to setup a user
account for each user accessing it. It's best to setup a directory-based
authentication through an external service (like Radius, LDAP or an SQL
database). Just install the appropiate PAM library
libpam-mysql), read the documentation
(for starters, see User authentication: PAM,
Section 4.9.1 and configure the PAM-enabled service to use the backend you
have chosen. This is done by editing the files under
for your service and modify the
auth required pam_unix_auth.so shadow nullok use_first_pass
to, for example, ldap:
auth required pam_ldap.so
In the case of LDAP directories, some services provide LDAP schemas to be included in your directory that need to be included in order to use LDAP autentication for it. If you are using a relational database, a useful trick is to use the where clause when configuring the PAM modules. For example if you have a database with the following table:
You can use the last (boolean) values to enable or disable access to the different services just by inserting the appropiate lines in the following files:
/etc/nss-mysql*.conf:users.where_clause = user.sys = 1;.
A trace of an attack does not always mean that you've been cracked into, you should take the usual steps to determine if the system is compromised (see After the compromise, Chapter 10). Also notice that sometimes, the fact that you see the attacks in the log might mean you system is already vulnerable to it (a determined attacker might have used some other besides the ones you have seen, however).
You might find the following in your system logs. If your system does not have a lot of load (and services) they probably be one of the few appearing in your logs:
Dec 30 07:33:36 debian -- MARK -- Dec 30 07:53:36 debian -- MARK -- Dec 30 08:13:36 debian -- MARK --
This does not indicate any cand of compromise, and users changing between
Debian releases might find it strange. It is, a matter of fact an indication
syslogd running properly. From
-m interval The syslogd logs a mark timestamp regularly. The default interval between two -- MARK -- lines is 20 minutes. This can be changed with this option. Setting the interval to zero turns it off entirely.
You might find lines in your logs like:
Apr 1 09:25:01 server su: + ??? root-nobody Apr 1 09:25:01 server PAM_unix: (su) session opened for user nobody by (uid=0)
Don't worry too much, check out if this is due to a job running through the
$ grep 25 /etc/crontab 25 6 * * * root test -e /usr/sbin/anacron || run-parts --report /etc/cron.daily $ grep nobody /etc/cron.daily/* find:cd / && updatedb --localuser=nobody 2>/dev/null
Read this document and take the appropiate measures outlined here. If you need assistance you might use the email@example.com to ask for advice on how to recover/patch your system.
Watching the logs (if they have not been changed), using intrusion detection
systems (see Set up Intrusion
Detection., Section 9.1),
similar tools (including forensic analysis) you can trace an attack to the
source. The way you should react on this information depends, solely, on your
appropiate security policy, and what you consider an attack is. Is a
remote scan an attack? Is a vulnerability probe an attack?
Take a moment, first, to see if the vulnerability has been announced in public
security mailing lists (like Bugtraq) or other forums, the Debian Security Team
keeps up to date with this lists, so they might already be aware of the
problem. Do not take any further actions if you see an announcement already at
If you do not see any of this, please send mail on the affected packages as well as a description of the vulnerability as detailed as possible (proof of concept code is also ok) to firstname.lastname@example.org which will get you in touch with the security team.
Instead of upgrading to a new release we backport security fixes to the version that was shipped in the stable release. The reason we do this is to make sure that a release changes as little as possible so things will not change or break unexpectedly as a result of a security fix. You can check if you are running a secure version of a package by looking at the package changelog, or comparing its exact (upstream version -slash- debian release) version number with the version indicated in the Debian Security Advisory.
Add DenyFilter \*.*/ to your configuration file, for more
It is the information sent by the Debian Security Team (see below) informing of
a fix of a security related vulnerability available for the Debian operating
system. Signed DSAs are sent to public mailing lists and posted in Debian's
web site (both in the front page and in the
DSAs include information on the affected package/s, the bug discovered and where to retrieve the updated packages (and their MD5 sums).
This is most likely a problem on your end. The debian-security-announce list has a filter that only allows messages with a correct signature from one of the security team members to be posted.
Most likely some piece of mail software on your end slightly changes the message that breaks the signature. Make sure your software does not do any MIME encoding or decoding, or tab/space conversions.
Known culprits are fetchmail (with the mimedecode option enabled) and formail (from procmail 3.14 only).
Once the Security Team receives a notification of an incident, one or more members review it and consider Debian/stable vulnerable or not. If our system is vulnerable, it is worked on a fix for the problem. The package maintainer is contacted as well, if he didn't contact the Security Team already. Finally the fix is tested and new packages are prepared, which then are compiled on all stable architectures and uploaded afterwards. After all this tasks are done a Debian Security Advisory (DSA) is sent to public mailing lists.
Analysis of the time it takes the Debian security team to send an advisory and produce fixed packages once a vulnerability is known show that it does not take much time for vulnerabilities to be fixed in the stable distribution.
in the debian-security mailinglist showed that in the year 2001, it
took the Debian Security Team an average of 35 days to fix security-related
vulnerabilites. However, over 50% of the vulnerabilities where fixed in a
10-days time frame, and over 15% of them where fixed the same day the
advisory was released.
However, when asking this question people tend to forget that:
The short answer is: it's not. Testing and unstable are rapidly moving targets and the security team does not have the resources needed to properly support those. If you want to have a secure (and stable) server you are strongly encouraged to stay with stable.
However, as a matter of fact, unstable usually gets fixed really quick since security updates sometimes get they are usually available upstream faster (other versions, like those in stable need usually to be backported).
A: The purpose of security.debian.org is to make security updates available as quickly and easily as possible. Mirrors would add extra complexity that is not needed and can cause frustration if they are not up to date.
Several vendors (mostly of GNU/Linux, but also of BSD derivatives) coordinate security advisories for some incidents and agree to a particular timeline so that all vendors are able to properly determine if they are (or not) vulnerable and create the patchs needed.
The Debian Security Team holds, in this case, the numbers before the advisory can be released, and hence temporarily leaving out one or more advisories by number.
A: Security information can be sent to email@example.com, which is read by all Debian developers. If you have sensitive information please use firstname.lastname@example.org which only the members of the security team read. If desired email can be encrypted with the Debian Security Contact key (key ID 363CCD95).
When you send messages to email@example.com these are sent to the developers mailing list (debian-private) to which all Debian developers are subscribed to, posts to this list are kept private (i.e. are not archived at the public website). Debianfirstname.lastname@example.org is a public mailinglist, open to anyone that wants to subscribe to it, and there are searchable archives available at the web site.
WNPP bugand ask for software you think might be useful and is not currently provided.
Linux Kernel Security Audit Projector the
Linux Security-Audit Projectincrease the security of Debian GNU/Linux since contributions will eventually help here too.
In any case, please review each problem before reporting it to email@example.com. If you are able to provide patches, that would speed up the process. Do not simply forward bugtraq mails, since they are received already. Providing additional information, however, is always a good idea.
The Debian Security Team currently consists of five members and two secretaries. The Security Team itself appoints people to join the team.
No, the Debian security team does not check every new package and neither is there an automatic (lintian) check in order to detect malicious new packages, since those checks are rather impossible to detect automatically. Maintainers, however, are fully responsible for the software that is introduced in Debian and no software is introduced that is not first signed by an authorised developers. They are in charge of analysing the software they maintain and are security-aware.
Unfortunately no, the Debian Security Team cannot handle both the stable release (unofficially also the unstable) and other older releases. However, you can expect security updated for a limited period of time (usually several months) just after a new Debian distribution is released.
Securing Debian Manual2.5 (beta) 29 augusti 2002Sat, 17 Aug 2002 12:23:36 +0200