Skip to content

enip: convert to rust#11174

Closed
catenacyber wants to merge 1 commit into
OISF:masterfrom
catenacyber:enip-rust-3958-v18
Closed

enip: convert to rust#11174
catenacyber wants to merge 1 commit into
OISF:masterfrom
catenacyber:enip-rust-3958-v18

Conversation

@catenacyber
Copy link
Copy Markdown
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/3958

Describe changes:

  • convert enip parser to rust

Alon the way, also

  • transactions are now bidirectional
  • there is a enip logger
  • gap support is improved with probing for resync
  • frames
  • events
  • enip_command keyword accepts now string enumeration as values.
  • more keywords, to have parity with logging

#10901 with

  • rustfmt fix
  • rename to new naming style for FFI rust funcs(s/rs_enip_tx_get_service_name/SCEnipTxGetServiceName/)
  • probing parser returns UNKNOWN on NULL
  • New Pdu Frame
  • rename frames to standard Hdr and Data cf doc/userguide/devguide/extending/app-layer/app-layer-frames.rst
  • Add tx id to frames
  • Avoid tx flood from responses (as was done for requests)

SV_BRANCH=OISF/suricata-verify#1865

Ticket: 3958

- transactions are now bidirectional
- there is a logger
- gap support is improved with probing for resync
- frames support
- app-layer events
- enip_command keyword accepts now string enumeration as values.
- add enip.status keyword
- add keywords :
    enip.product_name, enip.protocol_version, enip.revision,
    enip.identity_status, enip.state, enip.serial, enip.product_code,
    enip.device_type, enip.vendor_id, enip.capabilities,
    enip.cip_attribute, enip.cip_class, enip.cip_instance,
    enip.cip_status, enip.cip_extendedstatus
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 35.63845% with 2243 lines in your changes are missing coverage. Please review.

Project coverage is 80.79%. Comparing base (e041187) to head (a0b1e7a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11174      +/-   ##
==========================================
- Coverage   84.28%   80.79%   -3.50%     
==========================================
  Files         926      945      +19     
  Lines      243303   245474    +2171     
==========================================
- Hits       205076   198334    -6742     
- Misses      38227    47140    +8913     
Flag Coverage Δ
fuzzcorpus 63.29% <34.82%> (-0.89%) ⬇️
livemode 19.50% <9.51%> (-0.17%) ⬇️
pcap 45.96% <8.88%> (-0.72%) ⬇️
suricata-verify ?
unittests 61.17% <11.13%> (-0.58%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Comment thread rust/src/enip/logger.rs
// These lists come from other open source programs like Wireshark, Zeek or scapy
fn enip_vendorid_string(p: u16) -> Option<&'static str> {
match p {
1 => Some("Rockwell Automation/Allen-Bradley"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's time for us to add a facility to load this kind of data from actual data files, instead of putting it in code. This would lead to cleaner code and it has as additional benefit that data files can be updated independently too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suricata-qa
Copy link
Copy Markdown

Information: QA ran without warnings.

Pipeline 20850

@catenacyber
Copy link
Copy Markdown
Contributor Author

Continued in #11184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants