policy/protocols/ssl/known-certs.zeek
- Known
Log information about certificates while attempting to avoid duplicate logging.
- Namespace:
Known
- Imports:
base/files/x509, base/frameworks/cluster, base/frameworks/storage/async.zeek, base/frameworks/storage/sync.zeek, base/protocols/ssl, base/utils/directions-and-hosts.zeek, policy/frameworks/storage/backend/sqlite
Summary
Runtime Options
The expiry interval of new entries in |
|
The timeout interval to use for operations against
|
|
The certificates whose existence should be logged and tracked. |
Redefinable Options
|
The options for the cert store. |
The type of storage backend to open. |
|
The Broker topic name to use for |
|
The name to use for |
|
Use the storage framework to enable persistence of the stored certs between runs. |
|
Toggles between different implementations of this script. |
State Variables
Storage configuration for Broker stores Holds the set of all known certs. |
|
Storage configuration for storage framework stores This requires setting a configuration in local.zeek that sets the Known::enable_certs_persistence boolean to T, and optionally setting different values in the Known::cert_store_backend_options record. |
|
|
The set of all known certificates to store for preventing duplicate logging. |
Types
Redefinitions
Events
Event that can be handled to access the loggable record as it is sent on to the logging framework. |
Hooks
Detailed Interface
Runtime Options
- Known::cert_store_expiry
-
The expiry interval of new entries in
Known::cert_broker_storeandKnown::cert_store_backend. This also changes the interval at which certs get logged.
- Known::cert_store_timeout
-
The timeout interval to use for operations against
Known::cert_broker_storeandKnown::cert_store_backend.
- Known::cert_tracking
- Type:
- Attributes:
- Default:
LOCAL_HOSTS- Redefinition:
from policy/tuning/track-all-assets.zeek
=:``ALL_HOSTS``
The certificates whose existence should be logged and tracked. Choices are: LOCAL_HOSTS, REMOTE_HOSTS, ALL_HOSTS, NO_HOSTS.
Redefinable Options
- Known::cert_store_backend_options
- Type:
- Attributes:
- Default:
{ serializer=Storage::STORAGE_SERIALIZER_JSON forced_sync=F redis=<uninitialized> sqlite=[database_path="/known/certs.sqlite", table_name="zeekknowncerts", busy_timeout=5.0 secs, pragma_commands={ ["quick_check"] = "", ["journal_mode"] = "WAL", ["synchronous"] = "normal", ["temp_store"] = "memory" }, pragma_timeout=500.0 msecs, pragma_wait_on_busy=5.0 msecs] }
The options for the cert store. This should be redef’d in local.zeek to set connection information for the backend. The options default to a central persistent sqlite database.
- Known::cert_store_backend_type
- Type:
- Attributes:
- Default:
Storage::STORAGE_BACKEND_SQLITE
The type of storage backend to open.
- Known::cert_store_name
-
The Broker topic name to use for
Known::cert_broker_store.
- Known::cert_store_prefix
-
The name to use for
Known::cert_store_backend. This will be used by the backends to differentiate tables/keys. This should be alphanumeric so that it can be used as the table name for the storage framework.
- Known::enable_certs_persistence
-
Use the storage framework to enable persistence of the stored certs between runs.
- Known::use_cert_store
- Type:
- Attributes:
&redef&deprecated= “Remove in v9.1. Store support has been disabled by default since Zeek 6.0 due to performance issues and will be removed.”- Default:
F
Toggles between different implementations of this script. When true, use a Broker data store, else use a regular Zeek set with keys uniformly distributed over proxy nodes in cluster operation.
State Variables
- Known::cert_broker_store
- Type:
- Default:
{ name=<uninitialized> store=<uninitialized> master_node="" master=F backend=Broker::MEMORY options=[sqlite=[path="", synchronous=<uninitialized>, journal_mode=<uninitialized>, failure_mode=Broker::SQLITE_FAILURE_MODE_FAIL, integrity_check=F]] clone_resync_interval=10.0 secs clone_stale_interval=5.0 mins clone_mutation_buffer_interval=2.0 mins }
Storage configuration for Broker stores Holds the set of all known certs. Keys in the store are
Known::AddrPortServTripletand their associated value is always the boolean value of “true”.
- Known::cert_store_backend
- Type:
opaqueof Storage::BackendHandle
Storage configuration for storage framework stores This requires setting a configuration in local.zeek that sets the Known::enable_certs_persistence boolean to T, and optionally setting different values in the Known::cert_store_backend_options record. Backend to use for storing known certs data using the storage framework.
- Known::certs
- Type:
- Attributes:
&create_expire=1.0 day&redef- Default:
{}
The set of all known certificates to store for preventing duplicate logging. It can also be used from other scripts to inspect if a certificate has been seen in use. The string value in the set is for storing the DER formatted certificate’ SHA1 hash.
In cluster operation, this set is uniformly distributed across proxy nodes.
Types
Events
- Known::log_known_certs
- Type:
event(rec:Known::CertsInfo)
Event that can be handled to access the loggable record as it is sent on to the logging framework.