The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

форумы  помощь  поиск  регистрация  майллист  ВХОД  слежка  RSS
"Tripwire"
Вариант для распечатки Архивированная нить - только для чтения! 
Пред. тема | След. тема 
Форумы Информационная безопасность (Public)
Изначальное сообщение [Проследить за развитием треда]

"Tripwire"
Сообщение от Baza Искать по авторуВ закладки on 09-Июн-03, 12:46  (MSK)
Несколько вопросов:
1). Для уменьшения объема отчета - как исключить из проверок на модификацию файлов файлы директорий /var/run/* /var/log/*?
2). В конфиге прописано много критичных девайсов типа /dev/scsi, которых у меня нет. Поэтому постоянная ругань:
1.   File system error.
     Filename: /proc/rtc
     No such file or directory
2.   File system error.
     Filename: /proc/scsi
     No such file or directory
3.   File system error.
     Filename: /usr/sbin/fixrmtab
     No such file or directory
4.   File system error.
     Filename: /usr/local/lib
     No such file or directory
И так штук 100
Надо их из twpol.txt убирать вручную или можно как-то автоматически?
3). А в чем тут дело?
#/usr/sbin/tripwire --update
### Error: File could not be opened
### Filename: /var/lib/tripwire/report/hostname-20030609-123229.twr
### No such file or directory
### Exiting
#ls -l /var/lib/tripwire/report/hostname-20030609-*
hostname-20030609-114726.twr
#
Документацию по Tripwire почитал, потом в книге посмотрел http://www.opennet.me/docs/RUS/linuxsos/ch12_1.html
но пока ничего не нашел по моей теме.
Заранее благодарен за любые сведения по этому поводу.
  Рекомендовать в FAQ | Cообщить модератору | Наверх

 Оглавление

  • Tripwire, LS, 13:48 , 09-Июн-03, (1)
    • Tripwire, Baza, 09:29 , 10-Июн-03, (2)
      • Tripwire, Baza, 09:49 , 10-Июн-03, (3)
        • Tripwire, LS, 14:32 , 10-Июн-03, (5)
      • Tripwire, LS, 14:13 , 10-Июн-03, (4)
        • Tripwire, Novice, 14:42 , 10-Июн-03, (6)
          • Tripwire, LS, 18:42 , 10-Июн-03, (7)
            • Tripwire, Novice, 14:41 , 11-Июн-03, (8)
              • Tripwire, LS, 03:42 , 14-Июн-03, (9)

Индекс форумов | Темы | Пред. тема | След. тема
Сообщения по теме

1. "Tripwire"
Сообщение от LS Искать по авторуВ закладки on 09-Июн-03, 13:48  (MSK)
>Несколько вопросов:
>1). Для уменьшения объема отчета - как исключить из проверок на модификацию
>файлов файлы директорий /var/run/* /var/log/*?

!/var/run ;
!/var/log ;

>2). В конфиге прописано много критичных девайсов типа /dev/scsi, которых у меня
>нет. Поэтому постоянная ругань:
>1.   File system error.
>     Filename: /proc/rtc
>     No such file or directory
>2.   File system error.
>     Filename: /proc/scsi
>     No such file or directory
>3.   File system error.
>     Filename: /usr/sbin/fixrmtab
>     No such file or directory
>4.   File system error.
>     Filename: /usr/local/lib
>     No such file or directory
>И так штук 100
>Надо их из twpol.txt убирать вручную или можно как-то автоматически?

ручками

>3). А в чем тут дело?
>#/usr/sbin/tripwire --update

-r report, --twrfile report
              Read the specified report file.

>### Error: File could not be opened
>### Filename: /var/lib/tripwire/report/hostname-20030609-123229.twr
>### No such file or directory
>### Exiting
>#ls -l /var/lib/tripwire/report/hostname-20030609-*
>hostname-20030609-114726.twr
>#
>Документацию по Tripwire почитал, потом в книге посмотрел http://www.opennet.me/docs/RUS/linuxsos/ch12_1.html

man почитай ;-)

>но пока ничего не нашел по моей теме.
>Заранее благодарен за любые сведения по этому поводу.


  Рекомендовать в FAQ | Cообщить модератору | Наверх

2. "Tripwire"
Сообщение от Baza Искать по авторуВ закладки on 10-Июн-03, 09:29  (MSK)
>-r report, --twrfile report
>            
>  Read the specified report file.

Что-то у меня не так...
#/usr/sbin/tripwire -r /var/lib/tripwire/report/hostname-20030610-010000.twr

Unknow mode specified: -r
Use --help to get help.
#man tripwire
...
-r report, --twrfile report
Write the specified report file
...

  Рекомендовать в FAQ | Cообщить модератору | Наверх

3. "Tripwire"
Сообщение от Baza Искать по авторуВ закладки on 10-Июн-03, 09:49  (MSK)
Вот еще прикол:
#/usr/sbin/tripwire -m p /etc/tripwire/twpol.txt 2>a
...
========Policy Update:....
========Step 1:...
========Step 2:...
========Step 3:...
Policy update failed; policy and database files were not altered
#cat a
Туча ошибок
#
  Рекомендовать в FAQ | Cообщить модератору | Наверх

5. "Tripwire"
Сообщение от LS Искать по авторуВ закладки on 10-Июн-03, 14:32  (MSK)
>Вот еще прикол:
>#/usr/sbin/tripwire -m p /etc/tripwire/twpol.txt 2>a
>...
>========Policy Update:....
>========Step 1:...
>========Step 2:...
>========Step 3:...
>Policy update failed; policy and database files were not altered
>#cat a
>Туча ошибок
>#

   Policy Update Mode
       Policy update mode is used by tripwire to change or update the policy
       file and to synchronize an earlier database with new policy file infor-
       mation.  The filename of the new clear text version of the policy file
       is specified on the command line.  The new policy file is compared to
       the existing version, and the database is updated according to the new
       policy rules.  Any changes in the database since the last integrity
       check will be detected and reported.  How these violations are inter-
       preted depends on the security mode specified with the (-Z or --se-
       cure-mode) option.  In high security mode (the default), Tripwire will
       print a list of violations and exit without making changes to the
       database.  In low security mode, the violations are still reported, but
       changes to the database are made automatically.

       Because the policy and database files are binary-encoded and crypto-
       graphically signed, the user will be prompted for the site and local
       passphrases to change the policy settings.  After the database is suc-
       cessfully updated, the database and policy files are re-encoded and
       signed.

  Рекомендовать в FAQ | Cообщить модератору | Наверх

4. "Tripwire"
Сообщение от LS Искать по авторуВ закладки on 10-Июн-03, 14:13  (MSK)
>>-r report, --twrfile report
>>            
>>  Read the specified report file.
>
>Что-то у меня не так...

это точно ;-)

>#/usr/sbin/tripwire -r /var/lib/tripwire/report/hostname-20030610-010000.twr
>
>Unknow mode specified: -r
>Use --help to get help.

больше одного ключа указать не пробовал?

>#man tripwire
>...
>-r report, --twrfile report
> Write the specified report file
>...


причем здесь запись отчета? внимательней читай - вот кусок, который тебе нужен

   Database Update mode:
           -m u                --update
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           -v                  --verbose
           -s                  --silent, --quiet
           -c cfgfile          --cfgfile cfgfile
           -p polfile          --polfile polfile
           -d database         --dbfile database
           -r report           --twrfile report
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           -S sitekey          --site-keyfile sitekey
           -L localkey         --local-keyfile localkey
           -P passphrase       --local-passphrase passphrase
           -V editor           --visual editor
           -a                  --accept-all
           -Z { low | high }   --secure-mode { low | high }

  Рекомендовать в FAQ | Cообщить модератору | Наверх

6. "Tripwire"
Сообщение от Novice Искать по авторуВ закладки on 10-Июн-03, 14:42  (MSK)
На счет "-m u -r reportfilename" я понял - буду внимательней.
К сожалению проблема не решилась.
Установил tripwire поновее - 2.3.1-10 (для RH7.3)
Ошибки вылазят те же:
Убрал я несуществующие файлы, типа /proc/scsi, /bin/tcsh... из twpol.txt
Кстати на записи типа
!/usr/local/bin
ругается. Типа недопустимый синтаксис. Пришлось решетку "#"ставить вместо "!".
#/usr/sbin/tripwire -m p /etc/tripwire/twpol.txt
Parsing policy file: ...
....
====Step1: Gathering information for the new policy
...
Error: Policy Update Changed Object.
An object has been changed since the database was last updated.
Object name: Conflicting properties for object /etc/hosts.deny
>Size
>Modify Time
>CRC32
>MD5
....
====Step2:Updating the database with new objects.
====Step3: Pruning unneeded objects from the database.
Policy update failed; policy and database files were not altered
#
  Рекомендовать в FAQ | Cообщить модератору | Наверх

7. "Tripwire"
Сообщение от LS Искать по авторуВ закладки on 10-Июн-03, 18:42  (MSK)
>На счет "-m u -r reportfilename" я понял - буду внимательней.
>К сожалению проблема не решилась.
>Установил tripwire поновее - 2.3.1-10 (для RH7.3)
>Ошибки вылазят те же:
>Убрал я несуществующие файлы, типа /proc/scsi, /bin/tcsh... из twpol.txt
>Кстати на записи типа
>!/usr/local/bin

!/usr/local/bin ;

>ругается. Типа недопустимый синтаксис. Пришлось решетку "#"ставить вместо "!".

решетка - это комментарий = строка конфига полностью игнорируется

>#/usr/sbin/tripwire -m p /etc/tripwire/twpol.txt

блин - выше же дал кусок из мана. перевести тебе его что ли?

смотри ключ -Z. если были ошибки при секюрности high, то ничего не обновится

>Parsing policy file: ...
>....
>====Step1: Gathering information for the new policy
>...
>Error: Policy Update Changed Object.
>An object has been changed since the database was last updated.
>Object name: Conflicting properties for object /etc/hosts.deny
>>Size
>>Modify Time
>>CRC32
>>MD5
>....
>====Step2:Updating the database with new objects.
>====Step3: Pruning unneeded objects from the database.
>Policy update failed; policy and database files were not altered
>#


  Рекомендовать в FAQ | Cообщить модератору | Наверх

8. "Tripwire"
Сообщение от Novice Искать по авторуВ закладки on 11-Июн-03, 14:41  (MSK)
1. Исправил twpol.txt
2.
#/usr/sbin/tripwire -m p -Z low /etc/tripwire/twpol.txt
Parsing policy...
Please enter your local pass...
Please enter your site pass...
=======Policy Update:....
=======Step1:..
###Warning: File system error.
###Filename: /etc/tripwire/localhost-local.key
###No such file or directory
###Continuing...
=======Step2:Updating...
=======Step3:Pruning...
Wrote policy file: /etc/.../tw.pol
Wrote database file: /var/.../hostname.twd
#/usr/sbin/tripwire --init
Please enter your local pass...
Parsing policy...
Generating the database...
***Processing Unix File System ***
###Warning: File system error.
###Filename: /etc/tripwire/localhost-local.key
###No such file or directory
###Continuing...
Wrote database file: /var/.../hostname.twd
The database was successfully generated
#/usr/sbin/tripwire --update
###Error: File could not be opened.
###Filename: /var/lib/tripwire/report/hostname-20030611-142652.twr
###No such file or directory
###Exiting...
#
  Рекомендовать в FAQ | Cообщить модератору | Наверх

9. "Tripwire"
Сообщение от LS emailИскать по авторуВ закладки on 14-Июн-03, 03:42  (MSK)
>1. Исправил twpol.txt
>2.
>#/usr/sbin/tripwire -m p -Z low /etc/tripwire/twpol.txt
>Parsing policy...
>Please enter your local pass...
>Please enter your site pass...
>=======Policy Update:....
>=======Step1:..
>###Warning: File system error.
>###Filename: /etc/tripwire/localhost-local.key
>###No such file or directory
>###Continuing...
>=======Step2:Updating...
>=======Step3:Pruning...
>Wrote policy file: /etc/.../tw.pol
>Wrote database file: /var/.../hostname.twd
>#/usr/sbin/tripwire --init
>Please enter your local pass...
>Parsing policy...
>Generating the database...
>***Processing Unix File System ***
>###Warning: File system error.
>###Filename: /etc/tripwire/localhost-local.key
>###No such file or directory
>###Continuing...
>Wrote database file: /var/.../hostname.twd
>The database was successfully generated
>#/usr/sbin/tripwire --update
>###Error: File could not be opened.
>###Filename: /var/lib/tripwire/report/hostname-20030611-142652.twr
>###No such file or directory
>###Exiting...
>#


И ПОНЕСЛАСЬ СКАЗКА ПРО UPDATE POLICY (на примерах ;-) - ставлю на домашней машине спешиал фор ю ;-))

про инсталяцию:

собирал из исходников, и поставил и обозвал все так, как мне хотелось. вот заметки, которые я сделал для
себя, про патч, который все это вытворяет (чтобы не было вопросов про пути и названия файлов конфигурации):

[syslha@localhost patch]$ cat tripwire-01.txt

- added 'build.bsh' script in the source directory for easy compilation process. # не важно

- next changes in the default instalation paths:

    /usr/local/etc/tripwire             - configuration directory.
    /usr/local/sbin/tripwire            - binary files directory
    /var/local/tripwire                 - databases rirectory
    /var/local/tripwire/report          - reports directory
    /usr/local/share/doc/tripwire       - documentation
    /usr/local/share/man/tripwire       - man pages

- the tripwire configuration file name is 'tripwire.txt' (clear) & tripwire.conf
(crypted). the tripwire policy file name is 'policy.txt' (clear) & policy.conf
(crypted).

У ВАС ВСЕ УЖЕ ПОСТАВЛЕНО (хоть и по своему) - НАЧИНАЕМ!

1)
генерируем site & local key:

[root@localhost syslha]# /usr/local/sbin/tripwire/twadmin -m G \
>             -S /usr/local/etc/tripwire/site.key \
>             -Q spswd
Generating key (this may take several minutes)...Key generation complete.
[root@localhost syslha]# /usr/local/sbin/tripwire/twadmin -m G \
>             -L /usr/local/etc/tripwire/local.key \
>             -P lpswd
Generating key (this may take several minutes)...Key generation complete.

!!! думаю не надо говорить, что аргументы опций -Q & -P, которые задают пароль, могут быть любыми

2)
правим конфигурацию tripwire & policy под себя


3)
шифруем файлы конфигурации tripwire & policy:


[root@localhost syslha]# /usr/local/sbin/tripwire/twadmin -m F \
>             -c /usr/local/etc/tripwire/tripwire.conf \
>             -S /usr/local/etc/tripwire/site.key \
>             -Q spswd \
>             /usr/local/etc/tripwire/tripwire.txt
Wrote configuration file: /usr/local/etc/tripwire/tripwire.conf
[root@localhost syslha]# /usr/local/sbin/tripwire/twadmin -m P \
>             -c /usr/local/etc/tripwire/tripwire.conf \
>             -p /usr/local/etc/tripwire/policy.conf \
>             -S /usr/local/etc/tripwire/site.key \
>             -Q spswd \
>             /usr/local/etc/tripwire/policy.txt
Wrote policy file: /usr/local/etc/tripwire/policy.conf


4)
строим БД tripwire:


[root@localhost syslha]#

[root@localhost syslha]# /usr/local/sbin/tripwire/tripwire -m i
Parsing policy file: /usr/local/etc/tripwire/policy.conf
Generating the database...
*** Processing Unix File System ***
### Warning: File system error.
### Filename: /proc/scsi
^^^^^^^^^^^^^^^^^^^^^^^^ - будем дальше на это смотреть (кто первый встал - того и тапки ;-)))
### No such file or directory
### Continuing...
### Warning: File system error.
### Filename: /usr/sbin/fixrmtab
### No such file or directory
### Continuing...

....

### Warning: File system error.
### Filename: /root/.esd_auth
### No such file or directory
### Continuing...
### Warning: File system error.
### Filename: /root/.gnome-desktop
### No such file or directory
### Continuing...
Please enter your local passphrase:
Wrote database file: /var/local/tripwire/localhost.localdomain.twd
The database was successfully generated.
[root@localhost syslha]#

ошибок до фига - стандартная конфигурация, которая под нас не совсем подходит... - а про что я в
п. 2 говорил? ;-))

5)
апгрейдим ДВ tripwire в соответствии с исправленным файлом policy:

cp policy.txt policy.txt.new

правим policy.txt.new, убирая лишнее (см. 4) и добавляя по желанию... (убрал  /proc/scsi)


[root@localhost syslha]# /usr/local/sbin/tripwire/tripwire -m p -p /usr/local/etc/tripwire/policy.conf.new /usr/local/etc/tripwire/policy.txt.new
Parsing policy file: /usr/local/etc/tripwire/policy.txt.new
======== Policy Update: Processing section Unix File System.
======== Step 1: Gathering information for the new policy.

нормально - на скази наплевал (нет его в новом policy - начал сразу с /usr/sbin/fixrmtab) - см.выше

### Warning: File system error.
### Filename: /usr/sbin/fixrmtab
### No such file or directory
### Continuing...
....

======== Step 2: Updating the database with new objects.
======== Step 3: Pruning unneeded objects from the database.
Policy update failed; policy and database files were not altered.
[root@localhost syslha]#


Oo-o-ps!!!

man tripwire:

Policy Update mode:
           -m p                --update-policy
           -v                  --verbose
           -s                  --silent, --quiet
           -c cfgfile          --cfgfile cfgfile
           -p polfile          --polfile polfile
           -d database         --dbfile database
           -S sitekey          --site-keyfile sitekey
           -L localkey         --local-keyfile localkey
           -P passphrase       --local-passphrase passphrase
           -Q passphrase       --site-passphrase passphrase
           -Z { low | high }   --secure-mode { low | high }
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


[root@localhost syslha]# /usr/local/sbin/tripwire/tripwire -m p -p /usr/local/etc/tripwire/policy.conf.new -Z low /usr/local/etc/tripwire/policy.txt.new
Parsing policy file: /usr/local/etc/tripwire/policy.txt.new
======== Policy Update: Processing section Unix File System.
======== Step 1: Gathering information for the new policy.

по прежнему - ни слова про scsi...

### Warning: File system error.
### Filename: /usr/sbin/fixrmtab
### No such file or directory
### Continuing...
...

### Continuing...
======== Step 2: Updating the database with new objects.
======== Step 3: Pruning unneeded objects from the database.
Please enter your site passphrase:
Please enter your local passphrase:
Wrote policy file: /usr/local/etc/tripwire/policy.conf.new
Wrote database file: /var/local/tripwire/localhost.localdomain.twd
[root@localhost syslha]#

смотрим:

[root@localhost syslha]# ls /usr/local/etc/tripwire
local.key  policy.conf  policy.conf.new  policy.txt  policy.txt.new  site.key  tripwire.conf  tripwire.txt
[root@localhost syslha]#

policy.conf.new - новый криптованый файл полиси создан из нашего нового policy.txt.new. БД tripwire
тоже обновилась (судя по "Wrote database file: /var/local/tripwire/localhost.localdomain.twd")


вот так вот... дальше маны переводить, боюсь у меня времени не будет - разбирайся сам.

Всего хорошего!!

  Рекомендовать в FAQ | Cообщить модератору | Наверх


Удалить

Индекс форумов | Темы | Пред. тема | След. тема
Пожалуйста, прежде чем написать сообщение, ознакомьтесь с данными рекомендациями.




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру