Skip to content

Harden encryption failure handling - #62

Draft
Rhutvik-pachghare1999 wants to merge 2 commits into
mainfrom
agent/security-hardening-20260805
Draft

Harden encryption failure handling#62
Rhutvik-pachghare1999 wants to merge 2 commits into
mainfrom
agent/security-hardening-20260805

Conversation

@Rhutvik-pachghare1999

Copy link
Copy Markdown
Collaborator

What changed

  • Corrected the encryption module terminology to describe Fernet accurately.
  • Invalid configured keys now fail closed instead of silently generating a replacement key.
  • Tampered ciphertext and non-numeric decrypted sensor values now raise errors instead of becoming 0.0.
  • Key rotation refuses to overwrite an existing backup and restores the previous key if persistence fails.
  • Added focused regression tests for invalid keys, ciphertext tampering, and invalid sensor plaintext.

Why

The previous behavior could turn a cryptographic failure or corrupted telemetry value into a valid-looking zero. In an industrial prediction pipeline, that hides integrity failures and can influence downstream model decisions.

Validation

The added tests are designed to run with the existing pytest suite. CI should verify compatibility with the repository's current dependencies and Python versions.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a9f06a88-6862-4da9-b6c5-6795dbe357af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant