Skip to content

About

Step CA Client Plugin for Opnsense

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPNsense Step CA Plugin

This plugin provides automated certificate management using Step CA for OPNsense, including certificate issuance, renewal, and automatic import into the OPNsense web GUI. This plugin is kept simple on purpose and is only for issuing a certificate for the OPNsens firewall box itself. if you need a more comprehensive acme solution, prefer the os-acme-client plugin (which supports DNS, HTTP and ALPN challenges). This plugin was created with the step-ca tutorials in mind.

This allows configuring OPNSense according to the best practice described in acme-basics and build a tiny ca authority. It enables renewing a step-ca certificate on a short lived interval (24/12/6 hr).

NOTE: step-ca only supports the http-01 challenge. this requires checking the Disable web GUI redirect rule (System -> Settings -> Administration) to allow using port 80 for those challenges. Automatically shutting off web and restarting isn't supported by this plugin yet (and may never be).

NOTE: this is only to give you firewall box HTTPS with a custom ca, not for running a CA itself on the firewall box. OPNSense already has nice utilities for that.

Features

  • Certificate issuance from Step CA servers
  • Automatic certificate renewal with cron scheduling
  • Automatic import of certificates into OPNsense web GUI
  • Configurable CA URL, domain name, and SANs
  • Support for custom Step CA instances

Prerequisites

  • OPNsense 24.x or later
  • jq installed (pkg install jq)
  • A configured Step CA server

Installing step-cli

the step-cli is not apart of the default opnsense package repo, so it needs to be installed manually according to opnsense docs. the installation instructions are included here for convenience but please check opnsense docs for any possible changes.

  1. ssh into your opnsense firewall box (ssh settings are out of scope but may be configured via users and System->Settings->Administration)

  2. use the official opnsense build system to install step-cli

opnsense-code ports
cd /usr/ports/security/step-cli
make install

then you should be able to manage step-cli from the gui like other packages. to update from CLI,

opnsense-code ports
cd /usr/ports/security/step-cli
make reinstall

Installation

Until this plugin is available in a freebsd/opnsense repository somewhere, it needs to be installed manually. this will result in an "Orphaned" plugin on the "Plugins" page, which means it has no known repository it belongs to and so will not be auto-updated.

Installation

Directions for installing a plugin are taken from here.

  1. Clone https://github.com/opnsense/tools into /usr/tools on your firewall box

  2. prefetch the base, kernel, and packages to avoid compiling from source (which takes a very long time)

    • cd /usr/tools && make prefetch-base,kernel,packages
  3. Navigate to /usr/plugins/devel/ and clone this repo, cd /usr/plugins/devel && git clone https://github.com/insipx/os-step-ca

  4. build and install the plugin cd /usr/plugins/devel/os-step-ca && make upgrade

Configuration

Web GUI Setup

gui

  1. Navigate to Services > Step CA in the OPNsense web interface

  2. Configure the following required fields:

    • Enable: Check to enable the service
    • CA URL: Your Step CA server URL (e.g., https://ca.example.com)
    • Domain Name: Primary domain for certificates (e.g., opnsense.example.com)
    • Provisioner: Step CA provisioner name (default: acme)
  3. Optional configuration:

    • SAN Domains/IPs: Comma-separated list of Subject Alternative Names Example: 10.10.69.1,192.168.1.1,*.example.com
    • Force Overwrite: If enabled using the Issue command will create a new cert && overwrite anyexisting cert + import the new cert.
    • Renew Before Expiry (Default 4h): Renew certificate if it expires within this duration (e.g., 4h, 24h, 7d). Set to 0 to force renewal regardless of expiry. Used by the cron job configured in Settings -> Cron.
  4. Click Apply to save settings. these are the settings used for actions as well as in the step ca cron job.

First Certificate Issuance

  1. In the web GUI, click the Issue button to issue your first certificate
  2. The certificate will be automatically imported into OPNsense and set as the web GUI certificate
  3. The web GUI will restart with the new certificate

Setting up Automatic Renewal

The plugin includes a cron template for automatic renewal

cron

Uninstallation

  • Going to the plugins page on OPNSense, System -> Firmware -> Plugins you can click the trash icon on the os-step-ca plugin to uninstall.

About

Step CA Client Plugin for Opnsense

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages