From: Stanislav Ievlev <inger@altlinux.org>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] suid-root files
Date: Thu, 17 Jul 2003 19:42:23 +0400
Message-ID: <20030717154223.GD15483@basalt.office.altlinux.org> (raw)
In-Reply-To: <20030716163429.7c954ea3.bga@altlinux.ru>
On Wed, Jul 16, 2003 at 04:34:29PM +0400, Grigory Batalov wrote:
> On Wed, 16 Jul 2003 11:51:17 +0400
> Stanislav Ievlev <inger@altlinux.org> wrote:
>
> > > А как быть, если программа рассчитывает быть запущенной
> > > как SUID-root? В пакете Amanda семь таких программ.
> > > Sisyphus_check ругается.
>
> > sisyphus_check ругается не на то что они SUID (кстати обязательно
> > проверьте, действительно, ли нужен SUID, можно ли перейти на SGID схему?)
>
> Без правки исходников не удастся. Впрочем, программы
> при запуске проверяют uid запускавшего и выходят с ошибкой,
> если это не amanda. Так что риск немного снижается.
>
> > а на то что они доступны на чтение другим пользователям.
> > Правильные права должны быть 2711 и 4711 соответственно.
>
> А можно 4710? Вот так будет правильно?
Главное чтобы не были доступны по чтению другим
>
> amanda.spec:
> ---
> %install
>
> ...
>
> # Control settings
> %__mkdir_p %buildroot%_sysconfdir/control.d/facilities
> for i in %_libdir/amanda/dumper %_libdir/amanda/planner %_sbindir/amcheck \
> %_libdir/amanda/calcsize %_libdir/amanda/killpgrp \
> %_libdir/amanda/rundump %_libdir/amanda/runtar; do
> PROGNAME=`basename $i`
> %__cat > %buildroot%_sysconfdir/control.d/facilities/$PROGNAME << EOF
> #!/bin/sh
>
> . /etc/control.d/functions
>
> BINARY=$i
>
> new_fmode public 4710 root disk
> new_fmode restricted 700 root root
>
> control_fmode "\$BINARY" "\$*" || exit 1
> EOF
> done
> %__chmod 0755 %buildroot%_sysconfdir/control.d/facilities/*
>
> ...
>
> %pre client
> [ $1 -eq 1 ] || /usr/sbin/control-dump calcsize killpgrp rundump runtar
>
> %post client
> %post_ldconfig
> [ $1 -eq 1 ] || /usr/sbin/control-restore calcsize killpgrp rundump runtar
>
> %pre server
> [ $1 -eq 1 ] || /usr/sbin/control-dump dumper planner amcheck
>
> %post server
> %post_ldconfig
> [ $1 -eq 1 ] || /usr/sbin/control-restore dumper planner amcheck
>
> ...
>
> %files server
> %attr(4710,root,disk) %_libdir/amanda/dumper
> %attr(4710,root,disk) %_libdir/amanda/planner
> %attr(4710,root,disk) %_sbindir/amcheck
> %config %_sysconfdir/control.d/facilities/dumper
> %config %_sysconfdir/control.d/facilities/planner
> %config %_sysconfdir/control.d/facilities/amcheck
>
> ...
>
> %files client
> %attr(4710,root,disk) %_libdir/amanda/calcsize
> %attr(4710,root,disk) %_libdir/amanda/killpgrp
> %attr(4710,root,disk) %_libdir/amanda/rundump
> %attr(4710,root,disk) %_libdir/amanda/runtar
> %config %_sysconfdir/control.d/facilities/calcsize
> %config %_sysconfdir/control.d/facilities/killpgrp
> %config %_sysconfdir/control.d/facilities/rundump
> %config %_sysconfdir/control.d/facilities/runtar
>
> ...
>
> ---
> В итоге получим примерно следующие control-файлы:
>
> #!/bin/sh
>
> . /etc/control.d/functions
>
> BINARY=/usr/sbin/amcheck
>
> new_fmode public 4710 root disk
> new_fmode restricted 700 root root
>
> control_fmode "$BINARY" "$*" || exit 1
>
> > Обязательно повесьте эту штуку на control и ещё лучше по умолчанию
> > включать restricted режим для control.
>
> А как это сделать, или оно так и есть по умолчанию?
>
> --
> Григорий Баталов,
> группа техподдержки
> ОАО "Ковдорский ГОК"
> _______________________________________________
> Devel mailing list
> Devel@altlinux.ru
> http://altlinux.ru/mailman/listinfo/devel
next prev parent reply other threads:[~2003-07-17 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-16 5:01 Grigory Batalov
2003-07-16 7:51 ` Stanislav Ievlev
2003-07-16 12:34 ` Grigory Batalov
2003-07-17 15:42 ` Stanislav Ievlev [this message]
2003-07-17 17:44 ` Vadim V. Zhytnikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030717154223.GD15483@basalt.office.altlinux.org \
--to=inger@altlinux.org \
--cc=devel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git