Re: CUSTOM events in Audit

2023-12-12 Thread Lionel SCHWARZ
- Le 12 Déc 23, à 17:25, Francesco Chicchiriccò  a 
écrit : 

> On 27/11/23 16:01, Lionel SCHWARZ wrote:

>> - Le 27 Nov 23, à 14:43, Lorenzo Di Cola [ mailto:loredic...@apache.org |
>>  ] a écrit :

>>> Hi Linonel,
>>> yes, using PostgreSQL JSONB means you're storing audit on db, as you said 
>>> about
>>> "auditentry" table.
>>> You can take care about AnySearchDAO bean, you should use the one of type
>>> PGJPAJSONAnySearchDAO in order to use PostgreSQL feature.

>> Sorry Lorenzo, I don't get your point at all, I have no idea what to do with
>> this PGJPAJSONAnySearchDAO bean...

>> As I explained in my first message, basically what I did is:
>> 1. activated audit for "syncope.audit.[CUSTOM]:[]:[]:[MY_EVENT]:[SUCCESS]"
>> 2. triggered the event "MY_EVENT" somewhere in my code
>> 3. got empty list when requesting "/syncope/rest/audit/entries?type=CUSTOM"

>> So my question is: is it normal that audit for CUSTOM events are not stored ?
>> (audit is fine for non-custom event type)

> We have added a dedicated integration test case to check this condition:

> [
> https://github.com/apache/syncope/blob/3_0_X/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuditITCase.java#L667
> |
> https://github.com/apache/syncope/blob/3_0_X/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuditITCase.java#L667
> ]

> You might also want to have a look at the class that is actually triggering a
> custom audit event, for reference:

> [
> https://github.com/apache/syncope/blob/3_0_X/fit/core-reference/src/test/resources/CustomAuditLogicActions.groovy
> |
> https://github.com/apache/syncope/blob/3_0_X/fit/core-reference/src/test/resources/CustomAuditLogicActions.groovy
> ]
Hi Francesco, 
That's exactly what I did afterward: trigger the audit event with the Audit 
Manager, and this works fine. 
Actually In the first place, I thought that triggering a Notification would 
trigger automatically an audit event... 
Thanks anyway 
Lionel 


smime.p7s
Description: S/MIME Cryptographic Signature


Re: CUSTOM events in Audit

2023-12-12 Thread Francesco Chicchiriccò

On 27/11/23 16:01, Lionel SCHWARZ wrote:

- Le 27 Nov 23, à 14:43, Lorenzo Di Cola  a écrit :

Hi Linonel,
yes, using PostgreSQL JSONB means you're storing audit on db, as you said about 
"auditentry" table.
You can take care about AnySearchDAO bean, you should use the one of type 
PGJPAJSONAnySearchDAO in order to use PostgreSQL feature.

Sorry Lorenzo, I don't get your point at all, I have no idea what to do with 
this PGJPAJSONAnySearchDAO bean...

As I explained in my first message, basically what I did is:
1. activated audit for "syncope.audit.[CUSTOM]:[]:[]:[MY_EVENT]:[SUCCESS]"
2. triggered the event "MY_EVENT" somewhere in my code
3. got empty list when requesting  "/syncope/rest/audit/entries?type=CUSTOM"

So my question is: is it normal that audit for CUSTOM events are not stored ? 
(audit is fine for non-custom event type)

We have added a dedicated integration test case to check this condition:

https://github.com/apache/syncope/blob/3_0_X/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuditITCase.java#L667

You might also want to have a look at the class that is actually triggering a 
custom audit event, for reference:

https://github.com/apache/syncope/blob/3_0_X/fit/core-reference/src/test/resources/CustomAuditLogicActions.groovy

HTH
Regards.

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/


Re: CUSTOM events in Audit

2023-11-27 Thread Lionel SCHWARZ
- Le 27 Nov 23, à 14:43, Lorenzo Di Cola  a écrit : 

> Hi Linonel,
> yes, using PostgreSQL JSONB means you're storing audit on db, as you said 
> about
> "auditentry" table.
> You can take care about AnySearchDAO bean, you should use the one of type
> PGJPAJSONAnySearchDAO in order to use PostgreSQL feature.

Sorry Lorenzo, I don't get your point at all, I have no idea what to do with 
this PGJPAJSONAnySearchDAO bean... 

As I explained in my first message, basically what I did is: 
1. activated audit for "syncope.audit.[CUSTOM]:[]:[]:[MY_EVENT]:[SUCCESS]" 
2. triggered the event "MY_EVENT" somewhere in my code 
3. got empty list when requesting "/syncope/rest/audit/entries?type=CUSTOM" 

So my question is: is it normal that audit for CUSTOM events are not stored ? 
(audit is fine for non-custom event type) 

Regards 
Lionel 


smime.p7s
Description: S/MIME Cryptographic Signature


Re: CUSTOM events in Audit

2023-11-27 Thread Lorenzo Di Cola
Hi Linonel,
yes, using PostgreSQL JSONB means you're storing audit on db, as you said
about "auditentry" table.
You can take care about AnySearchDAO bean, you should use the one of type
PGJPAJSONAnySearchDAO in order to use PostgreSQL feature.

HTH
Lorenzo

Il giorno lun 27 nov 2023 alle ore 09:25 Lionel SCHWARZ <
lionel.schw...@in2p3.fr> ha scritto:

