# Managing Multiple Lua Scripts with Ceph Object Storage

DevFeed: [Managing Multiple Lua Scripts with Ceph Object Storage](<https://devfeed.tech/articles/managing-multiple-lua-scripts-with-ceph-object-storage-12338.md>)

Original publisher: [Read original article](<https://ceph.io/en/news/blog/2026/rgw-multiple-scripts/>)

Author: Kirby Chin

Published: 2026-06-10T00:00:00Z

Content type: article

Language: en

Sources: [Ceph Blog](<https://devfeed.tech/sources/ceph-blog.md>)

Topics: [Lua](<https://devfeed.tech/topics/lua.md>), [Script](<https://devfeed.tech/topics/script.md>), [Scripting](<https://devfeed.tech/topics/scripting.md>), [Security](<https://devfeed.tech/topics/security.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [cloud-infrastructure](<https://devfeed.tech/topics/cloud-infrastructure.md>), [ransomware](<https://devfeed.tech/topics/ransomware.md>)

Tags: [availability](<https://devfeed.tech/tags/availability.md>), [blog](<https://devfeed.tech/tags/blog.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [ceph](<https://devfeed.tech/tags/ceph.md>), [cli](<https://devfeed.tech/tags/cli.md>), [data](<https://devfeed.tech/tags/data.md>), [developer](<https://devfeed.tech/tags/developer.md>), [en-article](<https://devfeed.tech/tags/en-article.md>), [en-blog-post](<https://devfeed.tech/tags/en-blog-post.md>), [examples](<https://devfeed.tech/tags/examples.md>), [feature](<https://devfeed.tech/tags/feature.md>), [go](<https://devfeed.tech/tags/go.md>), [lua](<https://devfeed.tech/tags/lua.md>), [management](<https://devfeed.tech/tags/management.md>), [new-feature](<https://devfeed.tech/tags/new-feature.md>), [object-storage](<https://devfeed.tech/tags/object-storage.md>), [operations](<https://devfeed.tech/tags/operations.md>), [rados](<https://devfeed.tech/tags/rados.md>), [ransomware](<https://devfeed.tech/tags/ransomware.md>), [rgw](<https://devfeed.tech/tags/rgw.md>), [s3](<https://devfeed.tech/tags/s3.md>), [scripting](<https://devfeed.tech/tags/scripting.md>), [security](<https://devfeed.tech/tags/security.md>), [storage](<https://devfeed.tech/tags/storage.md>)

## AI overview

This article introduces a Ceph RADOS Gateway feature for managing multiple Lua scripts within the same request context and tenant. It demonstrates scripts for enforcing bucket object locks to mitigate ransomware risks and for optimizing storage through object auto-tiering.

## Source excerpt

Since the Pacific release, Lua scripting in Ceph's RADOS Gateway (RGW) has provided users the ability to interpolate a single script to upload operations per request context and tenant. This way of working might be completely fine for a storage deployment with limited scripting customizations. However, script management becomes increasingly difficult as more than one team wants to get involved in managing the Lua script within the same context and tenant. For this reason, we've released a new feature in RGW allowing you to manage more than one Lua script at a time. In this blog, we'll go over a couple of examples to walk you through how this feature can help your team to reduce runtime errors and lower developer friction when managing Lua scripts in RGW. To begin, we will create a script to enforce a bucket security control and then add another script to demonstrate the new feature. Script 1: Bucket security ¶ Let's suppose we are part of a security team and want to mitigate the risk of ransomware threats happening on our storage platform. One possible way to achieve this is to implement a Write Once, Read Many (WORM) strategy to add an object lock onto any newly created bucket. By using an object lock, we can add a constraint to write objects to disk only once, ensuring that an infected client cannot delete or override objects at a later time. To set our WORM strategy, we can create a Lua script in the prerequest context that aborts when a create_bucket operation is made without the write-once (object lock) requirement. objectlock.lua -- enforcing object lock on bucket creation if Request.RGWOp == "create_bucket" and Request.HTTP.Metadata["x-amz-bucket-object-lock-enabled"] ~= "true" then RGWDebugLog("object lock is missing on bucket: " .. Request.Bucket.Name) Request.Response.Message = "Bucket must have object lock enabled" return RGW_ABORT_REQUEST end You can create a new objectlock.lua file with the contents above and run the CLI commands below to upload the scr