Consent
Security toolkit for managing consent records — generate tokens, check strength, rotate credentials, audit logs, store and retrieve entries, manage policies, and produce compliance reports. All data stays local.
Commands
| Command | Description |
|---|
| INLINECODE0 | Generate a new entry and log it |
| INLINECODE1 |
Check strength of a given input and record the result |
|
consent rotate <input> | Rotate a credential or token and log the change |
|
consent audit <input> | Record an audit entry for compliance tracking |
|
consent store <input> | Store a value securely in the local data log |
|
consent retrieve <input> | Retrieve a previously stored value |
|
consent expire <input> | Mark an entry as expired |
|
consent policy <input> | Record or update a policy entry |
|
consent report <input> | Generate a report entry for review |
|
consent hash <input> | Hash a value and store the result |
|
consent verify <input> | Verify a value against stored records |
|
consent revoke <input> | Revoke a previously granted consent or credential |
|
consent stats | Show summary statistics: entry counts, data size, first activity date |
|
consent export <fmt> | Export all data in
json,
csv, or
txt format |
|
consent search <term> | Search across all logs for a keyword |
|
consent recent | Show the 20 most recent activity entries |
|
consent status | Health check: version, data dir, entry count, disk usage, last activity |
|
consent help | Show help with all available commands |
|
consent version | Show current version |
Command Behavior
- - With arguments: Each command logs the input with a timestamp to its own dedicated log file (e.g.,
generate.log, audit.log) - Without arguments: Each command displays the 20 most recent entries from its log file
Data Storage
- - Default data directory: INLINECODE24
- Per-command logs:
$DATA_DIR/<command>.log (e.g., generate.log, audit.log, store.log) - History log:
$DATA_DIR/history.log — master timeline of all activity - Export files:
$DATA_DIR/export.<fmt> — generated by the export command - All data is local plain-text. No network calls, no cloud sync.
Requirements
- - Bash 4+ (uses
set -euo pipefail) - No external dependencies or API keys required
- Works entirely offline — your data stays on your machine
When to Use
- 1. Tracking consent and compliance — Record who consented to what and when with
store, audit, and policy for a simple compliance trail - Credential rotation logging — Use
rotate and expire to log when credentials were changed or invalidated - Security auditing — Run
audit entries and pull report data to review security posture over time - Exporting compliance data — Use
export json or export csv to produce machine-readable records for external auditing tools - Quick lookups and verification — Search across all logs with
search or verify specific entries with verify and INLINECODE44
Examples
CODEBLOCK0
How It Works
Each domain command (generate, audit, store, etc.) maintains its own log file in the data directory. Entries are stored as timestamp|value lines. The stats command aggregates counts across all log files. The export command merges all logs into a single file in your chosen format. Every action is also recorded in history.log as a master audit trail.
Tips
- - Run any command without arguments to see its recent entries — great for quick review
- Use
consent recent to see a timeline of all activity across all commands - Pipe exports to other tools: INLINECODE50
- Combine
search with grep for complex queries: INLINECODE52 - Run
consent help at any time for the full command reference
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
同意
用于管理同意记录的安全工具包——生成令牌、检查强度、轮换凭证、审计日志、存储和检索条目、管理策略以及生成合规性报告。所有数据均保留在本地。
命令
| 命令 | 描述 |
|---|
| consent generate <输入> | 生成新条目并记录 |
| consent check-strength <输入> |
检查给定输入的强度并记录结果 |
| consent rotate <输入> | 轮换凭证或令牌并记录更改 |
| consent audit <输入> | 记录审计条目以进行合规性追踪 |
| consent store <输入> | 安全地将值存储在本地数据日志中 |
| consent retrieve <输入> | 检索先前存储的值 |
| consent expire <输入> | 将条目标记为已过期 |
| consent policy <输入> | 记录或更新策略条目 |
| consent report <输入> | 生成报告条目以供审查 |
| consent hash <输入> | 对值进行哈希处理并存储结果 |
| consent verify <输入> | 对照存储的记录验证值 |
| consent revoke <输入> | 撤销先前授予的同意或凭证 |
| consent stats | 显示摘要统计信息:条目计数、数据大小、首次活动日期 |
| consent export <格式> | 以 json、csv 或 txt 格式导出所有数据 |
| consent search <关键词> | 在所有日志中搜索关键词 |
| consent recent | 显示最近20条活动条目 |
| consent status | 健康检查:版本、数据目录、条目计数、磁盘使用情况、最近活动 |
| consent help | 显示包含所有可用命令的帮助信息 |
| consent version | 显示当前版本 |
命令行为
- - 带参数时:每个命令将输入及其时间戳记录到其专用的日志文件中(例如 generate.log、audit.log)
- 不带参数时:每个命令显示其日志文件中最近的20条条目
数据存储
- - 默认数据目录:~/.local/share/consent/
- 按命令划分的日志:$DATADIR/<命令>.log(例如 generate.log、audit.log、store.log)
- 历史日志:$DATADIR/history.log —— 所有活动的主时间线
- 导出文件:$DATA_DIR/export.<格式> —— 由 export 命令生成
- 所有数据均为本地纯文本。无网络调用,无云同步。
系统要求
- - Bash 4+(使用 set -euo pipefail)
- 无需外部依赖或API密钥
- 完全离线运行 —— 您的数据保留在您的机器上
使用场景
- 1. 追踪同意和合规性 —— 使用 store、audit 和 policy 记录谁在何时同意了什么,形成简单的合规追踪链
- 凭证轮换日志记录 —— 使用 rotate 和 expire 记录凭证何时被更改或失效
- 安全审计 —— 运行 audit 条目并提取 report 数据以审查随时间变化的安全态势
- 导出合规性数据 —— 使用 export json 或 export csv 生成机器可读的记录,供外部审计工具使用
- 快速查找和验证 —— 使用 search 搜索所有日志,或使用 verify 和 hash 验证特定条目
示例
bash
存储同意记录
consent store 用户:alice 接受服务条款 v2.1
审计策略变更
consent audit 更新数据保留策略为90天
生成新令牌条目
consent generate api-key-prod-2025
轮换凭证并记录
consent rotate 数据库密码-主库已轮换
检查密码短语强度
consent check-strength my-complex-passphrase-2025!
以JSON格式导出所有数据
consent export json
搜索所有日志
consent search alice
查看摘要统计信息
consent stats
健康检查
consent status
显示最近活动
consent recent
工作原理
每个领域命令(generate、audit、store等)在数据目录中维护自己的日志文件。条目存储为 时间戳|值 格式的行。stats 命令汇总所有日志文件的计数。export 命令将所有日志合并为您所选格式的单个文件。每个操作也会记录在 history.log 中,作为主审计追踪。
提示
- - 不带参数运行任何命令以查看其最近的条目 —— 非常适合快速审查
- 使用 consent recent 查看所有命令中所有活动的时间线
- 将导出内容通过管道传递给其他工具:consent export csv && cat ~/.local/share/consent/export.csv | head
- 将 search 与 grep 结合用于复杂查询:consent search 2025 | grep policy
- 随时运行 consent help 获取完整的命令参考
由 BytesAgain 提供 | bytesagain.com | hello@bytesagain.com