
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NISTβs handling of the National Vulnerability Database.
github.com/EdgeX-Camera-Management/device-onvif-camera
This Onvif Camera Device Service is developed to control/communicate ONVIF-compliant cameras accessible via http in an EdgeX deployment
The device service supports the onvif features listed in the following table:
Note: The functions in the bold text are mandatory for Onvif protocol.
The device service also include custom function to enhance the usage for the EdgeX user.
Feature | Service | Function | EdgeX Value Type | Description |
---|---|---|---|---|
System Function | EdgeX | RebootNeeded | Bool | Read only. Used to indicate the camera should reboot to apply the configuration change |
System Function | EdgeX | CameraEvent | Bool | A device resource which is used to send the async event to north bound |
System Function | EdgeX | SubscribeCameraEvent | Bool | Create a subscription to subscribe the event from the camera |
System Function | EdgeX | UnsubscribeCameraEvent | Bool | Unsubscribe all subscription from the camera |
Media | EdgeX | GetSnapshot | Binary | Get Snapshot from the snapshot uri |
The Onvif camera uses Web Services standards such as XML, SOAP 1.2 and WSDL1.1 over an IP network.
The spec can refer to ONVIF-Core-Specification.
For example, we can send a SOAP request to the Onvif camera as below:
curl --request POST 'http://192.168.12.128:2020/onvif/service' \
--header 'Content-Type: application/soap+xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope" xmlns:soap-enc="http://www.w3.org/2003/05/soap-encoding" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:onvif="http://www.onvif.org/ver10/schema" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" >
<soap-env:Header>
<Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<UsernameToken>
<Username>myUsername</Username>
<Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">+HKcvc+LCGClVwuros1sJuXepQY=</Password>
<Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">w490bn6rlib33d5rb8t6ulnqlmz9h43m</Nonce>
<Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2021-10-21T03:43:21.02075Z</Created>
</UsernameToken>
</Security>
</soap-env:Header>
<soap-env:Body>
<trt:GetStreamUri>
<trt:ProfileToken>profile_1</trt:ProfileToken>
</trt:GetStreamUri>
</soap-env:Body>
</soap-env:Envelope>'
And the response should be like the following XML data:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2"
xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics"
xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl"
xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl"
xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl">
<SOAP-ENV:Header></SOAP-ENV:Header>
<SOAP-ENV:Body>
<trt:GetStreamUriResponse>
<trt:MediaUri>
<tt:Uri>rtsp://192.168.12.128:554/stream1</tt:Uri>
<tt:InvalidAfterConnect>false</tt:InvalidAfterConnect>
<tt:InvalidAfterReboot>false</tt:InvalidAfterReboot>
<tt:Timeout>PT0H0M2S</tt:Timeout>
</trt:MediaUri>
</trt:GetStreamUriResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Since the SOAP is a HTTP call, the device service can just do the transformation between REST(JSON) and SOAP(XML).
For the concept of implementation:
- Onvif Web Service
- Onvif Function ββββββββββββββββββββββ
β β
ββββββββββββββββ - Input Parameter β Device Service β βββββββββββββββββββ
β β β β β β
β β REST request β β SOAP request β β
β Client βββΌβββββββββββββββββββββΌβββΊ Transform βββββΌββββββββββββββββΌβββΊ Onvif Camera β
β β β to SOAP request β β β
β β β β β β
ββββββββββββββββ ββββββββββββββββββββββ βββββββββββββββββββ
ββββββββββββββββββββββ
β β
ββββββββββββββββ β Device Service β βββββββββββββββββββ
β β β β β β
β β REST response β β SOAP response β β
β Client βββΌβββββββββββββββββββββΌβββ Transform ββββΌββββββββββββββββΌββ Onvif Camera β
β β β to REST response β β β
β β β β β β
ββββββββββββββββ ββββββββββββββββββββββ βββββββββββββββββββ
make test
make build
Build docker image named edgex/device-onvif-camera:0.0.0-dev with the following command:
make docker
The device resource should provide two attributes:
For example:
deviceResources:
- name: "Hostname"
isHidden: false
description: "Camera Hostname"
attributes:
service: "Device"
getFunction: "GetHostname"
setFunction: "SetHostname"
properties:
valueType: "Object"
readWrite: "RW"
See the sample at cmd/res/profiles/camera.yaml
The device's protocol properties should contain:
For example:
[[DeviceList]]
Name = "Camera001"
ProfileName = "camera"
Description = "My test camera"
[DeviceList.Protocols]
[DeviceList.Protocols.Onvif]
Address = "192.168.12.123"
Port = 80
# Assign AuthMode to "digest" | "usernametoken" | "both" | "none"
AuthMode = "usernametoken"
SecretPath = "credentials001"
See the sample at cmd/res/devices/camera.toml.example
Tested Onvif cameras with Onvif functions.
Setup Onvif User Authentication
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NISTβs handling of the National Vulnerability Database.
Research
Security News
Socketβs Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.