IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Sécurité Java Discussion :

JGuard et configuration log4j


Sujet :

Sécurité Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Juillet 2007
    Messages
    24
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 24
    Par défaut JGuard et configuration log4j
    Bonjour à tous,

    J'utilise JGuard pour sécuriser l'accès à une application struts/JBoss.
    Je me suis basé sur l'exemple fourni par JGuard.
    Mon application gère 3 profils utilisateurs, JGuard restreint l'accès à certaines ressources en fonction du profil.

    En pratique, les droits sont bien appliqués, mais j'observe des messages dans les logs de JBoss :

    Lors du demarrage de JBoss :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    2007-11-23 09:19:28,958 ERROR [STDERR] Nov 23, 2007 9:19:28 AM net.sf.jguard.ext.authentication.manager.AuthenticationManagerFactory createAuthenticationManager
    INFO: authenticationManagerImpl=net.sf.jguard.ext.authentication.manager.XmlAuthenticationManager
    2007-11-23 09:19:29,185 ERROR [STDERR] Nov 23, 2007 9:19:29 AM net.sf.jguard.core.authorization.permissions.PermissionUtils createCaches
    INFO: Creating caches for permissions evaluations
    2007-11-23 09:19:29,347 ERROR [STDERR] Nov 23, 2007 9:19:29 AM net.sf.jguard.core.authorization.policy.AbstractMultipleAppPolicy <init>
    et à chaque action de l'utilisateur des messages du genre :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    2007-11-23 09:22:14,466 ERROR [STDERR] Nov 23, 2007 9:22:14 AM net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [  firstname=firstname_test3  lastname=lastname_test3 ] :  subject has got the permission name=permissionFromUser actions=/adminAgency.do,ANY,GETpermission build from the user request implies  authorize phase
    ma configuration Log4j est la suivante (extrait) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
      <appender name="stderr" class="org.apache.log4j.ConsoleAppender">
      	<param name="Target" value="System.err"/>
      	<layout class="org.apache.log4j.PatternLayout">
        	<param name="ConversionPattern" value="%m%n"/> 
        </layout> 
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
    		<param name="levelMin" value="WARN"/>
    		<param name="levelMax" value="FATAL"/>
    	</filter>	   
      </appender>
     
      <logger name="net.sf.jguard" additivity="false">    
        <level value="WARN"/>    
        <appender-ref ref="stderr" />	
      </logger>
    Je ne comprend pas vraiment à quoi correspondent des messages d'erreur JGuard..., ni comment les supprimer.
    Les droits semblent pourtant bien appliqués dans mon application..
    Qu'aurais-je pu oublier ou mal faire ?

    Merci.

  2. #2
    Membre éprouvé
    Profil pro
    Inscrit en
    Février 2003
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 136
    Par défaut
    bonjour,
    pourriez-vous mettre le niveau du logger net.sf.jguard à DEBUG pour avoir plus d'informations concernant votre problème et publier les logs résultants?

    merci,

    Charles.

  3. #3
    Membre averti
    Inscrit en
    Juillet 2007
    Messages
    24
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 24
    Par défaut
    Citation Envoyé par diabolo512 Voir le message
    bonjour,
    pourriez-vous mettre le niveau du logger net.sf.jguard à DEBUG pour avoir plus d'informations concernant votre problème et publier les logs résultants?

    merci,

    Charles.
    Bonjour Charles,

    Je n'ai pas accès ce matin à la plateforme de tests (linux) , mais en local (XP/Tomcat) j'ai le même comportement.
    Voici donc mes traces (L'erreur SNMP est normale sur mon poste local) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    26 nov. 2007 10:31:05 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\outils\Java\jdk1.5.0_12\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\outils\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ESTsoft\ALZip\;C:\outils\JOB-4.3.1-bin\bin;C:\outils\Java\jdk1.5.0_12\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\Fichiers communs\GTK\2.0\bin;C:\outils\maven-2.0.6\bin;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Program Files\MKVtoolnix
    26 nov. 2007 10:31:05 org.apache.coyote.http11.Http11BaseProtocol init
    INFO: Initialisation de Coyote HTTP/1.1 sur http-8080
    26 nov. 2007 10:31:05 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 625 ms
    26 nov. 2007 10:31:05 org.apache.catalina.core.StandardService start
    INFO: Démarrage du service Catalina
    26 nov. 2007 10:31:05 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
    26 nov. 2007 10:31:05 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    #####  initializing ContextListener ... #####
    webappHomePath=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\picasso\
    webappHomePath=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\picasso\WEB-INF\jguard\jGuardAuthentication.xml
     authentication scope = local
     authentication scope = local
    26 nov. 2007 10:31:07 net.sf.jguard.ext.authentication.manager.AuthenticationManagerFactory createAuthenticationManager
    INFO: authenticationManagerImpl=net.sf.jguard.ext.authentication.manager.XmlAuthenticationManager
    webappHomePath=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\picasso\WEB-INF\jguard\jGuardAuthorization.xml
     authorization scope = local
    26 nov. 2007 10:31:07 net.sf.jguard.core.authorization.permissions.PermissionUtils createCaches
    INFO: Creating caches for permissions evaluations
    26 nov. 2007 10:31:07 net.sf.jguard.core.authorization.policy.AbstractMultipleAppPolicy <init>
    INFO: #######   loading jGuardPolicy 1.0.2 ###########
    #####  ContextListener initialized  #####
    server info = Apache Tomcat/5.5.17
    servletContextName=picasso
    webappHomePath=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\picasso\
    servlet Real Path=file://////D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/picasso/
    current Policy=sun.security.provider.PolicyFile@1c30993
    webappHomePath=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\picasso\WEB-INF\jguard\jGuardFilter.xml
    2007-11-26 10:31:08;;"";"";;"Debut supervision HTTP"
    2007-11-26 10:31:08;;"";"";;"Debut supervision HTTP"
    2007-11-26 10:31:09;;"";"";;"Erreur supervision SNMP"
    2007-11-26 10:31:09;;"";"";;"Erreur supervision SNMP"
    2007-11-26 10:31:09;;"";"";;"Fin supervision HTTP"
    2007-11-26 10:31:09;;"";"";;"Fin supervision HTTP"
    26 nov. 2007 10:31:09 org.apache.coyote.http11.Http11BaseProtocol start
    INFO: Démarrage de Coyote HTTP/1.1 sur http-8080
    26 nov. 2007 10:31:09 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    26 nov. 2007 10:31:09 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/47  config=null
    26 nov. 2007 10:31:09 org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    26 nov. 2007 10:31:10 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4141 ms
    <jguard:authorized> tag uri=administrator,manager,consultation
    <jguard:authorized> tag operator=NONE
    authSchemeItem=FORM
     loginModule class net.sf.jguard.ext.authentication.loginmodules.XmlLoginModule in 'login' phase succeed 
     loginModule class net.sf.jguard.ext.authentication.loginmodules.XmlLoginModule in 'commit' phase succeeed
    uriWithQuery=/LoginForm.do
    uriWithQuery=/LoginForm.do
    26 nov. 2007 10:31:14 net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [ ] : uri(/LoginForm.do) is equals to logonURI(/LoginForm.do)  implies  logon phase 
    uriWithQuery=/LogonProcess.do
    uriWithQuery=/LogonProcess.do
    26 nov. 2007 10:31:25 net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [ ] :  uri(/LogonProcess.do)=logonProcessURI(/LogonProcess.do) implies  logonProcess phase 
    26 nov. 2007 10:31:25 net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [ ] :  AUTHENTICATION TYPE =FORM implies   authenticate phase  
    authSchemeItem=FORM
     loginModule class net.sf.jguard.ext.authentication.loginmodules.XmlLoginModule in 'login' phase succeed 
     loginModule class net.sf.jguard.ext.authentication.loginmodules.XmlLoginModule in 'commit' phase succeeed
     user is authenticated and redirected to ./Authenticated.do
    26 nov. 2007 10:31:25 net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [  firstname=firstname_test3  lastname=lastname_test3 ] :  user is authenticated  implies  redirect to /Authenticated.do
    uriWithQuery=/Authenticated.do
    uriWithQuery=/Authenticated.do
    26 nov. 2007 10:31:25 net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [  firstname=firstname_test3  lastname=lastname_test3 ] :  subject has got the permission name=permissionFromUser actions=/Authenticated.do,ANY,GETpermission build from the user request implies  authorize phase 
    doFilter() -  access authorized to /picasso/Authenticated.do
    2007-11-26 10:31:29;;"admin";"127.0.0.1";;"Connexion de l'utilisateur 'admin' avec le profil 'administrator'."
    2007-11-26 10:31:29;;"admin";"127.0.0.1";;"Connexion de l'utilisateur 'admin' avec le profil 'administrator'."
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    uriWithQuery=/searchUnavailablesAgencies.do
    uriWithQuery=/searchUnavailablesAgencies.do
    26 nov. 2007 10:31:37 net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [  firstname=firstname_test3  lastname=lastname_test3 ] :  subject has got the permission name=permissionFromUser actions=/searchUnavailablesAgencies.do,ANY,GETpermission build from the user request implies  authorize phase 
    doFilter() -  access authorized to /picasso/searchUnavailablesAgencies.do
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=NONE
    <jguard:authorized> tag uri=consultation
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator,manager
    <jguard:authorized> tag operator=ANY
    <jguard:authorized> tag uri=administrator,manager
    <jguard:authorized> tag operator=ANY

    Ce que je n'arrive pas a faire c'est empecher l'affichage d'un message du genre suivant à chaque click de l'utilisateur, et ce quelque soit le level spécifié dans le log4j.xml

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    26 nov. 2007 10:31:37 net.sf.jguard.ext.audit.AuditManager addEvent
    INFO:  user= [  firstname=firstname_test3  lastname=lastname_test3 ] :  subject has got the permission name=permissionFromUser actions=/searchUnavailablesAgencies.do,ANY,GETpermission build from the user request implies  authorize phase

Discussions similaires

  1. [Log4j][Débutant] Configuration log4j, CLASSPATH ?
    Par norkius dans le forum Logging
    Réponses: 0
    Dernier message: 30/12/2010, 10h38
  2. problème configuration log4j
    Par MattA184575 dans le forum Logging
    Réponses: 4
    Dernier message: 07/10/2010, 15h15
  3. Réponses: 5
    Dernier message: 30/08/2010, 11h28
  4. [Integration] Configurer log4j avec des informations du contexte Spring
    Par w3blogfr dans le forum Spring
    Réponses: 0
    Dernier message: 27/01/2010, 16h15
  5. [Log4j] Configurer Log4j avec un fichier xml
    Par supermanu dans le forum Logging
    Réponses: 10
    Dernier message: 16/07/2007, 11h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo