iedata
provides querying information about a Siemens Industrial Edge (virtual)
device from an app inside the IE(v)D.
Note
This package is "CGO-free" as it leverages the
modernc.org/sqlite sqlite3 driver
module. When using the ieddata
module, please make sure that your main
module's go.mod
(indirectly) requires the modernc/libc
module in the
same version as required by modernc.org/sqlite
's
go.mod
.
ieddata
is part of the "Edgeshark" project that consist of several
repositories:
- Edgeshark Hub repository
- G(h)ostwire discovery service
- Packetflix packet streaming service
- Containershark Extcap plugin for Wireshark
- support modules:
- turtlefinder
- csharg (CLI)
- mobydig
- 🖝 ieddata 🖜
The following example queries a Siemens Industrial Edge (virtual) device's...
- ...device name and its owner,
- ...and the list of installed applications.
Error handling has been left out for brevity.
db, _ := ieddata.Open("platformbox.db")
defer db.Close()
di, _ := db.DeviceInfo()
fmt.Printf("device name: %s\nowner name: %s\n", di["deviceName"], di["ownerName"])
apps, _ := db.Apps()
slices.SortFunc(apps, func(a, b ieddata.App) int { return strings.Compare(a.Title, b.Title) })
for _, app := range apps {
fmt.Printf("app: %q %s\n", app.Title, app.Id)
}
Nota bene: we first copy the IED's
platformbox.db
in a temporary location and the open only the copy.
Caution
Do not use VSCode's "Dev Containers: Clone Repository in Container
Volume" command, as it is utterly broken by design, ignoring
.devcontainer/devcontainer.json
.
git clone https://github.com/siemens/ieddata
- in VSCode: Ctrl+Shift+P, "Dev Containers: Open Workspace in Container..."
- select
ieddata.code-workspace
and off you go...
morbyd
supports versions of Go that are noted by the Go release
policy, that is, major
versions N and N-1 (where N is the current major version).
Please note that an application using this Go module needs to have capability
CAP_SYS_PTRACE
requested in its composer file, as well as your binary needs to
be executed with CAP_SYS_PTRACE
also effective, not just permitted. If you
run your binary under a non-UID0 user, then you need to assign file capabilities
to your binary (see also
setcap(8)).
Additionally, you need to deploy any container that leverages this Go module
with pid:host
in order to access the file system view (mount namespaces) of
other containers.
Please see CONTRIBUTING.md.
(c) Siemens AG 2023