Skip to content

Module for filtering exports#80

Merged
bbockelm merged 4 commits intoPelicanPlatform:mainfrom
bbockelm:glob_filter
Mar 16, 2025
Merged

Module for filtering exports#80
bbockelm merged 4 commits intoPelicanPlatform:mainfrom
bbockelm:glob_filter

Conversation

@bbockelm
Copy link
Collaborator

@bbockelm bbockelm commented Jan 6, 2025

This PR (note: it's built on top of #79 and hence it contains those commits -- ignore them for review purposes or wait until that PR is merged) adds a new module, libXrdOssFilter, for managing what objects are exported via XRootD.

libXrdOssFilter can be stacked on top of the HTTP or S3 OSS plugin and provides reasonably fine-grained control over what data is accessible. The administrator can limit things to specific prefixes or only objects matching a certain glob (e.g., /ncar/dataset*/** or /foo/*.png). It supports the "globstar" operator, allowing multiple path hierarchies to be matched (e.g., /pelican/**/*.go will export all *.go files underneath /pelican). The integration test contains a valid XRootD configuration file demonstrating this.

Includes reasonable unit test and a simple end-to-end integration test built on top of the S3 integration test.

The new plugin, `libXrdOssFilter.so`, allows the administrator to
only permit the opening / listings of files and directories that
match specified globs or prefixes.  This can be used to keep
some storage from being visible via XRootD (even with the appropriate
permissions).

For example, to hide all files and directories beginning with "."
from being exported, one could setup:

```
ofs.osslib ++ libXrdOssFilter.so
filter.glob /**
```

(This policy would be quite difficult to implement via the existing
authorization frameworks)
The `filter.prefix` approach is meant to provide a simpler variant
of `filter.glob` (for administrators who feel they may get tripped
up).

To prevent unexpected behaviors, ensure that there are no glob
metacharacters in the provided path and that the path is normalized.
@alexandertuna
Copy link
Collaborator

Hi @bbockelm ! I'm still digesting this PR since it's built on top of stuff I don't understand yet. I'll leave a comment or two but you should proceed when you're ready.

@bbockelm
Copy link
Collaborator Author

Ok, going to take PI privilege here and move this forward. This isn't in active use yet and has unit test coverage.

@bbockelm bbockelm merged commit 4dbc503 into PelicanPlatform:main Mar 16, 2025
3 checks passed
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.

3 participants