Enable auditing in 3.2? 

General configuration questions

Enable auditing in 3.2?

Postby gronfelt » 07 Sep 2009, 20:31

I've tried to enable auditing in Alfresco 3.2, following the instructions in the wiki, but it doesn't seem to work, no audit trail is created when I download a file for instance.

I've copied the file auditConfig.xml to tomcat/shared/classes/alfresco/extension/ and edited the relevant parts:

Code: Select all
<Audit xmlns="http://www.alfresco.org/model/audit/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" enabled="true" auditInternal="false" mode="all">


and

Code: Select all
    <Service name="ContentService" mode="none">
        <Method name="getWriter" mode="all"/>
        <Method name="transform" mode="all"/>
        <Method name="getReader" mode="all"/>
    </Service>


Is there anything else that needs to be done in Alfresco 3.2?
Opportunity is missed by most people because it is dressed in overalls and looks like work. -- Thomas A Edison
Feel free to rate this post as useful if it was of any help to you.
User avatar
gronfelt
Community Guru
Community Guru
 
Posts: 272
Joined: 20 Apr 2009, 20:05
Location: Sweden
Alfresco Version: 3.2

25 Points (What is this?)

Re: Enable auditing in 3.2?

Postby derek » 08 Sep 2009, 12:20

Hi,
Turn on DEBUG for the audit model and make sure that the audit mode is as expected:
log4j.logger.org.alfresco.repo.audit.model=DEBUG

Regards
Derek Hulley
Senior Software Engineer, Alfresco
** If this post was helpful, please click Yes on the Post Rating **
http://wiki.alfresco.com/ - Alfresco Wiki docs
http://issues.alfresco.com/ - JIRA bug reporting site
derek
Alfresco Engineer
Alfresco Engineer
 
Posts: 925
Joined: 27 Jun 2005, 12:43
Location: Alfresco HQ

30 Points (What is this?)

Re: Enable auditing in 3.2?

Postby lees » 19 Oct 2009, 06:48

Got any solution?

It doesn't work for me also.
lees
Community Member
Community Member
 
Posts: 17
Joined: 24 Aug 2009, 17:30
Alfresco Version: 3.2

1 Point (What is this?)

Re: Enable auditing in 3.2?

Postby BertrandF » 19 Oct 2009, 07:24

I've got the same problem with 3.2r and the nightly build version.
Maybe due to the patch : patch.db-V3.2-AuditTables (AlfrescoPostCreate-3.2-AuditTables.sql) ?
Alfresco 3.2.xE or 3.3E / MySQL Server 5.1 / Windows XP Pro SP2
--
Image Atol Conseils et Développements
Image AuditSurf is based on Audit Trail Framework and SURF Framework.
About AuditSurf (in French) / Download AuditSurf (Enterprise & Community versions)
User avatar
BertrandF
Community Member
Community Member
 
Posts: 16
Joined: 20 Jan 2009, 09:01
Location: Dijon, France
Alfresco Version: 3.3

3 Points (What is this?)

Re: Enable auditing in 3.2?

Postby BertrandF » 20 Oct 2009, 14:13

I've enabled audit (in auditConfig.xml, I just changed "enable=true").

I turned DEBUG on for the audit model :
Code: Select all
DEBUG [org.alfresco.repo.audit.model.AuditEntry] Audit configuration
DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Audit Mode = ALL
DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Enabled = TRUE


I created/read/updated documents, workflows, ... but 'Service' and 'Method' columns aren't populated in the DB.
It's look like I haven't turn audit on.

AuditSurf works with Alfresco 3.2 but not with Alfresco 3.2r and Alfresco 3.2 nightly-build ...

Tested on :
Alfresco Community 3.2r (r 2384) schema 3003 / Tomcat 6.0.18 / MySQL 5.1 / JDK 6u12 x32 / Win XP SP2


Anybody got any ideas?
Thanks.
Alfresco 3.2.xE or 3.3E / MySQL Server 5.1 / Windows XP Pro SP2
--
Image Atol Conseils et Développements
Image AuditSurf is based on Audit Trail Framework and SURF Framework.
About AuditSurf (in French) / Download AuditSurf (Enterprise & Community versions)
User avatar
BertrandF
Community Member
Community Member
 
Posts: 16
Joined: 20 Jan 2009, 09:01
Location: Dijon, France
Alfresco Version: 3.3

3 Points (What is this?)

Re: Enable auditing in 3.2?

Postby derek » 20 Oct 2009, 14:30

Hi,
I'm getting this added to the release notes - apologies for missing it out - but details are here:
http://wiki.alfresco.com/wiki/Audit (See "As of 3.2r")
Regards
Derek Hulley
Senior Software Engineer, Alfresco
** If this post was helpful, please click Yes on the Post Rating **
http://wiki.alfresco.com/ - Alfresco Wiki docs
http://issues.alfresco.com/ - JIRA bug reporting site
derek
Alfresco Engineer
Alfresco Engineer
 
Posts: 925
Joined: 27 Jun 2005, 12:43
Location: Alfresco HQ

30 Points (What is this?)

Re: Enable auditing in 3.2?

Postby BertrandF » 20 Oct 2009, 14:44

Thanks Derek, it works fine now :D
Regards.
Alfresco 3.2.xE or 3.3E / MySQL Server 5.1 / Windows XP Pro SP2
--
Image Atol Conseils et Développements
Image AuditSurf is based on Audit Trail Framework and SURF Framework.
About AuditSurf (in French) / Download AuditSurf (Enterprise & Community versions)
User avatar
BertrandF
Community Member
Community Member
 
Posts: 16
Joined: 20 Jan 2009, 09:01
Location: Dijon, France
Alfresco Version: 3.3

3 Points (What is this?)

Re: Enable auditing in 3.2?

Postby lees » 21 Oct 2009, 05:47

it works for me also. It displays the audit details as below

Code: Select all
tmp.user     SystemMethodInterceptor     NodeService     getAspects     Oct 21, 2009 10:24:10 AM     OK           workspace://SpacesStore/c6697a21-f7d0-4d6d-834a-39a3b8850b6c                             [{http://www.alfresco.org/model/content/1.0}auditable, {http://www.alfresco.org/model/system/1.0}referenceable, {http://www.alfresco.org/model/content/1.0}titled, {http://www.alfresco.org/model/content/1.0}lockable, {http://www.alfresco.org/model/content/1.0}author, {http://www.alfresco.org/model/content/1.0}templatable]           e4aba8e7-49a6-4273-ac05-edcbc27659db


But this is not the property that I am looking for and how can we read this. How can I get the audit information related to a file/folder(like who all are the users updated content, what are files added/deleted etc)?
lees
Community Member
Community Member
 
Posts: 17
Joined: 24 Aug 2009, 17:30
Alfresco Version: 3.2

1 Point (What is this?)

Re: Enable auditing in 3.2?

Postby derek » 21 Oct 2009, 06:03

Hi,
The new audit code in 3.2r was designed to store the information in a more searchable and concise form. It's still early days for the code, so I've not had a chance to detail the configuration on the Wiki.
Take a look at: org.alfresco.repo.audit.AuditComponentTest#testAuditAuthenticationService. It uses config from classpath:alfresco/audit/alfresco-audit-test.xml like this:
Code: Select all
...
    <PathMappings>
        ...
        <PathMap source="/alfresco-api" target="/api-test"/>
    </PathMappings>
....
    <Application name="API Test" key="api-test">
        <AuditPath key="post">
           <AuditPath key="AuthenticationService">
               <AuditPath key="authenticate">
                   <AuditPath key="args">
                       <AuditPath key="userName">
                           <RecordValue key="value" dataExtractor="simpleValue"/>
                       </AuditPath>
                   </AuditPath>
                   <AuditPath key="error">
                            <RecordValue key="value" dataExtractor="simpleValue"/>
                   </AuditPath>
               </AuditPath>
           </AuditPath>
       </AuditPath>
    </Application>

The audit code is now split up into data producers and data consumers. The config declares which data is to be consumed and persisted for later retrieval. In the RM use-case, we had to audit data produced by non-API code (RM actions) as well as do things like store the changes to node properties before and after a change to a node. The RM audit config looks like this:
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>

<!-- Default Audit Configuration -->

