diff --git a/wolfSentry/src/ChangeLog.md b/wolfSentry/src/ChangeLog.md index 378e0d3a..de92d0e1 100644 --- a/wolfSentry/src/ChangeLog.md +++ b/wolfSentry/src/ChangeLog.md @@ -1,5 +1,59 @@ # wolfSentry Release History and Change Log +
+ +# wolfSentry Release 1.6.1 (November 18, 2023) + +Release 1.6.1 of the wolfSentry embedded firewall/IDPS has enhancements, +additions, and improvements including: + +## New Features + +Dynamic rules with nonzero connection counts are now subject to deferred expiration, to assure traffic over established connections is allowed until all connections are closed, even with pauses in traffic flow exceeding the max idle time configured for the rule. + +When a rule with a nonzero connection count is deleted, actual deletion is deferred until all connections are closed or the `"max-purgeable-idle-time"` is reached (see below). New success code `WOLFSENTRY_SUCCESS_ID_DEFERRED` is returned in that case. If an identical rule is inserted before the deferred deletion, the existing rule is unmarked for deletion and the insertion call returns another new success code, `WOLFSENTRY_SUCCESS_ID_ALREADY_OK`. + +A `"max-purgeable-idle-time"` JSON configuration option has been added, forcing expiration and purge of a zombie dynamic rule even if its current connection count is nonzero. New related APIs are also added: `wolfsentry_route_table_max_purgeable_idle_time_get()`, `wolfsentry_route_table_max_purgeable_idle_time_set()`, and `wolfsentry_route_purge_time_set()`. + + +## Noteworthy Changes and Additions + +A new `FILT_CLOSE_WAIT` event type is added to the lwIP integration patch, and a corresponding `WOLFSENTRY_ACTION_RES_CLOSE_WAIT` result bit is added. Appropriate callbacks are added to lwIP `tcp_process()` and `tcp_receive()`, and the lwIP glue logic now handles mapping from `FILT_CLOSE_WAIT` to `WOLFSENTRY_ACTION_RES_CLOSE_WAIT`. + +The lwIP patch has been rebased on upstream 5e3268cf3e (Oct 14 2023), while maintaining compatibility with lwIP 2.1.3-RELEASE. + + +## Bug Fixes, Cleanups, and Debugging Aids + +The lwIP patch includes several fixes: +* In `tcp_process()`, when handling passive close and entering `CLOSE_WAIT`, don't `tcp_filter_dispatch_incoming(FILT_CLOSED, ...)` -- this happens later, at deallocation. +* Fix `TCP FILT_CLOSED` callbacks to assure accurate interface ID and local_port are passed. + +The route/rule system includes several fixes: +* Add error checking to `meta.connection_count` decrement in `wolfsentry_route_event_dispatch_0()`, so that rule churn can never result in count underflow. +* Mask out internal flags (via new macro `WOLFSENTRY_ROUTE_INTERNAL_FLAGS`) from `route_exports->flags` in `wolfsentry_route_init_by_exports()`. +* In `wolfsentry_route_init_by_exports()`, fix pointer math in `memset()` argument to correctly treat `route_exports->private_data_size` as a byte count. +* In `wolfsentry_route_new_by_exports()`, fix check on `route_exports->private_data_size` to properly reflect `config->route_private_data_padding`. +* Add missing implementation of `wolfsentry_route_insert_by_exports()`. +* In `wolfsentry_route_clone()`, fix allocation to use `WOLFSENTRY_MEMALIGN_1()` when `.route_private_data_alignment` is nonzero. +* In `wolfsentry_route_event_dispatch_0()`, don't increment/decrement counts when `WOLFSENTRY_ACTION_RES_FALLTHROUGH`. + +In `src/lwip/packet_filter_glue.c`, add `action_results` and `local.sa.interface` to `WOLFSENTRY_DEBUG_LWIP` messages, and add missing gates for `LWIP_IPV6` in `WOLFSENTRY_DEBUG_LWIP` paths. + +In `tcp_filter_with_wolfsentry()`, don't set `WOLFSENTRY_ROUTE_FLAG_DIRECTION_IN` for `FILT_REMOTE_RESET`, and fix typo "&event" in call to `wolfsentry_route_event_dispatch_with_inited_result()`. + +Remove several incorrect calls to `wolfsentry_table_ent_delete_by_id_1()` immediately following failed calls to `wolfsentry_table_ent_insert()` -- the former is implicit to the latter. + + +## Self-Test Enhancements + +Add to `test_json()` a workout of `connection_count` and deferred deletion dynamics. + +`Makefile.analyzers`: add `sanitize-all-NO_POSIX_MEMALIGN-gcc`; tweak `notification-demo-build-test` to explicitly use the `master` branch of wolfssl. + +`Makefile`,`Makefile.analyzers`: tweaks for MacOS X compatibility. + +
# wolfSentry Release 1.6.0 (October 24, 2023) diff --git a/wolfSentry/src/json_configuration.md b/wolfSentry/src/json_configuration.md index ac2eb330..9aa1bc86 100644 --- a/wolfSentry/src/json_configuration.md +++ b/wolfSentry/src/json_configuration.md @@ -59,8 +59,8 @@ built-ins. `"config-update"` allows the default configuration to be updated. It is termed an “update” because wolfSentry is initially configured by the `config` argument to `wolfsentry_init()` (which can be passed in `NULL`, signifying built-in -defaults). Note that times (`config.penaltybox_duration` and -`config.route_idle_time_for_purge`) shall be passed to `wolfsentry_init()` +defaults). Note that times (`wolfsentry_eventconfig.penaltybox_duration` and +`wolfsentry_eventconfig.route_idle_time_for_purge`) shall be passed to `wolfsentry_init()` denominated in seconds, notwithstanding the `wolfsentry_time_t` type of the members. @@ -111,7 +111,8 @@ allowed values are as in the ABNF formal syntax later in this document. "action-res-filter-bits-unset" : action_res_flag_list, "action-res-bits-to-add" : action_res_flag_list, "action-res-bits-to-clear" : action_res_flag_list, - "max-purgeable-routes" : uint32 + "max-purgeable-routes" : uint32, + "max-purgeable-idle-time" : duration }, "events" : [ { "label" : label, @@ -215,6 +216,8 @@ allowed values are as in the ABNF formal syntax later in this document. * `max-purgeable-routes` -- Global limit on the number of ephemeral routes to allow in the route table, beyond which the least recently matched ephemeral route is forced out early. Not allowed in `config` clauses of events. +* `max-purgeable-idle-time` -- Global absolute maximum idle time for ephemeral routes, controlling purges of stale (expired) ephemeral routes with nonzero `wolfsentry_route_metadata_exports.connection_count`. Default is no limit. Not allowed in `config` clauses of events. + * `route-idle-time-for-purge` -- If nonzero, the time after the most recent dispatch match for a route to be garbage-collected. Useful primarily in `config` clauses of events (see `events` below). * `route-flags-to-add-on-insert` -- List of route flags to set on new routes upon insertion. Useful primarily in `config` clauses of events (see `events` below). @@ -366,7 +369,7 @@ event_config_list = "{" event_config_item *("," event_config_item) "}" top_config_list = "{" top_config_item *("," top_config_item) "}" -top_config_item = event_config_item / max_purgeable_routes_clause +top_config_item = event_config_item / max_purgeable_routes_clause / max_purgeable_idle_time_clause event_config_item = (DQUOTE %s"max-connection-count" DQUOTE ":" uint32) / @@ -382,6 +385,8 @@ duration = number_sint64 / (DQUOTE number_sint64 [ %s"d" / %s"h" / %s"m" / %s"s" max_purgeable_routes_clause = DQUOTE %s"max-purgeable-routes" DQUOTE ":" uint32 +max_purgeable_idle_time_clause = DQUOTE %s"max-purgeable-idle-time" DQUOTE ":" duration + route_flag_list = "[" route_flag *("," route_flag) "]" action_res_flag_list = "[" action_res_flag *("," action_res_flag) "]"