> Hi Lorenzo,
> From your answer below, should I understand that, using PostgreSQL on
> Syncope3, audit events *should* be logged in the database? If yes, then
> could you please point me to any possible misconfiguration?
> Regards
> Lionel
>
> - Le 23 Nov 23, à 9:39, Lionel SCHWARZ  a
> écrit :
>
> Hi Lorenzo,
> Indeed I use latest Syncope 3. The DB is stored on PostgreSQL. Looking
> into the table auditentry, I could not find any items related to my custom
> event.
> Did I forget to setup something?
>
> Regards
> Lionel
>
> - Le 21 Nov 23, à 17:50, Lorenzo Di Cola  a
> écrit :
>
> Hi Lionel,
> please take care about where you're storing audit events, take care if
> you're using PostgreSQL, Elasticsearch or other data-storage.
> If you're using Elasticsearch you need to specify the right bean
> definition in order to write and read audit events.
> Of course I'm assuming you're on Syncope 3 version.
>
> HTH,
> Best regards,
>
>
>

-- 

-- 
Lorenzo Di Cola

Software Engineer @ Tirasa S.r.l.
Viale Vittoria Colonna, 97 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973http://www.tirasa.net

Apache Syncope Committer

Syncope PMC Member at The Apache Software Foundation

http://people.apache.org/phonebook.html?uid=loredicola


Re: CUSTOM events in Audit

2023-11-27 Thread Lionel SCHWARZ
Hi Lorenzo, 
>From your answer below, should I understand that, using PostgreSQL on 
>Syncope3, audit events should be logged in the database? If yes, then could 
>you please point me to any possible misconfiguration? 
Regards 
Lionel 

- Le 23 Nov 23, à 9:39, Lionel SCHWARZ  a écrit : 

> Hi Lorenzo,
> Indeed I use latest Syncope 3. The DB is stored on PostgreSQL. Looking into 
> the
> table auditentry, I could not find any items related to my custom event.
> Did I forget to setup something?

> Regards
> Lionel

> - Le 21 Nov 23, à 17:50, Lorenzo Di Cola  a écrit :

>> Hi Lionel,
>> please take care about where you're storing audit events, take care if you're
>> using PostgreSQL, Elasticsearch or other data-storage.
>> If you're using Elasticsearch you need to specify the right bean definition 
>> in
>> order to write and read audit events.
>> Of course I'm assuming you're on Syncope 3 version.

>> HTH,
>> Best regards,


smime.p7s
Description: S/MIME Cryptographic Signature


Re: CUSTOM events in Audit

2023-11-23 Thread Lionel SCHWARZ
Hi Lorenzo, 
Indeed I use latest Syncope 3. The DB is stored on PostgreSQL. Looking into the 
table auditentry, I could not find any items related to my custom event. 
Did I forget to setup something? 

Regards 
Lionel 

- Le 21 Nov 23, à 17:50, Lorenzo Di Cola  a écrit : 

> Hi Lionel,
> please take care about where you're storing audit events, take care if you're
> using PostgreSQL, Elasticsearch or other data-storage.
> If you're using Elasticsearch you need to specify the right bean definition in
> order to write and read audit events.
> Of course I'm assuming you're on Syncope 3 version.

> HTH,
> Best regards,


smime.p7s
Description: S/MIME Cryptographic Signature


Re: CUSTOM events in Audit

2023-11-21 Thread Lorenzo Di Cola
Hi Lionel,
please take care about where you're storing audit events, take care if
you're using PostgreSQL, Elasticsearch or other data-storage.
If you're using Elasticsearch you need to specify the right bean definition
in order to write and read audit events.
Of course I'm assuming you're on Syncope 3 version.

HTH,
Best regards,

Il giorno mar 21 nov 2023 alle ore 14:50 Lionel SCHWARZ <
lionel.schw...@in2p3.fr> ha scritto:

> Hi all,
>
> I my custom code (in a flowable task) I trigger an event
> (notificationManager.createTasks()) declared as
> "[CUSTOM]:[]:[]:[rejectCreateAttach]:[SUCCESS]" and defined a mail
> notification on it. The notification works fine.
>
> As I want to audit this event I have enabled this event in the audit:
>
> {
>   "key": "syncope.audit.[CUSTOM]:[]:[]:[rejectCreateAttach]:[SUCCESS]",
>   "active": true
> }
>
> But I cannot find any entries in audit:
>
> GET '/audit/entries?type=CUSTOM'
> {
>   "prev": null,
>   "next": null,
>   "result": [],
>   "page": 1,
>   "size": 0,
>   "totalCount": 0
> }
>
> Am I missing something?
>
> Cheers
> Lionel



-- 

-- 
Lorenzo Di Cola

Software Engineer @ Tirasa S.r.l.
Viale Vittoria Colonna, 97 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973http://www.tirasa.net

Apache Syncope Committer

Syncope PMC Member at The Apache Software Foundation

http://people.apache.org/phonebook.html?uid=loredicola


CUSTOM events in Audit

2023-11-21 Thread Lionel SCHWARZ
Hi all,

I my custom code (in a flowable task) I trigger an event 
(notificationManager.createTasks()) declared as 
"[CUSTOM]:[]:[]:[rejectCreateAttach]:[SUCCESS]" and defined a mail notification 
on it. The notification works fine.

As I want to audit this event I have enabled this event in the audit:

{
  "key": "syncope.audit.[CUSTOM]:[]:[]:[rejectCreateAttach]:[SUCCESS]",
  "active": true
}

But I cannot find any entries in audit:

GET '/audit/entries?type=CUSTOM'
{
  "prev": null,
  "next": null,
  "result": [],
  "page": 1,
  "size": 0,
  "totalCount": 0
}

Am I missing something?

Cheers
Lionel

smime.p7s
Description: S/MIME Cryptographic Signature