dsh-cn-log-retention: Log Retention Compliance Check

Introduction

In the DeepSeek Harness (DSH) ecosystem, plugins are the primary method for extending capabilities. Logs are the foundation of security auditing, but developers often focus only on what is “adequate” when configuring rotation, while ignoring “statutory” durations. For example, setting the log library’s maxDays to 7 days may be sufficient for troubleshooting. However, if a security incident occurs six months later, the logs would have already been rotated and deleted, leading to compliance failure in light of the Cybersecurity Law requirement to retain logs for no less than 6 months.

dsh-cn-log-retention aims to solve such problems. It is a DSH plugin designed to check whether application-layer log retention meets the statutory requirement of 6 months.

Core Features

This plugin primarily checks the following items:
1. Check if logging is enabled.
2. Check if the necessary content is being logged.
3. Check if logs are retained for the statutory 6 months.
4. Check if the retention period is less than 180 days (High).
5. Check if the log level is disabled (High).
6. Check if passwords or token values are printed in the logs (High).
7. Check if a logging scheme exists (Medium).

Installation

Install using the official command:

dsh plugin --profile web add @deepwhale-cn/dsh-cn-log-retention

Usage

After installation, you can use it via the following commands:

# View a demo of the check results
dsh-cn-log-retention --demo

# List rules and references
dsh-cn-log-retention --list-rules

# Generate an HTML report
dsh-cn-log-retention --html r.html

Precautions

When using this plugin, please understand its boundaries:
- No Missing Item Judgment: The absence of a rotation configuration does not imply logs were not retained for 180 days; unified retention might be handled at the deployment layer.
- Application Layer Only: Database auditing, network devices, and operating system logs are not within the scope of this check.
- Immutability Not Verified: This requires inspection of the storage layer design.
- Legal Compliance: Users must comply with the laws and regulations of their region and assume full responsibility for any consequences resulting from the use of this project.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye