Commit Graph

2661 Commits

Author SHA1 Message Date
Dirk Ziegelmeier 66b73ddd11 Profinet plugin: Dissect writing I&M1 and I&M2, too 2022-05-31 15:29:24 +00:00
Dirk Ziegelmeier 1438336c1d Profinet plugin: Decode more error codes
according to PN Protocol 2.4MU3 April 2022
2022-05-31 15:29:24 +00:00
Gerald Combs be929e162d epan: Allow conversations based on arbitrary element lists.
Add conversation_new_full and find_conversation_full, which take
arbitrary element lists instead of fixed addresses and ports.

Update the comments in conversation.h to be more Doxygen-conformant.
Update README.dissector.

Use the new functionality to add initial conversation support to the
Falco Bridge dissector.
2022-05-23 18:12:26 +00:00
Matthias Dietrich 7b53720999 Use proto_tree_add_item where possible 2022-05-21 07:52:07 +00:00
Matthias Dietrich cc4223f537 Add PA Profile 4.02 diagnostics codes 2022-05-21 07:52:07 +00:00
Matthias Dietrich 85eb9fba4d Dissect PA Profile IO data 2022-05-21 07:52:07 +00:00
Matthias Dietrich 225e90564d Resolve PA Profile 4.02 submodule names 2022-05-21 07:52:07 +00:00
Gerald Combs 6b07710188 Falco Bridge: API updates.
Update to the current (c02ae4b6) API.
2022-05-19 12:52:37 -07:00
Gerald Combs fd76c7ea80 Falco Bridge: Fix address field registration. 2022-05-19 11:16:56 -07:00
Gerald Combs f85d4a5763 Falco Bridge: Fix a couple of bugs.
Make sure a pointer is valid and only initialize our sinsp span once.
2022-05-03 19:29:51 -07:00
Gerald Combs 3336ec24ac Falco Bridge: Add typed address fields.
libsinsp currently only supports string and unsigned 64-bit integer
field types. For string fields that might contain a parseable address,
add ".v4" and ".v6" subtree items with a corresponding field type.

For example, the ct.srcip field now dissects as

Sysdig Event 1: 880 bytes
Falco Bridge
cloudtrail Plugin
    [ ... ]
    Source IP: 3.92.225.50
        [Source IP (IPv4): 3.92.225.50]
2022-04-29 12:13:34 -07:00
Gerald Combs 52db7e88bc Falco Bridge: Fix building on Windows.
Fix Falco plugin installation in multi-config environments. Fix FindSinsp
on Windows.  Ignore a couple of warnings for now.
2022-04-27 22:01:17 +00:00
Gerald Combs 0f695875ac Falco Bridge: Switch to the sinsp capabilities API.
falcosecurity/libs 448c380e switched from a plugin type to a more
generic capabilities enum.
2022-04-27 22:01:17 +00:00
Dirk Ziegelmeier c27d8bbedd Profinet plugin: Add severity according to PA Profile 4.02 2022-04-27 20:29:57 +00:00
Gerald Combs 2141f0f03b Falco Bridge: Update to match the current libsinsp API.
The extract_fields struct and calling convention changed, so update to
match. Extract all of our fields at once, which noticeably speeds up
dissection here.
2022-04-26 17:11:21 +00:00
Gerald Combs dbf3ac3701 CMake+Logwolf: Populate our Falco plugin directory.
Create plugins/<version>/falco and copy over the Cloudtrail plugin.
2022-04-25 12:07:48 -07:00
Vahap Emin Agaogullari 7e0d0eb418 PROFINET: TSN Dissection implemented
TSN Records for pn_io and
pn_dcp TSN Suboption dissected
2022-04-20 07:44:57 +00:00
Gerald Combs 87b0288b8d epan: Add the ability to add conversation filter protocols.
Convert our conversation protocols to a dynamic list and add
add_conversation_filter_protocol(). Use it in the Falco Bridge plugin to
add protocols with conversation filters.
2022-04-19 22:25:32 +00:00
Matthias Dietrich 86bc544fd3 PROFINET: Fix count of IO data objects and IOCS
Split the counts of IO data objects and IOCS between
input and output. Remove increment of IO data objects
in station information, sometimes leading to extremely
high and invalid number of IO data objects.
2022-04-16 13:57:16 +00:00
Matthias Dietrich dcffa0303a PROFINET: Split number of IOCS between in and out
Currently a single counter is used, but the number of
IOCS is not necessarily the same for input and output
CRs.
2022-04-16 13:57:16 +00:00
Gerald Combs 8528fca055 Falco Bridge: Misc cleanup.
Remove unused header definitions in packet-falco-bridge.h and move the
remaining content to packet-falco-bridge.c and conversation-macros.h.
Explicitly set our header files in CMakeLists.txt.
2022-04-13 13:51:06 -07:00
Gerald Combs 57172fe4cd CMake: Finish splitting ADD_PLUGIN_LIBRARY.
Rename add_plugin_library to add_wireshark_plugin_library and add a
backward compatibility wrapper. Make Falco Bridge a Logwolf plugin.
2022-04-04 23:10:57 +00:00
Gerald Combs 23ed784ce1 Falco Bridge: Fix a function declaration.
Fix

../plugins/epan/falco_bridge/packet-falco-bridge.c: In function ‘register_conversation_filters_mappings’:
../plugins/epan/falco_bridge/packet-falco-bridge.c:105:1: error: old-style function definition [-Werror=old-style-definition]
 register_conversation_filters_mappings()
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-04-04 21:21:10 +00:00
Matthias Dietrich ea39653c8d PROFINET: Support PROFIsafe 5 byte safety trailer
Calculate the safety IO data length based on the
safety trailer length, which is given by the
F-Parameter F_CRC_Seed.
2022-04-03 18:49:20 +00:00
Vahap Emin Agaogullari 7f2e996193 PROFINET: TimeAware Dissection and RSI FREQ block fix
TimeAware bit dissected for ARProperties
and cyclic frames updated accordingly.
Also small length problem fixed in RSI FREQ block dissection.
2022-03-24 18:06:06 +00:00
Gerald Combs 0a351fb6ba Falco Bridge: Update the README.
Update the Licensing section of the README.
2022-03-22 17:51:32 +00:00
Gerald Combs e06864e777 Falco Bridge: Miscellaneous fixes.
Fix some issues found by the pre-commit script. Add a missing Debian
symbol. Update the README.
2022-03-22 17:51:32 +00:00
Gerald Combs 34cb45c743 Falco Bridge: Remove some unused code. 2022-03-22 17:51:32 +00:00
Gerald Combs 110dbffbe9 Rename Sysdig Bridge to Falco Bridge.
The Sysdig Bridge plugin loads Falco plugins, so rename it to Falco
Bridge.

Make it optional and dependent on libsinsp+libscap, similar to our codec
plugins.

Remove some unused code.
2022-03-22 17:51:32 +00:00
Gerald Combs be03aa1a4d CMake+Sysdig Bridge: Add a FindSinsp module.
Add a FindSinsp CMake module, and use it in the Sysdig Bridge plugin
CMakeLists.txt. It still needs work, but should at least be usable on
more machines.

Conflicts:
	plugins/epan/sysdig_bridge/CMakeLists.txt
2022-03-22 17:51:32 +00:00
Gerald Combs 90bd33e4e2 Sysdig Bridge: Make sure we fetch the correct field info.
Fetch the current field number's type and format instead of the first
field's.
2022-03-22 17:51:32 +00:00
Gerald Combs b9946577d6 Sysdig Bridge: Remove old code.
Remove commented & ifdef0'd code that loaded plugins directly. Destroy
our libsinsp instance on exit.
2022-03-22 17:51:32 +00:00
Gerald Combs 349c067414 Sysdig Bridge: Handle info and conversation fields.
Fix our field length display as well.
2022-03-22 17:51:32 +00:00
Gerald Combs bee0393a94 Sysdig Bridge: Switch to libsinsp/libscap.
Switch from loading the cloudtrail plugin directly to doing so
indirectly via libsinsp. This should let us start leveraging the rich
functionality offered by libsinsp.
2022-03-22 17:51:32 +00:00
Gerald Combs 9b106b500c Sysdig Bridge: Update the Sysdig Plugin fields.
Update the Sysdig Plugin fields to match falcosecurity/libs scap.c.
2022-03-22 17:51:32 +00:00
Gerald Combs a075ce1be7 Sysdig bridge: Update a struct.
Update ss_plugin_extract_field to match

https://github.com/falcosecurity/plugin-sdk-go/blob/main/pkg/sdk/plugin_info.h
2022-03-22 17:51:32 +00:00
Gerald Combs 24aa07281a Sysdig bridge: Fix a couple of offsets.
It looks like the source ID and event data are 4 bytes further into each
block. Quick fix pending more details about the block format.
2022-03-22 17:51:32 +00:00
Gerald Combs 9a889e9546 Sysdig bridge: Set our plugin API version to 0.2.0. 2022-03-22 17:51:32 +00:00
Gerald Combs 70aed62c86 Sysdig bridge: Fix compilation.
Fix

logshark/plugins/epan/sysdig_bridge/packet-sysdig-bridge.c:86:39: error: this old-style function definition is not preceded by a prototype [-Werror,-Wstrict-prototypes]
register_conversation_filters_mappings()
                                      ^
1 error generated.
2022-03-22 17:51:32 +00:00
Mark Stemm 58e3976910 Use the plugin name as the protocol short name
Prior versions had a dedicated plugin API function for this, but we
removed it from the plugin API, so just use the plugin name.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-03-22 17:51:32 +00:00
Loris Degioanni 0555c413d1 Sysdig Bridge: Fix a memory allocation crash.
avoid moving plugin states around the address space by mallocing all of the memory at the beginning instead of using realloc every time a plugin is detected. This prevents crashes and other types of bad behavior that were caused by plugins accessing garbage memory.
2022-03-22 17:51:32 +00:00
Mark Stemm 39c8e1ac2c Use register_shutdown_routine, not cleanup_routine
register_cleanup_routine is called after reading a single capture
file. Since the async extraction is set up per plugin instead of
per-instance, we want register_shutdown_routine().

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2022-03-22 17:51:32 +00:00
Mark Stemm 5fdc4142b9 Update to use single extract_fields func
Update to reflect newest API changes (single extract_fields
func). This simplifies dissect_plg_bridge a bit, as the setup/calling
plugin function can mostly be unified based on the field type, with
just looking at the res_str/res_u64 part of the field struct
afterward.
2022-03-22 17:51:32 +00:00
Mark Stemm c34693bb20 Update to reflect latest plugins api changes
Although not used by wireshark directly, update
plugin_next/plugin_next_batch to note they return structs for events
instead of pointers + lens + timestamps.

Extract functions now use field names, so no need to extract or keep
track of field ids. The a "abbrev" property of header_field_info
contains the field name e.g. ct.xxx.
2022-03-22 17:51:32 +00:00
Loris Degioanni 8c3f436cc0 load the plugins from the wireshark directory 2022-03-22 17:51:32 +00:00
Loris Degioanni d226a7aa98 separate list of conversation filters for logshark
Conflicts:
	CMakeLists.txt
2022-03-22 17:51:32 +00:00
Loris Degioanni 2d6b0e8885 conversation-like filtering and coloring for sysdig plugins 2022-03-22 17:51:32 +00:00
Loris Degioanni de5f59d7a4 sysdig: initial implementation of sysdig plugins support
This commit introduces a new wireshark plugin which is able to act as proxy to sysdig plugins, loading them into Wireshark and transforming their output into dissectors that Wireshark can use to display the data.
2022-03-22 17:51:32 +00:00
Loris Degioanni 625a042ff8 initial skeleton for sysdig plugins experiments 2022-03-22 17:51:32 +00:00
Dirk Ziegelmeier dc5cb69409 Profinet plugin: Decode more r/w indexes 2022-02-11 20:16:07 +00:00