WSO2 Identity Server 5.7.0-最低密码期限的密码策略请求

WSO2 Identity Server 5.7.0-最低密码期限的密码策略请求,wso2,wso2is,password-policy,Wso2,Wso2is,Password Policy,我详细研究了添加到最新WSO2 Identity Server(5.7.0)中的所有密码策略选项。虽然与一年前的版本相比有了很大的改进,但我的客户仍然对一个问题不满意。使用密码策略验证器,看起来我们可以强制用户每隔这么多天更改一次密码,使用现在的默认策略选项可以强制执行任意数量的密码历史记录要求。然而,历史记录选项可以被一个确定的用户所克服,只要在一个设置中简单地更改其密码(快速老化密码所需的次数)——除非有一个要求的“最小密码老化”会阻止他们这样做。历史记录、模式和密码验证器中的所有可用选项都

我详细研究了添加到最新WSO2 Identity Server(5.7.0)中的所有密码策略选项。虽然与一年前的版本相比有了很大的改进,但我的客户仍然对一个问题不满意。使用密码策略验证器,看起来我们可以强制用户每隔这么多天更改一次密码,使用现在的默认策略选项可以强制执行任意数量的密码历史记录要求。然而,历史记录选项可以被一个确定的用户所克服,只要在一个设置中简单地更改其密码(快速老化密码所需的次数)——除非有一个要求的“最小密码老化”会阻止他们这样做。历史记录、模式和密码验证器中的所有可用选项都不能解决此问题。此来自Windows 10安全威胁保护的引用解决了此问题的有效性:


有没有一种方法可以让我设定WSO2现在的最低年龄?如果没有,是否应将其作为密码策略包含在历史记录选项中?

此功能目前在WSO2 is产品中不可用,但我们可以使用核心用户管理系统中提供的扩展轻松满足此要求。 可用功能具有更改的密码日期时间的历史记录,我们可以使用这些数据强制执行此要求

  • 创建一个新的标识连接器,以配置最小密码期限和抽象事件处理程序,以便在密码更改事件期间强制执行验证

    公共类PasswordMinAgeValidationHandler扩展AbstractEventHandler实现IdentityConnectorConfig{

    private static final Log log = LogFactory.getLog(PasswordMinAgeValidationHandler.class);
    
    @Override
    public void handleEvent(Event event) throws IdentityEventException {
    
        // Validate the password age with min age configured
    }
    
    @Override
    public String getName() {
        return "passwordMinAge";
    }
    
    @Override
    public String getFriendlyName() {
        return "Password Minimum Age";
    }
    
    @Override
    public String getCategory() {
        return "Password Policies";
    }
    
    @Override
    public Map<String, String> getPropertyNameMapping() {
        Map<String, String> nameMapping = new HashMap<>();
        nameMapping.put(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE, "Enable Password Minimum Age Feature");
        nameMapping.put(PasswordMinAgeConstants.PW_MIN_AGE_COUNT, "Password Minimum Age (Days)");
        return nameMapping;
    }
    
    @Override
    public void init(InitConfig configuration) throws IdentityRuntimeException {
        super.init(configuration);
        IdentityPasswordMinAgeServiceDataHolder.getInstance().getBundleContext().registerService
                (IdentityConnectorConfig.class.getName(), this, null);
    }
    
    public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityGovernanceException {
    
        Map<String, String> defaultProperties = new HashMap<>();
        defaultProperties.put(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE, configs.getModuleProperties()
                .getProperty(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE));
        defaultProperties.put(PasswordMinAgeConstants.PW_MIN_AGE_COUNT, configs.getModuleProperties()
                .getProperty(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE));
        Properties properties = new Properties();
        properties.putAll(defaultProperties);
        return properties;
    }
    
    }

  • 在IS_HOME/repository/components/dropins中部署jar
  • 在IS_HOME/repository/conf/identity/identity-event.properties中添加以下配置

    module.name.13=passwordMinAge
    passwordMinAge.subscription.1=预更新\u凭证
    passwordMinAge.subscription.2=由管理员预先更新凭据
    passwordMinAge.enable=false
    passwordMinAge.count=5

  • 重新启动IS服务器

  • 在常驻身份提供程序配置->密码策略中,启用
    密码历史记录
    密码最低年龄
    功能


您可以找到完整的源代码

此功能目前在WSO2 is产品中不可用,但我们可以使用核心用户管理系统中提供的扩展轻松满足此要求。 可用功能具有更改的密码日期时间的历史记录,我们可以使用这些数据强制执行此要求

  • 创建一个新的标识连接器,以配置最小密码期限和抽象事件处理程序,以便在密码更改事件期间强制执行验证

    公共类PasswordMinAgeValidationHandler扩展AbstractEventHandler实现IdentityConnectorConfig{

    private static final Log log = LogFactory.getLog(PasswordMinAgeValidationHandler.class);
    
    @Override
    public void handleEvent(Event event) throws IdentityEventException {
    
        // Validate the password age with min age configured
    }
    
    @Override
    public String getName() {
        return "passwordMinAge";
    }
    
    @Override
    public String getFriendlyName() {
        return "Password Minimum Age";
    }
    
    @Override
    public String getCategory() {
        return "Password Policies";
    }
    
    @Override
    public Map<String, String> getPropertyNameMapping() {
        Map<String, String> nameMapping = new HashMap<>();
        nameMapping.put(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE, "Enable Password Minimum Age Feature");
        nameMapping.put(PasswordMinAgeConstants.PW_MIN_AGE_COUNT, "Password Minimum Age (Days)");
        return nameMapping;
    }
    
    @Override
    public void init(InitConfig configuration) throws IdentityRuntimeException {
        super.init(configuration);
        IdentityPasswordMinAgeServiceDataHolder.getInstance().getBundleContext().registerService
                (IdentityConnectorConfig.class.getName(), this, null);
    }
    
    public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityGovernanceException {
    
        Map<String, String> defaultProperties = new HashMap<>();
        defaultProperties.put(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE, configs.getModuleProperties()
                .getProperty(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE));
        defaultProperties.put(PasswordMinAgeConstants.PW_MIN_AGE_COUNT, configs.getModuleProperties()
                .getProperty(PasswordMinAgeConstants.PM_MIN_AGE_ENABLE));
        Properties properties = new Properties();
        properties.putAll(defaultProperties);
        return properties;
    }
    
    }

  • 在IS_HOME/repository/components/dropins中部署jar
  • 在IS_HOME/repository/conf/identity/identity-event.properties中添加以下配置

    module.name.13=passwordMinAge
    passwordMinAge.subscription.1=预更新\u凭证
    passwordMinAge.subscription.2=由管理员预先更新凭据
    passwordMinAge.enable=false
    passwordMinAge.count=5

  • 重新启动IS服务器

  • 在常驻身份提供程序配置->密码策略中,启用
    密码历史记录
    密码最低年龄
    功能

您可以找到完整的源代码