Skip to content

File scheme off by default; reads confined to file.protocol.root - #2124

Open
abhinav-phi wants to merge 1 commit into
apache:mainfrom
abhinav-phi:issue-2081-file-protocol-root
Open

File scheme off by default; reads confined to file.protocol.root#2124
abhinav-phi wants to merge 1 commit into
apache:mainfrom
abhinav-phi:issue-2081-file-protocol-root

Conversation

@abhinav-phi

Copy link
Copy Markdown
Contributor

Fixes #2081.

crawler-default.yaml shipped protocols: "http,https,file", and FileProtocol read whatever path the worker user could read: a fetched page can put a file:// URL into the frontier (absolute file:// hrefs resolve to themselves in the parser), and the response body — including the topology configuration and the backend credentials in it — went on to be parsed and indexed. The only gate was URL filtering, and the library default ships no URL filters at all.

  • the shipped protocols list is now http,https; enabling the file scheme is a deliberate act
  • FileProtocol gains file.protocol.root: when set, only paths canonicalising below that directory are served (symlinks included), everything else returns 403
  • when no root is set, the file scheme serves nothing — reading any path requires having chosen a root on purpose

Release note needed: topologies crawling local corpora on the old default stop working until they add file to protocols and set file.protocol.root.

…che#2081)

crawler-default.yaml enabled the file scheme in every topology built on
the library defaults, and FileProtocol read whatever path the worker
user could read: a fetched page can put a file:// URL into the frontier
and the response body - including the topology configuration - went on
to be parsed and indexed.

The shipped protocols list is now http,https, and the file scheme has
to be enabled deliberately. FileProtocol gains a file.protocol.root
key: when it is set, only paths canonicalising below that directory are
served (symlinks included), everything else returns 403; when it is
not set, the file scheme serves nothing. An operator crawling a local
corpus sets both keys.
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.

The file scheme is enabled by default and FileProtocol reads any path the worker can open

1 participant