Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modbus/TCP Security #97

Merged
merged 19 commits into from
Dec 27, 2024
Merged

Modbus/TCP Security #97

merged 19 commits into from
Dec 27, 2024

Conversation

kevinherron
Copy link
Contributor

@kevinherron kevinherron commented Dec 27, 2024

Adds support for Modbus/TCP Security (Modbus over TLS).

See https://modbus.org/docs/MB-TCP-Security-v21_2018-07-24.pdf

@kevinherron kevinherron requested a review from Copilot December 27, 2024 15:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 11 out of 26 changed files in this pull request and generated 4 comments.

Files not reviewed (15)
  • modbus-tests/pom.xml: Language not supported
  • modbus-serial/src/main/java/com/digitalpetri/modbus/serial/server/SerialPortServerTransport.java: Evaluated as low risk
  • modbus/src/main/java/com/digitalpetri/modbus/server/ModbusRtuServer.java: Evaluated as low risk
  • modbus/src/main/java/com/digitalpetri/modbus/server/ModbusTcpServer.java: Evaluated as low risk
  • modbus/src/main/java/com/digitalpetri/modbus/server/ModbusTcpServerTransport.java: Evaluated as low risk
  • modbus/src/main/java/com/digitalpetri/modbus/server/ModbusRtuServerTransport.java: Evaluated as low risk
  • modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/server/NettyServerTransportConfig.java: Evaluated as low risk
  • modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/client/NettyClientTransportConfig.java: Evaluated as low risk
  • modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/server/NettyTcpServerTransport.java: Evaluated as low risk
  • modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/client/NettyTcpClientTransport.java: Evaluated as low risk
  • modbus-tests/src/test/java/com/digitalpetri/modbus/test/CertificateUtil.java: Evaluated as low risk
  • modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/server/NettyRtuServerTransport.java: Evaluated as low risk
  • modbus/src/main/java/com/digitalpetri/modbus/server/authz/AuthzHandler.java: Evaluated as low risk
  • modbus/src/main/java/com/digitalpetri/modbus/server/ModbusRequestContext.java: Evaluated as low risk
  • modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/client/NettyRtuClientTransport.java: Evaluated as low risk
Comments suppressed due to low confidence (2)

modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/server/NettyRequestContext.java:58

  • [nitpick] The magic number 4 used for stripping the leading tag and length bytes should be defined as a constant for better readability.
clientRole = new String(bs, 4, bs.length - 4);

modbus-tcp/src/main/java/com/digitalpetri/modbus/tcp/server/NettyRequestContext.java:46

  • Ensure that the clientRole extraction logic is covered by tests.
public Optional<String> clientRole() {

@kevinherron kevinherron marked this pull request as ready for review December 27, 2024 15:41
@kevinherron kevinherron added this to the 2.1.0 milestone Dec 27, 2024
@kevinherron kevinherron merged commit 27aa926 into master Dec 27, 2024
1 check passed
@kevinherron kevinherron deleted the modbus-security branch December 28, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant