Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 5d41f93

Browse files
committed
Generate docs
1 parent 5a38559 commit 5d41f93

File tree

1 file changed

+108
-27
lines changed

1 file changed

+108
-27
lines changed

scripts/policy/protocols/conn/known-services.zeek.rst

Lines changed: 108 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,47 @@ If a protocol name is found/known for service, that will be logged,
1313
but services whose names can't be determined are also still logged.
1414

1515
:Namespace: Known
16-
:Imports: :doc:`base/frameworks/cluster </scripts/base/frameworks/cluster/index>`, :doc:`base/utils/directions-and-hosts.zeek </scripts/base/utils/directions-and-hosts.zeek>`
16+
:Imports: :doc:`base/frameworks/cluster </scripts/base/frameworks/cluster/index>`, :doc:`base/frameworks/storage/async.zeek </scripts/base/frameworks/storage/async.zeek>`, :doc:`base/frameworks/storage/sync.zeek </scripts/base/frameworks/storage/sync.zeek>`, :doc:`base/utils/directions-and-hosts.zeek </scripts/base/utils/directions-and-hosts.zeek>`, :doc:`policy/frameworks/storage/backend/sqlite </scripts/policy/frameworks/storage/backend/sqlite/index>`
1717

1818
Summary
1919
~~~~~~~
2020
Runtime Options
2121
###############
2222
====================================================================================== ========================================================================
2323
:zeek:id:`Known::service_store_timeout`: :zeek:type:`interval` :zeek:attr:`&redef` The timeout interval to use for operations against
24-
:zeek:see:`Known::service_store`.
24+
:zeek:see:`Known::service_broker_store` and
25+
:zeek:see:`Known::service_store_backend`.
2526
:zeek:id:`Known::service_tracking`: :zeek:type:`Host` :zeek:attr:`&redef` The hosts whose services should be tracked and logged.
2627
:zeek:id:`Known::service_udp_requires_response`: :zeek:type:`bool` :zeek:attr:`&redef` Require UDP server to respond before considering it an "active service".
2728
====================================================================================== ========================================================================
2829

2930
Redefinable Options
3031
###################
31-
================================================================================= =======================================================================
32-
:zeek:id:`Known::service_store_expiry`: :zeek:type:`interval` :zeek:attr:`&redef` The expiry interval of new entries in :zeek:see:`Known::service_store`.
33-
:zeek:id:`Known::service_store_name`: :zeek:type:`string` :zeek:attr:`&redef` The Broker topic name to use for :zeek:see:`Known::service_store`.
34-
:zeek:id:`Known::use_service_store`: :zeek:type:`bool` :zeek:attr:`&redef` Toggles between different implementations of this script.
35-
================================================================================= =======================================================================
32+
========================================================================================================= =============================================================================
33+
:zeek:id:`Known::service_store_backend_options`: :zeek:type:`Storage::BackendOptions` :zeek:attr:`&redef` The options for the service store.
34+
:zeek:id:`Known::service_store_backend_type`: :zeek:type:`Storage::Backend` :zeek:attr:`&redef` The type of storage backend to open.
35+
:zeek:id:`Known::service_store_expiry`: :zeek:type:`interval` :zeek:attr:`&redef` The expiry interval of new entries in :zeek:see:`Known::service_broker_store`
36+
and :zeek:see:`Known::service_store_backend`.
37+
:zeek:id:`Known::service_store_name`: :zeek:type:`string` :zeek:attr:`&redef` The Broker topic name to use for :zeek:see:`Known::service_broker_store`.
38+
:zeek:id:`Known::service_store_prefix`: :zeek:type:`string` :zeek:attr:`&redef` The name to use for :zeek:see:`Known::service_store_backend`.
39+
:zeek:id:`Known::use_service_store`: :zeek:type:`bool` :zeek:attr:`&redef` Toggles between different implementations of this script.
40+
:zeek:id:`Known::use_storage_framework`: :zeek:type:`bool` :zeek:attr:`&redef` Switches to the version of this script that uses the storage
41+
framework instead of Broker stores.
42+
========================================================================================================= =============================================================================
3643

3744
State Variables
3845
###############
39-
======================================================================================== ====================================================================
40-
:zeek:id:`Known::service_store`: :zeek:type:`Cluster::StoreInfo` Holds the set of all known services.
46+
======================================================================================== ========================================================================
47+
:zeek:id:`Known::service_broker_store`: :zeek:type:`Cluster::StoreInfo` Storage configuration for Broker stores
48+
Holds the set of all known services.
49+
:zeek:id:`Known::service_store_backend`: :zeek:type:`opaque` Storage configuration for storage framework stores
50+
This requires setting a configuration in local.zeek that sets the
51+
Known::use_storage_framework boolean to T, and optionally sets different
52+
values in the Known::service_store_backend_options record.
4153
:zeek:id:`Known::services`: :zeek:type:`table` :zeek:attr:`&create_expire` = ``1.0 day`` Tracks the set of daily-detected services for preventing the logging
4254
of duplicates, but can also be inspected by other scripts for
4355
different purposes.
44-
======================================================================================== ====================================================================
56+
======================================================================================== ========================================================================
4557

4658
Types
4759
#####
@@ -83,17 +95,18 @@ Detailed Interface
8395
Runtime Options
8496
###############
8597
.. zeek:id:: Known::service_store_timeout
86-
:source-code: policy/protocols/conn/known-services.zeek 69 69
98+
:source-code: policy/protocols/conn/known-services.zeek 104 104
8799

88100
:Type: :zeek:type:`interval`
89101
:Attributes: :zeek:attr:`&redef`
90102
:Default: ``15.0 secs``
91103

92104
The timeout interval to use for operations against
93-
:zeek:see:`Known::service_store`.
105+
:zeek:see:`Known::service_broker_store` and
106+
:zeek:see:`Known::service_store_backend`.
94107

95108
.. zeek:id:: Known::service_tracking
96-
:source-code: policy/protocols/conn/known-services.zeek 47 47
109+
:source-code: policy/protocols/conn/known-services.zeek 56 56
97110

98111
:Type: :zeek:type:`Host`
99112
:Attributes: :zeek:attr:`&redef`
@@ -109,7 +122,7 @@ Runtime Options
109122
See :zeek:type:`Host` for possible choices.
110123

111124
.. zeek:id:: Known::service_udp_requires_response
112-
:source-code: policy/protocols/conn/known-services.zeek 43 43
125+
:source-code: policy/protocols/conn/known-services.zeek 52 52
113126

114127
:Type: :zeek:type:`bool`
115128
:Attributes: :zeek:attr:`&redef`
@@ -119,27 +132,72 @@ Runtime Options
119132

120133
Redefinable Options
121134
###################
135+
.. zeek:id:: Known::service_store_backend_options
136+
:source-code: policy/protocols/conn/known-services.zeek 93 93
137+
138+
:Type: :zeek:type:`Storage::BackendOptions`
139+
:Attributes: :zeek:attr:`&redef`
140+
:Default:
141+
142+
::
143+
144+
{
145+
serializer=Storage::STORAGE_SERIALIZER_JSON
146+
redis=<uninitialized>
147+
sqlite=[database_path=":memory:", table_name="zeek/known/services", busy_timeout=5.0 secs, pragma_commands={
148+
["integrity_check"] = "",
149+
["journal_mode"] = "WAL",
150+
["synchronous"] = "normal",
151+
["temp_store"] = "memory"
152+
}, pragma_timeout=500.0 msecs, pragma_wait_on_busy=5.0 msecs]
153+
}
154+
155+
156+
The options for the service store. This should be redef'd in local.zeek to set
157+
connection information for the backend. The options default to a memory store.
158+
159+
.. zeek:id:: Known::service_store_backend_type
160+
:source-code: policy/protocols/conn/known-services.zeek 89 89
161+
162+
:Type: :zeek:type:`Storage::Backend`
163+
:Attributes: :zeek:attr:`&redef`
164+
:Default: ``Storage::STORAGE_BACKEND_SQLITE``
165+
166+
The type of storage backend to open.
167+
122168
.. zeek:id:: Known::service_store_expiry
123-
:source-code: policy/protocols/conn/known-services.zeek 65 65
169+
:source-code: policy/protocols/conn/known-services.zeek 99 99
124170

125171
:Type: :zeek:type:`interval`
126172
:Attributes: :zeek:attr:`&redef`
127173
:Default: ``1.0 day``
128174

129-
The expiry interval of new entries in :zeek:see:`Known::service_store`.
130-
This also changes the interval at which services get logged.
175+
The expiry interval of new entries in :zeek:see:`Known::service_broker_store`
176+
and :zeek:see:`Known::service_store_backend`. This also changes the interval
177+
at which services get logged.
131178

132179
.. zeek:id:: Known::service_store_name
133-
:source-code: policy/protocols/conn/known-services.zeek 61 61
180+
:source-code: policy/protocols/conn/known-services.zeek 72 72
134181

135182
:Type: :zeek:type:`string`
136183
:Attributes: :zeek:attr:`&redef`
137184
:Default: ``"zeek/known/services"``
138185

139-
The Broker topic name to use for :zeek:see:`Known::service_store`.
186+
The Broker topic name to use for :zeek:see:`Known::service_broker_store`.
187+
188+
.. zeek:id:: Known::service_store_prefix
189+
:source-code: policy/protocols/conn/known-services.zeek 86 86
190+
191+
:Type: :zeek:type:`string`
192+
:Attributes: :zeek:attr:`&redef`
193+
:Default: ``"zeekknownservices"``
194+
195+
The name to use for :zeek:see:`Known::service_store_backend`. This will be used
196+
by the backends to differentiate tables/keys. This should be alphanumeric so
197+
that it can be used as the table name for the storage framework.
140198

141199
.. zeek:id:: Known::use_service_store
142-
:source-code: policy/protocols/conn/known-services.zeek 40 40
200+
:source-code: policy/protocols/conn/known-services.zeek 44 44
143201

144202
:Type: :zeek:type:`bool`
145203
:Attributes: :zeek:attr:`&redef`
@@ -150,10 +208,21 @@ Redefinable Options
150208
with keys uniformly distributed over proxy nodes in cluster
151209
operation.
152210

211+
.. zeek:id:: Known::use_storage_framework
212+
:source-code: policy/protocols/conn/known-services.zeek 49 49
213+
214+
:Type: :zeek:type:`bool`
215+
:Attributes: :zeek:attr:`&redef`
216+
:Default: ``F``
217+
218+
Switches to the version of this script that uses the storage
219+
framework instead of Broker stores. This will default to ``T``
220+
in v8.1.
221+
153222
State Variables
154223
###############
155-
.. zeek:id:: Known::service_store
156-
:source-code: policy/protocols/conn/known-services.zeek 58 58
224+
.. zeek:id:: Known::service_broker_store
225+
:source-code: policy/protocols/conn/known-services.zeek 69 69
157226

158227
:Type: :zeek:type:`Cluster::StoreInfo`
159228
:Default:
@@ -173,12 +242,24 @@ State Variables
173242
}
174243

175244

245+
Storage configuration for Broker stores
176246
Holds the set of all known services. Keys in the store are
177247
:zeek:type:`Known::AddrPortServTriplet` and their associated value is
178248
always the boolean value of "true".
179249

250+
.. zeek:id:: Known::service_store_backend
251+
:source-code: policy/protocols/conn/known-services.zeek 81 81
252+
253+
:Type: :zeek:type:`opaque` of Storage::BackendHandle
254+
255+
Storage configuration for storage framework stores
256+
This requires setting a configuration in local.zeek that sets the
257+
Known::use_storage_framework boolean to T, and optionally sets different
258+
values in the Known::service_store_backend_options record.
259+
Backend to use for storing known services data using the storage framework.
260+
180261
.. zeek:id:: Known::services
181-
:source-code: policy/protocols/conn/known-services.zeek 79 79
262+
:source-code: policy/protocols/conn/known-services.zeek 114 114
182263

183264
:Type: :zeek:type:`table` [:zeek:type:`addr`, :zeek:type:`port`] of :zeek:type:`set` [:zeek:type:`string`]
184265
:Attributes: :zeek:attr:`&create_expire` = ``1.0 day``
@@ -196,7 +277,7 @@ State Variables
196277
Types
197278
#####
198279
.. zeek:type:: Known::AddrPortServTriplet
199-
:source-code: policy/protocols/conn/known-services.zeek 49 53
280+
:source-code: policy/protocols/conn/known-services.zeek 58 62
200281

201282
:Type: :zeek:type:`record`
202283

@@ -212,7 +293,7 @@ Types
212293
213294
214295
.. zeek:type:: Known::ServicesInfo
215-
:source-code: policy/protocols/conn/known-services.zeek 23 34
296+
:source-code: policy/protocols/conn/known-services.zeek 27 38
216297

217298
:Type: :zeek:type:`record`
218299

@@ -248,7 +329,7 @@ Types
248329
Events
249330
######
250331
.. zeek:id:: Known::log_known_services
251-
:source-code: policy/protocols/conn/known-services.zeek 83 83
332+
:source-code: policy/protocols/conn/known-services.zeek 118 118
252333

253334
:Type: :zeek:type:`event` (rec: :zeek:type:`Known::ServicesInfo`)
254335

@@ -258,7 +339,7 @@ Events
258339
Hooks
259340
#####
260341
.. zeek:id:: Known::log_policy_services
261-
:source-code: policy/protocols/conn/known-services.zeek 19 19
342+
:source-code: policy/protocols/conn/known-services.zeek 23 23
262343

263344
:Type: :zeek:type:`Log::PolicyHook`
264345

0 commit comments

Comments
 (0)