-
Notifications
You must be signed in to change notification settings - Fork 45
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
JPO-ODE Hotfix for Security Headers #545
JPO-ODE Hotfix for Security Headers #545
Conversation
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/coder/stream/LogFileToAsn1CodecPublisher.java
Show resolved
Hide resolved
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/coder/stream/LogFileToAsn1CodecPublisher.java
Show resolved
Hide resolved
@@ -72,7 +65,7 @@ public ParserStatus parseFile(BufferedInputStream bis, String fileName) throws F | |||
status = parseStep(bis, getPayloadLength()); | |||
if (status != ParserStatus.COMPLETE) | |||
return status; | |||
setPayload(removeHeader(Arrays.copyOf(readBuffer, getPayloadLength()))); | |||
setPayload(stripDot3Header(Arrays.copyOf(readBuffer, getPayloadLength()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide some explanation of these requirements change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original implementation was the removeHeader function. This needed to remove all headers and only include the payload. We now want to maintain the 1609.2 header if it is a signed header so it will be written into Kafka before it goes to the ADM. We need to be able to record the original header UPER hex so we can utilize it. The signed security header does get removed before the ADM since the ADM doesn't truly support IEEE 1609.2 headers.
// construct odeData | ||
odeData = new OdeAsn1Data(metadata, payload); | ||
String payloadHexString = ((JSONObject)((JSONObject) rawMapJsonObject.get("payload")).get("data")).getString("bytes"); | ||
payloadHexString = super.stripDot2Header(payloadHexString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we combine the start flags data with this stripDot2Header() behavior into a separate series of classes that are dedicated to remove the Dot2header? Then set this inside Message JSON classes without modifying the message constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will add this to our backlog to get this to be more generic. We really are just wanting to get this functionality to be available so CDOT and WYDOT can both utilize this through DockerHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drewjj Please address the unit test failure reported by sonarscanner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This failure seems to only affect CI. We haven't been able to resolve Travis from failing. Any ideas? @dan-du-car This has been plaguing us since the last release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GM, Drew. Just discussed with Dan and Sai. We documented the issue here #546 for now and Sai can plan to address this issue with you/Tony in our next sprint in June. For now, we are good with merging the hotfix changes into master, which Dan has reviewed.
Thanks for the update. |
331a90f
into
usdot-jpo-ode:master
PR Details
Description
Adds support for stripping IEEE 1609.2 and 1609.3 headers for both log ingestion and UDP endpoints. The data pipeline workflow has been altered for the log ingestion to merge with the pipeline for the UDP endpoints. This allows the ASN1 to be maintained from both message endpoints within a Kafka topic and include any signed security headers if present.
These changes can be viewed via the updated dataflow diagrams.
Related Issue
N/A
Motivation and Context
This allows for more flexible support of messages with IEEE1609.2 and 1609.3 headers for both log ingestion and UDP forwarding. This pull request also allows for the maintaining of the ASN1 with headers for troubleshooting purposes.
How Has This Been Tested?
This has been tested through unit tests, local Docker deployment and GCP K8s.
Types of changes
Checklist:
ODE Contributing Guide