Skip to content

security: mask sensitive passwords and API keys in Django Admin#890

Open
Sweekar-m wants to merge 1 commit into
eracle:mainfrom
Sweekar-m:fix/admin-mask-sensitive-credentials
Open

security: mask sensitive passwords and API keys in Django Admin#890
Sweekar-m wants to merge 1 commit into
eracle:mainfrom
Sweekar-m:fix/admin-mask-sensitive-credentials

Conversation

@Sweekar-m

Copy link
Copy Markdown

Summary

This PR fixes a security vulnerability where sensitive operator credentials (LinkedIn passwords, SMTP passwords, LLM API keys, BetterContact API keys, and central contact API tokens) are exposed in clear text within Django Admin change views.

Changes

  • Implemented custom ModelForm definitions (SiteConfigForm, LinkedInProfileForm, MailboxForm) utilizing forms.PasswordInput(render_value=True) widgets for all secret/credential fields.
  • Tied the custom forms to their respective Django Admin model handlers (SiteConfigAdmin, LinkedInProfileAdmin, MailboxAdmin).
  • Double-checked list_display settings to guarantee that raw passwords and API keys are never exposed in list columns.
  • Preserved existing form save behavior so operators do not need to re-type existing credentials when editing other settings.

Verification

  • Verified that the changes do not affect model behaviors or break any of the existing 420+ automated tests (ran pytest successfully).
  • Confirmed that no database migrations are needed.

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