Skip to content

Commit 61b413d

Browse files
committed
[irods/irods 7957] Pluggable Rule Engine: Add Metadata Guard
1 parent b51328c commit 61b413d

File tree

1 file changed

+74
-1
lines changed

1 file changed

+74
-1
lines changed

docs/plugins/pluggable_rule_engine.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The iRODS Consortium currently supports the following rule engine plugins:
1111
- [C++ Default Policy Rule Engine Plugin](https://github.com/irods/irods/blob/main/plugins/rule_engines/src/cpp_default_policy.cpp)
1212
- [C++ Audit (AMQP) Rule Engine Plugin](https://github.com/irods/irods_rule_engine_plugin_audit_amqp)
1313
- [C++ Logical Quotas Rule Engine Plugin](https://github.com/irods/irods_rule_engine_plugin_logical_quotas)
14-
- [C++ Metadata Guard Rule Engine Plugin](https://github.com/irods/irods_rule_engine_plugin_metadata_guard)
14+
- [C++ Metadata Guard Rule Engine Plugin](#metadata-guard-rule-engine-plugin)
1515
- [C++ Storage Tiering Rule Engine Plugin](https://github.com/irods/irods_capability_storage_tiering)
1616
- [C++ Indexing Rule Engine Plugin](https://github.com/irods/irods_capability_indexing)
1717

@@ -293,3 +293,76 @@ The best practice for using both `delay()` and `remote()` [depends on the use ca
293293
.. - Failover checking
294294
..
295295
-->
296+
297+
## Metadata Guard Rule Engine Plugin
298+
299+
The Metadata Guard iRODS Rule Engine Plugin protects metadata AVUs with attributes containing certain prefixes from modification by users in an iRODS zone. This is useful for protecting metadata used by administrative systems in the iRODS zone such as the [Storage Tiering Capability](../capabilities/storage_tiering.md) to ensure that these processes are uninterrupted.
300+
301+
### Configuration
302+
303+
The Rule Engine Plugin config is set as metadata on the **zone collection** (e.g. `/tempZone`).
304+
Each option is explained below.
305+
```javascript
306+
{
307+
// The list of strings that represent metadata that should be guarded.
308+
// In this example, any metadata beginning with "irods::" will be treated special
309+
// and require that the user be an administrator or classified as an editor depending
310+
// on the configuration.
311+
"prefixes": ["irods::"],
312+
313+
// Only administrators are allowed to modify metadata.
314+
// This option supersedes the "editors" option.
315+
"admin_only": true,
316+
317+
// The list of editors that can modify guarded metadata.
318+
"editors": [
319+
{
320+
// The type of entity that is allowed to modify metadata.
321+
// The following options are available:
322+
// - "user"
323+
// - "group"
324+
"type": "group",
325+
326+
// The name of the iRODS entity.
327+
// For remote users, you must include the zone (e.g. "rods#tempZone").
328+
"name": "rodsadmin"
329+
}
330+
]
331+
}
332+
```
333+
Once you've decided on what your config will be, you'll need to use `imeta` to set it. For example:
334+
```bash
335+
$ imeta set -C /tempZone irods::metadata_guard '{
336+
"prefixes": ["irods::"],
337+
"admin_only": false,
338+
"editors": [
339+
{"type": "group", "name": "rodsadmin"},
340+
{"type": "user", "name": "otherrods"},
341+
{"type": "user", "name": "alice" }
342+
]
343+
}'
344+
```
345+
Anytime a request to modify metadata is detected by the server, the Rule Engine Plugin will read the JSON
346+
config and determine whether the user should be allowed to continue.
347+
348+
!!! Note
349+
The user setting the metadata on the zone collection must have write permission on that collection!
350+
351+
### Enabling the Rule Engine Plugin
352+
353+
To enable, add the following plugin config to the list of rule engines in `/etc/irods/server_config.json`.
354+
The plugin config should be placed before any rule engines that need metadata to be guarded.
355+
356+
Even though this plugin will process PEPs first due to it's positioning, subsequent Rule Engine Plugins will
357+
still be allowed to process the same PEPs without any issues.
358+
```javascript
359+
"rule_engines": [
360+
{
361+
"instance_name": "irods_rule_engine_plugin-metadata_guard-instance",
362+
"plugin_name": "irods_rule_engine_plugin-metadata_guard",
363+
"plugin_specific_configuration": {}
364+
},
365+
366+
// ... Previously installed Rule Engine Plugin configs ...
367+
]
368+
```

0 commit comments

Comments
 (0)