How to Add Trusted Macro Sources in LibreOffice

LibreOffice provides security controls to protect systems from malicious code by restricting how macros execute. By configuring trusted file locations and trusted certificate authorities, you can automatically run legitimate macros from approved directories or verified developers without compromising your overall security posture. This guide outlines the exact steps to configure macro security levels, add trusted file paths, and manage trusted certificates in LibreOffice.

Step 1: Access Macro Security Settings

Before adding trusted locations or certificates, open the macro security management panel:

  1. Open LibreOffice (Writer, Calc, or the main application window).
  2. Go to Tools > Options (on macOS, go to LibreOffice > Preferences).
  3. In the left-hand panel, expand the LibreOffice section and select Security.
  4. Under the Macro Security section on the right, click the Macro Security… button.
  5. In the Security Level tab, ensure the level is set to High (macros only run if signed by a trusted certificate or located in a trusted directory) or Medium (prompts for confirmation unless trusted).

Step 2: Add Trusted File Paths

Adding a directory to your trusted file locations allows any document stored within that folder (and its subfolders) to execute macros without security warnings.

  1. In the Macro Security dialog box, select the Trusted Sources tab.
  2. Locate the Trusted File Locations section at the bottom.
  3. Click the Add… button.
  4. Browse to and select the local or network folder where your trusted documents and templates are stored.
  5. Click Select Folder (or OK).
  6. Verify that the folder path appears in the list of trusted locations.

Step 3: Add Trusted Certificate Authorities and Signatures

When macros are digitally signed by a trusted identity or internal Certificate Authority (CA), LibreOffice can validate the signature and run the macro safely regardless of file location.

  1. In the Macro Security dialog, remain on the Trusted Sources tab.
  2. Locate the Trusted Certificates section at the top.
  3. To add a certificate directly:
    • When you open a signed document for the first time, LibreOffice displays a signature warning dialog showing the certificate details.
    • Check the box labeled Always trust macros from this source to automatically add the certificate to your trusted list.
  4. For system-wide Certificate Authorities:
    • On Windows, LibreOffice relies on the Windows Certificate Store. Install your root or intermediate CA certificate into the “Trusted Root Certification Authorities” store via certmgr.msc.
    • On Linux, LibreOffice uses the system NSS/Mozilla certificate store. Import the CA certificate into your default Mozilla profile or the system trust store (/etc/ssl/certs or /etc/pki/ca-trust).
    • On macOS, add the CA certificate to the System or login keychain using the Keychain Access app and set the trust policy to “Always Trust”.

Step 4: Apply and Confirm Settings

  1. Click OK to close the Macro Security dialog.
  2. Click Apply and then OK to exit the main Options window.
  3. Restart LibreOffice to ensure all path and certificate changes are properly loaded into memory.