Git Product home page Git Product logo

opnsense-plugin-configsync's Introduction

Configuration Sync (configsync) for OPNsense

Configuration Sync (configsync) is an OPNsense plugin designed to one-way synchronize the OPNsense system configuration .xml files to an (S3 compatible) cloud-storage provider. Actions for configsync are automatically triggered by an OPNsense syshook-config event.

Configuration Sync is well-suited to DevOps automation arrangements where OPNsense instances are re-invoked with a previously existing configuration.

Configuration Sync also happens to be a great OPNsense configuration backup solution when used by itself.

Configuration Sync supports the following cloud storage providers:-

  • Amazon Web Services - S3
  • Google - Cloud Storage
  • Digital Ocean - Spaces
  • Other - S3 compatible endpoints

Documentation

Issues

Source

Copyright

All rights reserved.

License

  • BSD-2-Clause - see LICENSE file for full details.

opnsense-plugin-configsync's People

Contributors

ndejong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

opnsense-plugin-configsync's Issues

System Log Files: Backend - ConfigSync INFO level log items are captured as ERROR level events in OPNsense system logs

ConfigSync INFO level log events are showing up in the OPNsense system logs as ERROR level events

The cause seems to be:-

  • ConfigSync is invoked via configd.py
  • Seems likely (and quite reasonable) that configd.py treats anything on STDERR as being an ERROR log level event

For example

2023-08-03T11:31:01	Error	configd.py	[97f1bd6c-f042-4fe3-4875-000cf97bab47] Script action stderr returned "b'2023-08-03T11:31:01+1000 configsync[99096] INFO: sync_all_system_configs - Successful PUT 1 objects into bucket:redacted-devops in path:redacted-pathname/opnsense'"

Encryption / handling of sensitive config data?

I'm new to OPNsense so maybe this is mitigated in some other way, but is it possible to encrypt the xml files before they are synced to the remote destination, assuming there's sensitive information contained in that file? Thank you.

Opnsense errors re ThreatPatrols repo / meta file availability

Today I upgraded my device's Opnsense firmware to 24.1, but it only partially succeed because all package/update operations starting seeing these errors:

Unable to update repository ThreatPatrols
pkg: Repository ThreatPatrols has a wrong packagesite, need to re-create database
The release type "opnsense" is not available on this repository.

At the source of it seemed to be the inability of Opnsense to find this file:

https://repo.threatpatrols.com/opnsense/FreeBSD:13:amd64/24.1/stable/meta.txz

In turn, other package operations appeared to be blocked. I deleted the os-threatpatrols package/plugin and that seems to have fixed things for the moment, and I was able to then upgrade to firmware 24.1.1.

I can't say I know enough about the Opnsense architecture to understand all of the interactions here, but thought I'd raise this in case there's something easy to address for the benefit of others.

Configuration Sync is not displayed

Good day
unfortunately the area Configuration Sync is not shown to me although the os-threatpatrols repo is installed.
Is there a way to find out why?

Screenshot 2023-08-13 at 6 20 10 AM

`configsync | CRITICAL: An error occurred` after OPNsense 22.7.11 upgrade, possibly related to Boto3 update

System update to OPNsense 22.7.11 (and maybe before this) causes the OPNsense repo hosted py39-boto3 (v1.26.13) and py39-botocore (v1.29.13) packages

This Boto3 version does not seem to be working with ConfigSync using Amazon-S3 or Google-S3 storage providers. The Digital Ocean storage-provider still works fine. Given the Digital Ocean setup requires an Endpoint URL override, a quick test to see if the others work if their respective URL overrides are supplied does not work-around the issue.

Errors in the logs like -

configsync | CRITICAL: An error occurred (AccessDenied) when calling the PutObject operation: Access denied.
configsync | CRITICAL: An error occurred (NoSuchKey) when calling the ListObjectsV2 operation: The specified key does not exist.

Stack trace using --debug on a manual test_parameters action shows -

2023-01-31T15:55:15+1000 configsync[7143] DEBUG: __put_object() - client_params[Key]=internal-ool1/opnsense/config-test.xml
2023-01-31T15:55:16+1000 configsync[7143] CRITICAL: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
Traceback (most recent call last):
  File "/usr/local/opnsense/scripts/ThreatPatrols/ConfigSync/configsync.py", line 205, in <module>
    response = configsync_cli()
  File "/usr/local/opnsense/scripts/ThreatPatrols/ConfigSync/configsync.py", line 78, in configsync_cli
    return storage_provider.test_parameters(
  File "/usr/local/opnsense/scripts/ThreatPatrols/ConfigSync/configsync/storage_provider/__init__.py", line 89, in test_parameters
    return self.storage_provider.test_parameters(**kwargs)
  File "/usr/local/opnsense/scripts/ThreatPatrols/ConfigSync/configsync/storage_provider/boto3_compatible.py", line 96, in test_parameters
    return self.__sync_files(files=config_files, overwrite_existing=True)
  File "/usr/local/opnsense/scripts/ThreatPatrols/ConfigSync/configsync/storage_provider/boto3_compatible.py", line 223, in __sync_files
    response = self.__put_object(
  File "/usr/local/opnsense/scripts/ThreatPatrols/ConfigSync/configsync/storage_provider/boto3_compatible.py", line 285, in __put_object
    response = boto_client.put_object(**client_params)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 515, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 934, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
{
  "message": "An error occurred (AccessDenied) when calling the PutObject operation: Access Denied",
  "status": "fail"
}

Manually testing credentials outside of ConfigSync shows these credentials are valid and the breakage was noticed right after a system upgrade to 22.7.11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.