<Audit
    xmlns="http://www.alfresco.org/repo/audit/model/3.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
    >

    <DataExtractors>
       <DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
       <DataExtractor name="nullValue" registeredName="auditModel.extractor.nullValue"/>
       <DataExtractor name="nodeName" registeredName="auditModel.extractor.nodeName"/>
       <DataExtractor name="nodeType" registeredName="auditModel.extractor.nodeType"/>
       <DataExtractor name="userRoles" registeredName="org_alfresco_module_dod5015_userRolesExtractor"/>
       <DataExtractor name="namePath" registeredName="org_alfresco_module_dod5015_namePathExtractor"/>
       <DataExtractor name="nodeRefPath" registeredName="org_alfresco_module_dod5015_nodeRefPathExtractor"/>
       <DataExtractor name="nodeIdentifier" registeredName="org_alfresco_module_dod5015_identifierExtractor"/>
    </DataExtractors>
   
    <DataGenerators>
       <DataGenerator name="personFullName" registeredName="auditModel.generator.personFullName"/>
    </DataGenerators>

    <PathMappings>
        <PathMap source="/DOD5015" target="/DOD5015"/>
        <!-- Force the fullName generator to trigger -->
        <PathMap source="/DOD5015/event/node" target="/DOD5015/event/person"/>
        <PathMap source="/alfresco-api/post/AuthenticationService/authenticate" target="/DOD5015/login"/>
    </PathMappings>

    <Application name="DOD5015" key="DOD5015">
        <AuditPath key="event">
            <!-- Record user details -->
            <AuditPath key="person">
                <RecordValue key="roles" dataExtractor="userRoles"/>
                <GenerateValue key="fullName" dataGenerator="personFullName"/>
            </AuditPath>
            <!-- Record a description of the event -->
            <AuditPath key="name">
                <RecordValue key="value" dataExtractor="simpleValue"/>
            </AuditPath>
            <!-- Record the node's details -->
            <AuditPath key="node">
                <RecordValue key="noderef" dataExtractor="simpleValue"/>
                <RecordValue key="name" dataExtractor="nodeName"/>
                <RecordValue key="type" dataExtractor="nodeType"/>
                <RecordValue key="namePath" dataExtractor="namePath"/>
                <RecordValue key="nodeRefPath" dataExtractor="nodeRefPath"/>
                <RecordValue key="identifier" dataExtractor="nodeIdentifier"/>
                <AuditPath key="changes">
                   <AuditPath key="before">
                       <RecordValue key="value" dataExtractor="simpleValue"/>
                   </AuditPath>
                    <AuditPath key="after">
                        <RecordValue key="value" dataExtractor="simpleValue"/>
                    </AuditPath>
                </AuditPath>
            </AuditPath>
            <!--
                RM action parameters
                * Keyed by action name to be more selective
                * Only record the parameters if they are of interest
            -->
            <!-- A test action -->
            <AuditPath key="testAction">
                <AuditPath key="parameters">
                    <AuditPath key="testActionParam">
                        <RecordValue key="value" dataExtractor="simpleValue"/>
                    </AuditPath>
                </AuditPath>
            </AuditPath>
        </AuditPath>
        <AuditPath key="login">
            <AuditPath key="args">
                <AuditPath key="userName">
                    <RecordValue key="value" dataExtractor="simpleValue"/>
                </AuditPath>
            </AuditPath>
            <AuditPath key="no-error">
                <GenerateValue key="fullName" dataGenerator="personFullName"/>
            </AuditPath>
            <AuditPath key="error">
                <RecordValue key="value" dataExtractor="nullValue"/>
            </AuditPath>
        </AuditPath>
    </Application>

</Audit>


Additionally, the AuditService now has a fledgeling search API, which I intend to extend as we fill in the extension use-cases (non-DOD5015).

Regards
Derek
Derek Hulley
Senior Software Engineer, Alfresco
** If this post was helpful, please click Yes on the Post Rating **
http://wiki.alfresco.com/ - Alfresco Wiki docs
http://issues.alfresco.com/ - JIRA bug reporting site
derek
Alfresco Engineer
Alfresco Engineer
 
Posts: 925
Joined: 27 Jun 2005, 12:43
Location: Alfresco HQ

30 Points (What is this?)

Re: Enable auditing in 3.2?

Postby cedomir » 10 Nov 2009, 13:55

Hi all,
I still can't make auditing work in 3.2r. What exactly I have to do?

1. Edit ../conf/alfresco/extension/alfresco-global.properties and add
Code: Select all
audit.enabled=true
audit.useNewConfig=false


