【问题标题】:Audit logs for scim requests WSO2 IDPscim 请求的审核日志 WSO2 IDP
【发布时间】:2019-09-17 06:05:24
【问题描述】:

我想记录到达 wso2/idp 服务器的 scim 请求(成功、失败)。我关注了 [https://docs.wso2.com/display/IS530/Logging+Claims+in+Audit+Logs],但 repository\logs\audit.log 仍然不包含任何额外的记录,除了当天的一行:

'admin@carbon.super [-1234]' 在[2019-09-17 10:45:23 登录......

我还在 identity.xml 中添加了以下内容,希望能够记录一些内容..

http://wso2.org/claims/username
http://wso2.org/claims/userid
http://wso2.org/claims/country
http://wso2.org/claims/fullname
http://wso2.org/claims/identity/failedLoginAttempts
http://wso2.org/claims/displayName

但是,尚未记录任何 scim 请求。我的 scim 请求都可以正常工作,除了日志记录。

curl -v -k --user admin:admin https://localhost:9443/wso2/scim/Users/48f7cfe5-f0e3-4a67-af7e-d762aa9ab215

【问题讨论】:

    标签: wso2 wso2is


    【解决方案1】:

    对于您的用例,我认为您需要记录进入 Identity Server 的用户操作。您可以通过编写用户操作事件侦听器来做到这一点,您必须扩展 org.wso2.carbon.user.core.common.AbstractUserOperationEventListener 类并覆盖添加功能所需的方法。您可以覆盖该类的所有方法,并简单地为它们添加审计日志,以识别用户和他正在执行的特定操作。审核日志打印在 SERVER_HOME/repository/logs/audit.log 文件中。

    详情请参考以下内容:

    http://www.securityinternal.com/2016/08/user-operation-event-listener-in-wso2.html http://www.securityinternal.com/2016/08/writing-user-operation-event-listener.html https://github.com/thariyarox/sample-user-operation-event-listener-print-audit-logs https://medium.com/@inthiraj1994/user-operation-event-listener-for-wso2-server-8ce4765b8c95

    【讨论】:

    • 这将是一个不错的方法,但是用户名/密码是使用 /samlsso 提交从浏览器直接提交到 wso/idp 服务器的。来自 idp 的 html 响应是一个回调表单,然后重定向到网络服务器(如果身份验证已通过)。即应用程序没有对 idp 身份验证的编程访问权限。
    【解决方案2】:
    If your requirement is to get the scim logs to audit log file add the following config to 
    
    {IS-HOME}/repository/conf/log4j.properties 
    
    log4j.logger.org.wso2.carbon.identity.scim=DEBUG
    
    edit the threshold value of Appender config to AUDIT_LOGFILE
    
    log4j.appender.AUDIT_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender
    log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log
    log4j.appender.AUDIT_LOGFILE.Append=true
    log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
    log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c}- %x %m %n
    log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
    log4j.appender.AUDIT_LOGFILE.threshold=DEBUG
    log4j.additivity.AUDIT_LOG=false
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-27
      • 1970-01-01
      • 1970-01-01
      • 2019-02-21
      • 2019-10-02
      • 2018-07-09
      • 2016-03-23
      • 2011-03-18
      相关资源
      最近更新 更多