openwisp / openwisp/openwisp-controller

[feature:gsoc26] Implement auto-regeneration of certificates on device update

Open
#1,359 1 comment 0 reactions 1 assignee View on GitHub

@stktyagi is already working on this.

Since May 15, 2026.

enhancement gsoc
Dominant language
Python
Stars
773
Forks
315
Avg merge
2d 16h
Merged PRs (30d)
14

Description

Is your feature request related to a problem? Please describe.
Because the device hostname and MAC address are explicitly bound to the certificate, via the CN and custom OIDs, any modification to the device's hardware properties results in a stale, inaccurate certificate. If an admin swaps a device's network interface card, changing the MAC, the existing certificate becomes an invalid identity.

Describe the solution you'd like
I will implement a handler to regenerate certificates when hardware properties drift:

  1. Signal Monitoring: wire OpenWISP's existing device_name_changed and standard post_save signals in handlers.py to actively monitor for modifications to the hostname and mac_address fields.

  2. Regeneration: if a modification is detected on a device that holds a DeviceCertificate, trigger a regenerate_device_certificate_task.

    • Revoke the outdated certificate via the CRL.
    • Generate a newly bound certificate with the updated hardware properties.
    • Preserve the proposal requirement that device UUID and MAC address are stored as custom private OIDs in generated certificates.
  3. Safe Cache Invalidation: after regeneration, the system must trigger a config update using OpenWISP's native update_status_if_checksum_changed() method. This prevents false positive modified statuses and avoids triggering unnecessary monitoring alarms.

  4. UI Alerting: push a UI notification using openwisp_notifications of type generic_message to inform the administrator after successful automated hardware-binding regeneration.

Requirements from the GSoC proposal

  • Regeneration upon hostname or MAC address changes must be user-configurable to prevent unexpected downtime.
  • The exact configuration point and default behavior are intentionally left open and must be decided during implementation.
  • The exact private OID values for MAC address and device UUID are intentionally left open and must be decided or documented during implementation.

Tests from the GSoC proposal

  • Device property change triggers certificate regeneration when regeneration is enabled.
  • The generated replacement certificate includes the updated hostname or MAC address binding.
  • A generic_message toast notification appears after certificate regeneration.

Measurable outcomes: 4
Implementation point: 8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.