Skip to content

Restrict http verbs - #153

Closed
kcranston wants to merge 2 commits into
masterfrom
restrict-verbs
Closed

Restrict http verbs#153
kcranston wants to merge 2 commits into
masterfrom
restrict-verbs

Conversation

@kcranston

Copy link
Copy Markdown
Member

First pass at config changes to restrict http verbs. Also changes tnrs from neo4j to otcetera. Needs review to confirm 1) correct ports for otc and 2) which methods require opening up POST.

Requires installation of mod_allowmethods module, if note already installed.

@bredelings

Copy link
Copy Markdown
Contributor

I think that all methods in otcetera do POST and OPTIONS but not GET. So tnrs, taxonomy, and conflict would also need POST permission.

@bredelings

Copy link
Copy Markdown
Contributor

Also maybe the part that redirects to ws_wrapper instead of taxomachine should be a separate commit. (Sorry if that is too nit-picky).

@bredelings
bredelings self-requested a review April 15, 2020 17:47

@bredelings bredelings left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@snacktavish

Copy link
Copy Markdown
Member

I'm going to spin up a new machine and test it!

@snacktavish

Copy link
Copy Markdown
Member
Invalid command 'AllowMethods', perhaps misspelled or defined by a module not included in the server configuration
Action 'graceful' failed.
The Apache error log may have more information.

@jimallman

Copy link
Copy Markdown
Member

Maybe you need mod_allowmethods running in apache? https://httpd.apache.org/docs/2.4/mod/mod_allowmethods.html

@jimallman

jimallman commented Apr 15, 2020

Copy link
Copy Markdown
Member

See existing a2enmod commands here, probably can add this at the end.

EDIT to fix the link, durnit.

@kcranston

Copy link
Copy Markdown
Member Author

Requires installation of mod_allowmethods module, if not already installed.

Yup - module probably not installed by default.

@snacktavish

Copy link
Copy Markdown
Member

Ah right! No points will be awarded on reading comprehension for meeee. I'll try with proper installs shortly!

@snacktavish

Copy link
Copy Markdown
Member

Deployed on ot54 - does successfully prevent top level post, but restrictions cause a bunch of other tests to fail. Continuing to dig into it, but updating here:

Estudies.tree_get.test_get_tree.v3: . Wrong status code. Expected 200. Got 403.
Efrontend.top.test_about.v3: . Wrong status code. Expected 200. Got 403.
Efrontend.top.test_references.v3: . Wrong status code. Expected 200. Got 403.
Efrontend.top.test_top.v3: . Wrong status code. Expected 200. Got 403.
Efrontend.top.test_curator.v3: . Wrong status code. Expected 200. Got 403.
Estudies.properties.test_properties.v3: . Wrong status code. Expected 200. Got 405.
Estudies.find_studies.test_find_by_curator.v3: . Wrong status code. Expected 200. Got 405.
Estudies.study_list.test_study_list.v3: . Wrong status code. Expected 200. Got 403.
Estudies.find_trees.test_find_by_ott_id.v3: . Wrong status code. Expected 200. Got 405.
Estudies.study_get.test_get_oldversion_nexml2json.v3: . Wrong status code. Expected 200. Got 403.
EEstudies.file_get.test_file.v3: . Wrong status code. Expected 200. Got 403.
studies.find_studies.test_find_all.v3: . Wrong status code. Expected 200. Got 405.
Estudies.find_studies.test_find_by_doi.v3: . Wrong status code. Expected 200. Got 405.
Estudies.study_get.test_404.v3: . Wrong status code. Expected 404. Got 403.
Estudies.study_get.test_get.v3: . Wrong status code. Expected 200. Got 403.

@mtholder

Copy link
Copy Markdown
Member

closing because we moved to ansible OpenTreeOfLife/ot-ansible#39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants