-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StaticMapExclusionFilterFactory and StaticListExclusionFilterFactory will not work via AccessControlSettingOperation.factory #259
Comments
Do we happen to know if the example in the docs still works? I.e., do we know this is specific to StaticMapExclusionFilterFactory? |
Are you referring to the following example in the ComplexAccessPoint.xml? I have not tested it. That is a database driven functionality, no? That was my assumption, which is why I didn't test, as we don't have the database back-end. If not, I could test it out, but am not sure what else would need to be configured for the Oracle features to work. Also, we do know that this is not specific to StaticMapExclusionFilterFactory, as it is also an issue with StaticListExclusionFilterFactory, at least that's what my testing suggested. |
I was. I haven't gotten into it very far, but I suspect the problem is most likely to be in |
Awesome, thanks. I will give IPMatchesBooleanOperator another look as well. |
I should note, the IPMatchedBooleanOperator itself works for me when applied to the authentication property without the exclusion list/bean. For example, IP exclusion with the following access point property works as expected: <property name="authentication">
<bean class="org.archive.wayback.authenticationcontrol.IPMatchesBooleanOperator">
<property name="allowedRanges">
<list>
<value>(IP RANGE)</value>
</list>
</property>
</bean>
</property> This will request anyone from outside of (IP RANGE) to authenticate to access the AccessPoint. However, the following does not work to achieve the opposite effect (require anyone on IP RANGE to authenticate and allow anyone outside of IP RANGE to access freely): <property name="authentication">
<bean class="org.archive.wayback.authenticationcontrol.AccessControlSettingOperation">
<property name="operator">
<bean class="org.archive.wayback.util.operator.NotBooleanOperator">
<property name="operand">
<bean class="org.archive.wayback.authenticationcontrol.IPMatchesBooleanOperator">
<property name="allowedRanges">
<list>
<value>(IP RANGE)</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</property> When I use the above, I am still able to access the AccessPoint from within IP RANGE. When I am outside of that range, however, I no longer get a request to authenticate, but rather get a blank screen. EDIT: the reverse IP list exclusion does work, just not as written above (which you'd probably expect, the AccessControlSettingOperation was not needed): <property name="authentication">
<bean class="org.archive.wayback.util.operator.NotBooleanOperator">
<property name="operand">
<bean class="org.archive.wayback.authenticationcontrol.IPMatchesBooleanOperator">
<property name="allowedRanges">
<list>
<value>(IP RANGE)</value>
</list>
</property>
</bean>
</property>
</bean>
</property> |
|
Let me make sure I understand the use case:
Is that correct? |
Yup, that's it exactly. I was coming to the same conclusions as you re: AccessControlSettingOperation. As far as I can tell:
Thus, I am not sure why this wouldn't kick in and limit my access when I'm off the IP RANGE. Maybe I'm misinterpreting it. |
So, what we don't have is a proven case of ACSO + filter factory working (with any filter factory). Here's my current theory: I have unit tests that show that the ACSO + factory setup should work, in isolation, but it's not working in the real world. So maybe tthere's something different between the code path when you set the But it's going to take some digging into
|
@dmolesUC3, that seems like a reasonable enough theory, and AccessPoint seems like a logical place to check next, particularly because:
I will continue to poke around. |
As is, I am proposing a fix that just has |
Makes sense to me. Thanks for looking into this, Lauren. |
Ouch, clearly my oversight. Now I fully understand the use case of (if both |
test will succeed when iipc#287 is merged.
OK, I tried and found it takes too much effort to clean it up. I just added a test case to detect this issue. Toward 3.0, I'd propose redesigning Until then, exclusion filter set up through |
I agree that AccessControlSettingOperation should not remain as it is and redesigning it using |
This is our ticket, I don't think we have any objections, Lauren, do we (LC) need to write up the issue for the redesign? |
I opened issue #290. It should be put on the 3.0.0 Major Release milestone. |
Yes, thanks, @ldko, for looking at this! |
ComplexAccessPoint.xml lists an example of how to apply an exclusion access control to requests made from outside a specified IP range: https://github.com/iipc/openwayback/blob/master/wayback-webapp/src/main/webapp/WEB-INF/ComplexAccessPoint.xml#L65-88
Historically, we have used something very similar at the Library of Congress, but instead of using OracleExclusionFilterFactory, we use StaticMapExclusionFilterFactory, and follow the exact format outlined in the example that I linked above. So, our code might look like:
This works for us in Wayback 1.6 and 1.8. However, on the Openwayback 2.1.0 instance that we just installed, this same logic does not work. Using the StaticMapExclusionFilterFactory as the exclusionFactory property of the AccessPoint itself works, something like:
Likewise, using the StaticListExclusionFilterFactory as the AccessPoint's exclusionFactory property works. Tomcat is able to restart without errors when using StaticMapExclusionFilterFactory / StaticListExclusionFilterFactory with AccessControllSetting.factory, but the application does not exclude URLs provided in the defined exclude.txt file.
I've reviewed some of the recent-ish commits to the code involved in this process, and nothing is jumping out to me as an immediate red flag. After that, and doing loads of testing to no avail, I'm left scratching my head on this one. I could definitely be overlooking something more obvious to the folks familiar with this code base, so if that is the case, please let me know.
I am not seeing any helpful information in my Tomcat logs, but if I can provide any further environmental/testing info to assist in the investigation of this issue, just let me know.
Thanks in advance for the assistance.
Phil / pard@loc.gov
EDIT: I believe Gina brought up this same issue in 2014 in the following google group exhange: https://groups.google.com/forum/#!topic/openwayback-dev/2nANsg14QJE
The text was updated successfully, but these errors were encountered: