Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What's basic to a healthy secure gentoo system
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
schmeggahead
Guru
Guru


Joined: 25 Feb 2003
Posts: 314
Location: Columbus, Ohio

PostPosted: Fri Nov 23, 2007 5:17 pm    Post subject: What's basic to a healthy secure gentoo system Reply with quote

I've been kind of ad hoc managing my Gentoo systems and was wondering what everyone thought was basic to handling the system appropriately.

My list looks something like this:

1. update packages frequently:
emerge --sync (daily)
emerge -uDv system (daily) <- substitute glsa-check
emerge -uDv world (daily) <-substitute --pretend and then do the real thing weekly
revdep-rebuild (weekly)

2. monitor logs and intrusion:
logrotate
logwatch
chkrootkit
(add brute force check for ssh, sftp)

3. reboot periodically (weekly)

4. use hardened on non-X systems

Any other items that are critical?


Last edited by schmeggahead on Sat Nov 24, 2007 11:29 am; edited 1 time in total
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Fri Nov 23, 2007 7:25 pm    Post subject: Reply with quote

I think in theory, upgrading all your packages would catch this, but I have found that the secret to a healthy and secure system is not to just 'Deep update everything; all the time.' You did not say bleeding edge.

if you care about security, check glsa once a day (I cron this to a file)
something like this the folder reports must already exist.
Code:
/usr/bin/glsa-check -p all | grep / >> /root/reports/glsas


if you care about health, you should revdep-rebuild -p daily also to a file
something like this:
nice revdep-rebuild -p -i -q >> /root/reports/revdeps
edit: well I cron it daily, but really it only should be done after you have installed packaged that day install a package

and truly, if your priorities really are health and security...emerge world should be weekly, because that is when your breakages WILL occur, and you might not want that to be on a day when you need to get actual work done.

btw, you specifically mentioned emerge -uD system and emerge -uD world, feel free to double check, but I thought world included all system updates. system being a subset of work.
_________________
emerge: there are no ebuilds to satisfy "moo"


Last edited by coolsnowmen on Fri Nov 23, 2007 9:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
Phenax
l33t
l33t


Joined: 10 Mar 2006
Posts: 972

PostPosted: Fri Nov 23, 2007 7:46 pm    Post subject: Reply with quote

Update every week (month max).
Give major items about a week to 'sit' before upgrading to them.
Back to top
View user's profile Send private message
micmac
l33t
l33t


Joined: 28 Nov 2003
Posts: 996

PostPosted: Fri Nov 23, 2007 9:39 pm    Post subject: Reply with quote

How about "None of the above"? Instead subscribe to the GLSA announcement mailing list and when a GLSA comes your way sync your tree and install the update. Makes Gentoo pretty easy to maintain.
Back to top
View user's profile Send private message
tylerwylie
Guru
Guru


Joined: 19 Sep 2004
Posts: 458
Location: /US/Georgia/Atlanta

PostPosted: Fri Nov 23, 2007 9:42 pm    Post subject: Reply with quote

micmac wrote:
How about "None of the above"? Instead subscribe to the GLSA announcement mailing list and when a GLSA comes your way sync your tree and install the update. Makes Gentoo pretty easy to maintain.
You never know when the next Expat is going to hit.

++
Back to top
View user's profile Send private message
schmeggahead
Guru
Guru


Joined: 25 Feb 2003
Posts: 314
Location: Columbus, Ohio

PostPosted: Fri Nov 23, 2007 9:44 pm    Post subject: Reply with quote

Thanks for the insights. I'd forgotten about glsa.
I figured updating daily would be better but glsa is a better daily approach - decide if it is really worth the possible impact.

I updated system first because I'm not using emwrap to force tool chain updates.
I'm thinking I should use that script to avoid updating the toolchain without a great deal of time to work it through.

So for my workstation systems, I could update during the week in between, if I was wanting to get that work out of the way.

I think the glsa does work, but I'm not sure how to make it silent if there are no applicable impacted packages. (I use glsa-check -l | grep -v [U]
and always get these lines:
[A] means this GLSA was already applied,
[U] means the system is not affected and
[N] indicates that the system might be affected.

) I think it has to do with standard error rather then standard out, but haven't gotten to looking up how to send that to /dev/null.

I'll be creating cron scripts now.
Thanks.
Back to top
View user's profile Send private message
schmeggahead
Guru
Guru


Joined: 25 Feb 2003
Posts: 314
Location: Columbus, Ohio

PostPosted: Fri Nov 23, 2007 9:45 pm    Post subject: Reply with quote

micmac wrote:
How about "None of the above"? Instead subscribe to the GLSA announcement mailing list and when a GLSA comes your way sync your tree and install the update. Makes Gentoo pretty easy to maintain.


Well, I do subscribe to GLSA announcement (about a month now) and I'm trying to figure out with all the Gentoo boxes and their various configurations, which ones apply to me. I'm not familiar with all of the 150-300 packages installed on each system.

I think the emerge --sync and the glsa-check on each one is the way to go to get the information.


Note: I did fight the expat battle for a while and really ended up with full system rebuilds (that's why I'm asking the questions now).
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Fri Nov 23, 2007 9:49 pm    Post subject: Reply with quote

Quote:
I think the glsa does work, but I'm not sure how to make it silent if there are no applicable impacted packages. (I use glsa-check -l | grep -v [U]
and always get these lines:
[A] means this GLSA was already applied,
[U] means the system is not affected and
[N] indicates that the system might be affected.

) I think it has to do with standard error rather then standard out, but haven't gotten to looking up how to send that to /dev/null.


