cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with audit 3.4

andersonm
Champ in-the-making
Champ in-the-making
Hi all,

Excuse me for my English.

I'm trying to use the new auditing 3.4. I want to persist the audit always that an user consult a document.
I'm able to do this, but not all consultations, only the first consult in each document. E.g., an user creates a document and download it, then it is audited, but if either the same or another user download the same document again, it isn't audited.

So far, I did this:

1  Enabled the audit in the alfresco-global.properties:

# Enable audit in general
audit.enabled=true

# Enable the alfresco-access audit application
audit.alfresco-access.enabled=true

# Enable the auditing of sub-actions. Normally disabled as these values are
# not normally needed by audit configurations, but may be useful to
# developers
audit.alfresco-access.sub-actions.enabled=true

2 Created a file alfresco-audit-document.xml, placed it in <TOMCAT_HOME>/shared/classes/alfresco/extension/audit, and populated it with the follow code:

<?xml version='1.0' encoding='UTF-8'?>

    <!– Node Functions –>

    <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="nodeName" registeredName="auditModel.extractor.nodeName"/>
      <DataExtractor name="nodeType" registeredName="auditModel.extractor.nodeType"/>
        </DataExtractors>

        <DataGenerators>
           <DataGenerator name="personFullName" registeredName="auditModel.generator.personFullName"/>
           <DataGenerator name="currentUser" registeredName="auditModel.generator.user"/>
           <DataGenerator name="systemTime" registeredName="auditModel.generator.time"/>
        </DataGenerators>

        <PathMappings>
            <PathMap source="/alfresco-api/post/ContentService/getReader" target="/document/read"/>
        </PathMappings>

        <Application name="AuditDocument" key="document">          
            <AuditPath key="read">
                <AuditPath key="no-error">
                    <RecordValue key="document" dataExtractor="nodeName" dataSource="/document/read/args/nodeRef"/>
                    <GenerateValue key="user" dataGenerator="personFullName"/>
                </AuditPath>
                <AuditPath key="error">
                    <RecordValue key="document" dataExtractor="nodeName" dataSource="/document/read/args/nodeRef"/>
                    <GenerateValue key="user" dataGenerator="personFullName"/>
                </AuditPath>
            </AuditPath>
        </Application>
</Audit>


With this, I use the command "curl -u admin:admin "http://localhost:8080/alfresco/service/api/audit/query/AuditDocument?verbose=true"" and get a result like this:

{
         "id":2605,
         "application":AuditDocument,
         "user":admin,
         "time":"2011-08-24T12:18:58.284-03:00",
         "values":
         {
                     "\/document\/read\/no-error\/document":"111001-ADD-001-A00.js"
                     ,"\/document\/read\/no-error\/user":"Administrator"
         }
        
      },

It's ok, but have the problem described above.

I'm using alfresco commmunity 3.4.

Hope I could be clear.

Best regards.
3 REPLIES 3

jneeve
Champ in-the-making
Champ in-the-making
I have the same problem and am waiting to hear back from support if this is a bug, or some sort of desired behaviour (?!)

In the old audit config (>= 3.3) sometimes multiple reads done quickly by the same user would trigger only one audit, but if multiple users read the content there would always an audit read per user.

andersonm
Champ in-the-making
Champ in-the-making
jneeve

Thanks for your reply.

Any news plz post here.

jneeve
Champ in-the-making
Champ in-the-making
Looks like its a problem with browser caching…. Try re-doing your test with diferent browswers.

I've retested using IE and Chrome, and you will get a unique audit the first time. But depending on your browser cache settings, the second download attempt won't actualy trigger a read again since the file comes from the cache…

Personally, I think each request to read should be audited regardless, but thats the way it works.