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.
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.
Yes. Bastille Linux
,
originally oriented towards some Linux distributions (RedHat 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,
name bastille
.
Some people believe, however, that a hardening tool does not eliminate the need for good administration.
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 Linux
Security-Audit Project
.
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
in Debian
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/cache/man
/var/mail
are 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/postgresql
are owned by this user to enforce proper
security.
Other groups which have no associated user:
ppp
, dip
,
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/share/doc/sudo/OPTIONS
.
/usr/src
. It
can be used locally to give a user the ability to manage system source code.
/etc/shadow
is readable by this group. Some programs that
need to be able to access the file are set gid shadow.
/var/run/utmp
and similar files.
Programs that need to be able to write to it are sgid utmp.
/usr/local
, /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 /home
.
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
equivs
package.
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 mailing
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
(see reject or deny
issues
).
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?
No, /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-tiny
which is similar to vi
)
/etc/shadow
and change the line:
root:asdfjl290341274075:XXXX:X:XXXX:X::: (X=any number)
to:
root::XXXX:X:XXXX:X:::
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
to rerun 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).
Read this document and take the appropiate measures outlined here. If you need assistance you might use the debian-security@lists.debian.org 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), traceroute
, whois
and
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
http://security.debian.org
.
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 security@debian.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.
You might find lines in your logs like:
Apr 1 09:25:01 server su[30315]: + ??? root-nobody Apr 1 09:25:01 server PAM_unix[30315]: (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
cron (usually /etc/cron.daily/find
or logrotate
):
$ 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
Add DenyFilter \*.*/ to your configuration file, for more
information see http://www.proftpd.org/critbugs.html
.
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 security area
).
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.
A report published
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.
A: Security information can be sent to security@debian.org, which is read by all Debian developers. If you have sensitive information please use team@security.debian.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 security@debian.org 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). Debian-security@lists.debian.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 bug
and ask for
software you think might be useful and is not currently provided.
Linux Kernel Security Audit
Project
or the Linux
Security-Audit Project
increase the security of Debian GNU/Linux
since contributions will eventually help here too.
In any case, please review each problem before reporting it to security@debian.org. 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 just after a new Debian distribution is released.
Securing Debian Manual
v2.2 27 april 2002Tue, 23 Apr 2002 20:56:15 +0200jfs@computer.org