Показаны различия между двумя версиями страницы.
| Следующая версия | Предыдущая версия | ||
|
linux:samba:audit [2012/02/17 11:24] linko22@gmail.com создано |
linux:samba:audit [2012/02/17 11:34] (текущий) linko22@gmail.com |
||
|---|---|---|---|
| Строка 39: | Строка 39: | ||
| </ | </ | ||
| - | If to look careful at full_audit: | + | Нада быть острожным с full_audit: |
| - | full_audit: | + | **full_audit: |
| - | %u - User | + | **%u** - Пользователь |
| - | %I - User IP address | + | **%I** - IP адрес пользователя |
| - | %S - Server share name | + | **%S** - Расшареная папка на сервере |
| - | for full list of substitutions see this page: | + | Полный список переменных можно будет найти на этой странице [[http:// |
| - | http:// | + | Для включения аудита на каждую расшаренную папку надо добавить эту строку: |
| - | section VARIABLE SUBSTITUTIONS | + | **vfs objects = full_audit |
| + | ** | ||
| - | To each share where file audit is needed add this line: | + | Пример: |
| - | + | ||
| - | vfs objects = full_audit | + | |
| - | like this: | + | |
| + | < | ||
| [public] | [public] | ||
| comment = Public Stuff | comment = Public Stuff | ||
| Строка 66: | Строка 65: | ||
| writable = no | writable = no | ||
| write list = @staff | write list = @staff | ||
| - | vfs object = full_audit | + | |
| + | </ | ||
| That's all about samba. So where all this audit logs are going now ? As you can see from these lines: | That's all about samba. So where all this audit logs are going now ? As you can see from these lines: | ||
| Строка 81: | Строка 82: | ||
| Add these lines: | Add these lines: | ||
| + | < | ||
| filter f_local5 {facility(local5); | filter f_local5 {facility(local5); | ||
| destination m_samba_audit { file("/ | destination m_samba_audit { file("/ | ||
| log { source(src); | log { source(src); | ||
| + | </ | ||
| BEFORE line | BEFORE line | ||
| + | < | ||
| log { source(src); | log { source(src); | ||
| - | + | </ | |
| - | This will tell syslog-ng to filter only LOCAL5 message and write them to | + | This will tell syslog-ng to filter only LOCAL5 message and write them to **/ |
| - | + | ||
| - | / | + | |
| - | and skip this audit records from being recorded in / | + | |
| Configuring | Configuring | ||
| Строка 97: | Строка 98: | ||
| In standard configuration of syslogd there is a line in file syslog.conf : | In standard configuration of syslogd there is a line in file syslog.conf : | ||
| + | < | ||
| *.*; | *.*; | ||
| + | </ | ||
| To filter audit messages away from main syslog file, change this line to: | To filter audit messages away from main syslog file, change this line to: | ||
| + | < | ||
| *.*; | *.*; | ||
| - | Add following line after | + | </ |
| + | Add following line after | ||
| + | < | ||
| local5.notice / | local5.notice / | ||
| + | </ | ||
| Restaring | Restaring | ||
| Строка 109: | Строка 116: | ||
| Restart samba | Restart samba | ||
| - | # / | + | |
| and syslog, ususally this is done via this command | and syslog, ususally this is done via this command | ||
| - | # / | + | |
| However in your distro may be different way. | However in your distro may be different way. | ||
| Строка 124: | Строка 131: | ||
| Create new file / | Create new file / | ||
| + | < | ||
| / | / | ||
| | | ||
| Строка 134: | Строка 142: | ||
| | | ||
| } | } | ||
| + | </ | ||
| References | References | ||
| - | http:// | + | [[http:// |
| - | The syslog-ng 3.0 Administrator Guide | + | |
| + | [[http:// | ||