Skip to content

New CRE Rule: Redis Rejects Writes Due to Maxmemory Limit#46

Merged
tonymeehan merged 4 commits intoprequel-dev:mainfrom
amuta:am-cre-2025-0071
Jun 3, 2025
Merged

New CRE Rule: Redis Rejects Writes Due to Maxmemory Limit#46
tonymeehan merged 4 commits intoprequel-dev:mainfrom
amuta:am-cre-2025-0071

Conversation

@amuta
Copy link
Copy Markdown
Contributor

@amuta amuta commented Jun 1, 2025

Summary

This PR introduces a new CRE (Common Remediation Enumeration) detection rule for a common and critical Redis failure. The failure occurs when a Redis instance reaches its configured maxmemory limit and, due to its active memory management policy (typically 'noeviction', which is often the default), begins rejecting client write commands.

Closes #42
/claim #42

Rule Added

  • Title: Redis Rejects Writes Due to Reaching 'maxmemory' Limit
  • ID: CRE-2025-0071
  • PlayGround Link

Failure Scenario Details

The rule is designed to detect the specific error message (error) OOM command not allowed when used memory > 'maxmemory' that Redis sends to clients under these conditions. This indicates that the server cannot allocate memory for new write operations and is not configured to evict existing keys to make space.

Video Demonstration

Screencast.2025-06-01.02.08.19.mp4

Reproduction Environment & Logs

A complete, minimal setup to reproduce this failure scenario is available in a separate GitHub repository:

➡️ Reproduction Repository: `https://github.com/amuta/cre-2025-0071-setup

This repository includes:

  • docker-compose.yml to set up the Redis instance with appropriate maxmemory limits.
  • run_oom_test.sh script to trigger the OOM condition by writing data.
  • test.log which contains example logs. Crucially, test.log captures the timestamped output directly from the redis-cli client, demonstrating the exact error message as an application would receive and log it.

Detection Logic within the Rule

The CRE rule identifies this failure by using a regular expression to match the distinct error string "OOM command not allowed when used memory > 'maxmemory'" within logs originating from applications or clients interacting with Redis

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Jun 1, 2025

Welcome to the Problem Detection Community and thank you for your pull request!

New contributors need to sign the Contributor License Agreement. In order for us to review and merge your code, please click the CLA link and fill out the form.

@tonymeehan
Copy link
Copy Markdown
Contributor

Looks like there's a conflict on the CRE rule. Can you change this to 0073? Please also make sure the tags/categories are updated in rules/tags/*.yaml. Once these changes are completed this is good to merge!

@amuta
Copy link
Copy Markdown
Contributor Author

amuta commented Jun 2, 2025

@tonymeehan I've added two more specific tags and changed the others to some existing ones that already fit the context.

@tonymeehan tonymeehan merged commit 6f5f6b0 into prequel-dev:main Jun 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Rule] Redis: Reproduce A High-Severity Failure & Write a Detection Rule

2 participants