Exibe o histórico de um arquivo (lista de usuários que modificaram um arquivo)

8

Existe um comando para exibir uma lista de usuários que modificaram um arquivo que fornece um histórico de arquivos?

Eu sei que isso é possível com o svn / git etc .. mas nós temos um arquivo de configuração que não está no SVN e alguém o modificou.

    
por Abdullah 03.07.2012 / 15:45

2 respostas

12

Se você não tiver ativado anteriormente algum tipo de auditoria, não haverá uma ferramenta que possa relatar isso depois que o arquivo tiver sido modificado. Você pode obter a data e hora de quando o arquivo foi modificado pela última vez, mas não um histórico de revisão.

Seguindo em frente, você pode instalar, configurar, ativar o pacote auditd .

Na página auditctl man:

-w path
    Insert  a  watch for the file system object at path. You cannot insert
    a watch to the top level directory. This is prohibited by the  kernel. 
    Wildcards  are not supported either and will generate a warning. The way
    that watches work is by tracking the inode internally. If you place a 
    watch on a file, its the same as  using  the  -F  path  option  on a 
    syscall rule. If you place a watch on a directory, its the same as using
    the -F dir option on a syscall rule.  The  -w form  of  writing watches 
    is for backwards compatibility and the syscall based form is more
    expressive. Unlike most syscall auditing rules,  watches  do  not impact
    performance  based on the number of rules sent to the kernel. The only 
    valid options when using a watch are the -p and -k. If you  need to     
    anything fancy like audit a specific user accessing a file, then use 
    the syscall auditing form with the path or dir fields.

Há mais discussões sobre isso na pergunta Registro de criações de arquivos ocultos

    
por 03.07.2012 / 15:56
2

Aqui alguns discutem sobre hacking com inotify para fazer com que você forneça PID e UID. link

Veja também a Auditoria link

    
por 03.07.2012 / 16:04