2. Edit in alfresco.war package file WEB-INF/classes/alfresco/auditConfig.xml and change:
Code: Select all
<Audit xmlns="http://www.alfresco.org/model/audit/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
enabled="false" auditInternal="false" mode="all">

to
Code: Select all
<Audit xmlns="http://www.alfresco.org/model/audit/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
enabled="true" auditInternal="false" mode="all">


Anything else? What I am missing?
Thanks in advance.

Alfresco log is:
Code: Select all
14:53:42,337 DEBUG [org.alfresco.repo.audit.model.AuditEntry] Audit configuration
14:53:42,341 DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Audit Mode = ALL
14:53:42,343 DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Enabled = TRUE
14:53:42,344 DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Audit Internal = FALSE
14:53:42,349 DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Record Options = Record Options(Filters=FALSE,Path=FALSE,Exception=FALSE,PropertiesBefore=FALSE,PropertiesAfter=FALSE,Args=FALSE,Return=FALSE)
14:53:42,352 DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Filter = null
14:53:42,353 DEBUG [org.alfresco.repo.audit.model.AuditEntry] Adding services ...
14:53:42,359 DEBUG [org.alfresco.repo.audit.model.AbstractNamedAuditEntry] Name = ServiceRegistry
14:53:42,361 DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Audit Mode = NONE
14:53:42,362 DEBUG [org.alfresco.repo.audit.model.AbstractAuditEntry] Enabled = FALSE
cedomir
Community Member
Community Member
 
Posts: 19
Joined: 29 Jan 2008, 22:26
Location: Belgrade, Serbia

0 Points (What is this?)

Re: Enable auditing in 3.2?

Postby PaulWeb » 13 Nov 2009, 02:13

cedomir, i had this problems, but when i set auditInternal="true", then all has earned.
You will not grasp her with your mind
Or cover with a common label,
For Russia is one of a kind –
Believe in her, if you are able...
(Fyodor Ivanovich Tyutchev)
PaulWeb
Community Contributor Pro
Community Contributor Pro
 
Posts: 60
Joined: 30 Jul 2009, 23:39
Alfresco Version: 3.2

2 Points (What is this?)

Re: Enable auditing in 3.2?

Postby cedomir » 13 Nov 2009, 12:16

i tried, but thats not the problem :( Thanks anyway
cedomir
Community Member
Community Member
 
Posts: 19
Joined: 29 Jan 2008, 22:26
Location: Belgrade, Serbia

0 Points (What is this?)

Re: Enable auditing in 3.2?

Postby regmi » 02 Dec 2009, 19:47

@cedomir Replace every "false" instance to "true" using find and replace in auditconfig.xml and restart Alfresco. It should work.

Valid for Alfresco 3.2r. Using Win 2003 server.
regmi
 
Posts: 1
Joined: 02 Dec 2009, 16:22
Alfresco Version: 3.2r

0 Points (What is this?)

Re: Enable auditing in 3.2?

Postby chandu7ee » 20 Jan 2010, 06:36

Hi

try this settings , http://aboutalfresco.blogspot.com/2009/12/audit-configuration-in-alfresco.html

its worked fine for me.

thanks&regards
Chandu 8)
ChandraShekar Atmakur
Systems Analyst, LinearCube.
+91 9989902757
http://www.linearcube.com
follow me on twitter:http://twitter.com/chandu7eee
Alfresco Articles:http://aboutalfresco.blogspot.com/
Image
User avatar
chandu7ee
Community Contributor
Community Contributor
 
Posts: 50
Joined: 20 Oct 2009, 12:08
Location: Hyderabad
Alfresco Version: 3.2r

0 Points (What is this?)

Re: Enable auditing in 3.2?

Postby simon.white » 26 Jan 2010, 13:58

Hello all,

I've started a new thread specifically on the new auditing mechanism initially developed for 5015 at viewtopic.php?f=9&t=24543&p=80024&hilit=auditing#p80024 as this thread seems to mostly focus on the "old", default, auditing mechanism.

Cheers,

Simon
simon.white
Community Member
Community Member
 
Posts: 10
Joined: 02 Nov 2009, 00:40
Alfresco Version: 3.2

0 Points (What is this?)


Return to Configuration

Who is online

Users browsing this forum: No registered users and 6 guests