Did you try what I suggested above?
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
Phobos666
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2006
Posts: 76
Location: Germany

PostPosted: Fri Nov 23, 2007 11:06 pm    Post subject: Reply with quote

- USE="hardened"
- GLSA check after every sync every day
- hardened-sources

rock-solid, secure and neat.

and dont listen to the expat lame warnings. when you understand gentoo, theres no expat pain.
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Fri Nov 23, 2007 11:48 pm    Post subject: Reply with quote

Phobos666 wrote:
and dont listen to the expat lame warnings. when you understand gentoo, theres no expat pain.


what do your mean by this?
there was an abi change in expat right? required relinking of all programs using it?
what gentoo knowledge removed that pain?
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
Phobos666
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2006
Posts: 76
Location: Germany

PostPosted: Sat Nov 24, 2007 2:23 am    Post subject: Reply with quote

yeah right. but revdep-rebuild --library=/usr/lib/libexpat.so.x.x.x (dunno the old version) did the whole trick.
i think there were postins warnings to do that.

i did this exactly after the expat update on all 4 machines directly after the update. thats no expat pain.
Back to top
View user's profile Send private message
schmeggahead
Guru
Guru


Joined: 25 Feb 2003
Posts: 314
Location: Columbus, Ohio

PostPosted: Sat Nov 24, 2007 10:55 am    Post subject: Reply with quote

try doing that six months after the expat problem surfaced and then search the forums for the right answer. :oops:
That was my expat pain.
No revdep-rebuild or emerge -e world will fix that - the dependencies are too complex. I don't think I knew about emwrap then though.
(and I think I'm the only one who didn't upgrade their systems for that long, so no one else was working the problem from that vantage point). :(

Really, I know I can't be on this distro (or any for that matter) without constant upgrades (weekly at a minimum). And that's ok. :)

But I learned that the hard way. (And no, after 4 years on Gentoo with multiple, I don't "know Gentoo" - and yes, I did stage 1 installs as a total noob to linux/unix and boy was I confused, but they worked and worked well.)

and thank you coolsnowmen for pointing out the script in your previous post. I really did miss the connection by reading the thread in stages. :oops: Thanks for explicitly connecting it for me (matrix threading). 8)

The more I learn about Gentoo, the more I like it.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5937

PostPosted: Sat Nov 24, 2007 11:04 am    Post subject: Reply with quote

cron wrote:
# Portage
0 2 * * * emerge --sync >> /dev/null 2>&1
0 8 * * 0 emerge -puvDN --nospinner world
30 8 * * 0 glsa-check -n -l affected

# SSH+FTP brute force check
55 23 * * * grep "`date +'%b %e'`" /var/log/auth.log | grep "Invalid user"
55 23 * * * grep "`date +'%b %e'`" /var/log/vsftpd.log | grep "FAIL LOGIN"


works for me at the moment.

cheers
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017


Last edited by bunder on Sat Nov 24, 2007 11:14 am; edited 1 time in total
Back to top
View user's profile Send private message
schmeggahead
Guru
Guru


Joined: 25 Feb 2003
Posts: 314
Location: Columbus, Ohio

PostPosted: Sat Nov 24, 2007 11:13 am    Post subject: Reply with quote

Phobos666 wrote:
- USE="hardened"
- GLSA check after every sync every day
- hardened-sources

rock-solid, secure and neat.


And not necessarily generally usable over the portage tree from my 3 week experience with setting up systems to use it. :?

So can you use hardened without using the hardened stage 3 install?

I've found an x system really has limitations when using the hardened stage, hardened sources and any kind of gaming or wine or mplayer or (you name any fun graphical application to use on linux). Every where I turned was broken glass and razor blades washed with wasabi and salt water :( The connections and complexity of information integration required to even locate solutions was beyond my feeble brain, much less understand/decode them when they were handed to me by more able minds.

The "simple" task of getting mplayer to work on a hardened system was daunting. And I abandoned that because of the multiple collisions with incompatibility for what I wanted to accomplish.

Of course I was fighting multiple battles with hardware drivers, dmraid, learning lvm, doing my first hardened x install, minimizing use settings for security and trying to put windoz on the same box to dual boot dmraid. So maybe I tackle too much at once. (it's me, not Gentoo that is flawed here). Besides, I have no business logging even the appearance of a complaint, for I am not a developer, just a tester, the developers worst nightmare of a tester. :twisted:

But as I've stated before, I don't "understand Gentoo."
(there is some source I haven't read, about a zillion lines) :wink:

(bunder - thanks for the script - I owe you moderators as well :wink: )
Back to top
View user's profile Send private message
speeddemon
Apprentice
Apprentice


Joined: 27 Sep 2003
Posts: 162

PostPosted: Tue Nov 27, 2007 3:44 pm    Post subject: Reply with quote

Phobos666 wrote:
yeah right. but revdep-rebuild --library=/usr/lib/libexpat.so.x.x.x (dunno the old version) did the whole trick.
i think there were postins warnings to do that.

i did this exactly after the expat update on all 4 machines directly after the update. thats no expat pain.

But the problem was that didn't work for everyone. revdep-rebuild couldn't complete on my system, it couldn't work out the dependencies and kept failing with compile errors. Which meant I had to work them out, and figure out the reinstall order on my own. Even though I knew about the issue, and the supposed fix, I still had problems because the "fix" didn't work on my machine.

Personally I don't update that often any more, just for security updates or if there is some new functionality I want. The expat issue is the only thing thats broken my system in a few years now. I keep the system stable, and update for security, but other than that I don't see the need to wear out hardware compiling for no reason.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum