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

Autorisierung V3 Password? #409

Open
FraatTailscale opened this issue Feb 23, 2024 · 20 comments
Open

Autorisierung V3 Password? #409

FraatTailscale opened this issue Feb 23, 2024 · 20 comments

Comments

@FraatTailscale
Copy link

Describe the bug
ich möchte SNMP3 mit Raspberrymatic benutzen, es unterstützt SNMP3 mit Username & Password, im SNMP tester von PRTG & PRTG funktioniert es aus. Leider finde ich im SNMP Iobroker Adapter unter V3 keine Möglichkeit ein Password einzugeben.
Wo kann ich im Iobroker SNMP Adapter das Password eingeben?

2024-02-23_18h05_58

2024-02-23_17h56_44

@mcm1957
Copy link
Member

mcm1957 commented Feb 23, 2024

Denke du suchts das Feld Autorisierungsschlüssel.

https://github.com/iobroker-community-adapters/ioBroker.snmp/blob/master/docs/de/snmp.md#tab-autorisierung

Sorry bin nur am Handy - hoff die Kurzantwort hilft

@FraatTailscale
Copy link
Author

Hallo, danke für die schnelle Antwort, leider kommt immer unknown UserName.

2024-02-24_06h54_17

@mcm1957
Copy link
Member

mcm1957 commented Feb 24, 2024

Hmmm !?!?
Kannst du ev. mal die Transportverschlüsselung ausschalten ODER einen Verschlüsselungskey vergeben? Transportverschlüsselung ohne expliziten Key ist mir noch nicht untergekommen und hab ich auch sicher nicht getestet. Kann sein, dass da was vom Protokoll her OK wäre aber nicht richtig implementiert ist.

@mcm1957
Copy link
Member

mcm1957 commented Feb 24, 2024

Am DEVICES / GERÄTE Tab prüf bitte noch of die Authorisierungsgruppe richtig eingetragen ist. Da müßte bei dir ccu stehen.

image

@FraatTailscale
Copy link
Author

hallo,
ich habe viel getestet. Mit V2 mit anderen Geräten (Unify Network) funktioniert der SNMP Adapter nur mit V3 scheint es nicht zu funktionieren.

Unter V3 , was nur bei RaspberryMatic unterstützt wird, müssen Beide
-A PASSPHRASE set authentication protocol pass phrase
-X PASSPHRASE set privacy protocol pass phrase
Password von Raspberrymatic User bekommen. Das funtioniert auch mit snmpget & snmpwalk ohne Probleme.

root@homematic:~# snmpget -v3 -l authPriv -u admin -a SHA -A "Password" -x AES -X "Password" 10.xx.xx.xx .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux homematic 6.1.73 #1 SMP PREEMPT Tue Jan 30 07:25:50 UTC 2024 aarch64

Ich habe dann auch im Iobroker unter Autorisierungsschlüssel & Transportverschlüsselung das PW eingegeben was nicht geholfen hat. Im Protokol kommt auch immer "Unknown User Name"
snmp.0 | 2024-02-25 17:11:10.464 | debug | [ccu] session.get: ResponseInvalidError: Unknown User Name

und nicht wie bei falschem Password im snmpget: Authentication failure (incorrect password, community or key).

Kann es sein das der UserName nicht übergeben wird?

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Danke mal fürs Feedback
snmp V3 funktioniert bei mir mit synology einwandfrei.

In deinem Bild oben scheint der Verschlüsselungsschlüssel (Feld ganz rechts im ioBroker) sowohl in der ioB UI als auch in deinem snmp Tool (?) leer zu sein, Du schreibst aber, dass du ihn eingegeben hast.

Glaub zwar nicht dass das hier relevant ist, aber kannst du mal das Authorisierungs- und das Verschlüsselungspasswort auf was triviales ohne Sonderzeichen setzen. Nicht dass da ein #$ etc. stört. Nur mal als Versuch.

Zusätzlich kannst du bitte mal den Adapter mit Debug Logging starten. Ev. sieht man da mehr. (Check nur dass im Log kein geheimes Passwort drinnen steht)

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Bitte prüfe auch was RespberryMatic unter sha und aes versteht.
Der Adapter hat folgendes implementiert (genauer gesagt er benutz node snmp)
sha - for HMAC-SHA-1 message authentication
aes - for 128-bit AES encryption (CFB-AES-128)

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

@jens-maus
Seh ich das richtig, dass du bei RaspberryMatic ein wenig involviert bist?
Siehst du auf der RaspeberryMatic Seite irgendeine Diagnosemöglichkeit was da rüber kommt?

@jens-maus
Copy link

@jens-maus Seh ich das richtig, dass du bei RaspberryMatic ein wenig involviert bist?

Ein "wenig", ja ;-)

Siehst du auf der RaspeberryMatic Seite irgendeine Diagnosemöglichkeit was da rüber kommt?

Nun, der SNMP Server der bei RaspberryMatic eingesetzt wird ist net-snmpd. D.h. dort kann man sämtliches debugging nutzen wie unter einem normalen Linux. Muss man sich dort halt mal anschauen und ggf. das startskript dann entsprechend um die debug meldungen erweitern.

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

@jens-maus
Danke mal f.d Info

@FraatTailscale
Copy link
Author

Hallo, danke für das helfen!
Ich habe den Unsernamen und Password jetzt zum Testen ohne Sonderzeichen.

root@homematic:~# snmpwalk -v3 -On -l authPriv -u snmpuser -a SHA -A "FOOblaFOObla" -x AES -X "FOOblaFOObla" 10.xx.xx.xx .1.3.6.1.2.1.25.1
.1.3.6.1.2.1.25.1.1.0 = Timeticks: (62535707) 7 days, 5:42:37.07
.1.3.6.1.2.1.25.1.2.0 = STRING: 2024-2-25,18:31:34.0,+1:0
.1.3.6.1.2.1.25.1.3.0 = INTEGER: 393216
.1.3.6.1.2.1.25.1.5.0 = Gauge32: 1
.1.3.6.1.2.1.25.1.6.0 = Gauge32: 140
.1.3.6.1.2.1.25.1.7.0 = INTEGER: 0

Habe den debug mode eingeschaltet:

snmp.0 | 2024-02-25 18:34:54.680 | debug | [ccu] processing oid chunk index 0 completed
snmp.0 | 2024-02-25 18:34:54.632 | debug | setStates - ccu.system_uptime
snmp.0 | 2024-02-25 18:34:54.632 | debug | [ccu] session.get: ResponseInvalidError: Unknown User Name
snmp.0 | 2024-02-25 18:34:54.632 | debug | [ccu] session.get completed for chunk index 0
snmp.0 | 2024-02-25 18:34:54.630 | debug | readChunkOIDs - device "ccu" (10..xx.xx.xx), chunk idx 0
snmp.0 | 2024-02-25 18:34:54.630 | debug | [ccu] processing oid chunk index 0
snmp.0 | 2024-02-25 18:34:54.630 | debug | readOIDs - device "ccu" (10.xx.xx.xx)
snmp.0 | 2024-02-25 18:34:54.578 | debug | handleConnectionInfo

2024-02-25_18h48_53

Test snmpwalk falcher UserName:
root@homematic:~# snmpwalk -v3 -On -l authPriv -u snmpuserfalsch -a SHA -A "FOOblaFOObla" -x AES -X "FOOblaFOObla" 10.xx.xx.xx.1.3.6.1.2.1.25.1
snmpwalk: Unknown user name

Test snmpwalk falches Authentication :
root@homematic:~# snmpwalk -v3 -On -l authPriv -u snmpuser -a SHA -A "falschfalsch" -x AES -X "FOOblaFOObla" 10.xx.xx.xx .1.3.6.1.2.1.25.1
snmpwalk: Authentication failure (incorrect password, community or key)

Test snmpwalk falches Encryption,:
root@homematic:~# snmpwalk -v3 -On -l authPriv -u snmpuser -a SHA -A "FOOblaFOObla" -x AES -X "falschfalsch" 10.12.14.36 .1.3.6.1.2.1.25.1
Timeout: No Response from 10.xx.xx.xx

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

OK, thanks for excessive testing.
I'll try to reproduce; eventually installing a raspberrymatic.

At the moment I do not have any more idea whats going wrong.

mcm1957

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Just for evidence:
Please add the releases installed at your system - not really prior, but for (later) eveidence.

adapter
admin
js-controller
node
o/s

@mcm1957 mcm1957 self-assigned this Feb 25, 2024
@mcm1957 mcm1957 added the bug label Feb 25, 2024
@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Hmmm ...

Hab das eben mit 3.0.1 nochmals getestet:
snmp.10 | 2024-02-25 19:17:24.193 | debug | [10_17_2_6] processing oid chunk index 0
snmp.10 | 2024-02-25 19:17:24.193 | debug | readOIDs - device "10_17_2_6" (10.17.2.6)
snmp.10 | 2024-02-25 19:17:24.192 | debug | session for device "10_17_2_6" (10.17.2.6) created
snmp.10 | 2024-02-25 19:17:24.188 | debug | snmpCreateSession - device 10_17_2_6 (10.17.2.6)
snmp.10 | 2024-02-25 19:17:24.127 | debug | startup completed
snmp.10 | 2024-02-25 19:17:24.126 | debug | startconnection info updater
snmp.10 | 2024-02-25 19:17:24.124 | debug | createReaderSession - device 10_17_2_6 (10.17.2.6)
snmp.10 | 2024-02-25 19:17:24.123 | debug | starting reader threads

image

image

Also bei mir funktionierts - fast möcht ich sagen leider.

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Ok, Minierfolg:
Wenn ich einen falschen Usernamen eingebe, dann kommt die Fehlermeldung Unknown Username

Könntest du bitte nach sicherstellen, dass der Username auf raspberryMatic und im Adapter wirklich ident ist?
Und insbesondere dass weder Spaces vor noch nach dem Namen oder allfällig noicht sichtbare UTFxxx Zeichen wo drinnen sind?

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Und noch eine Bitte:
Könntest du schaun ob im System Objekt der Instanz der Username richtig abgespeichert ist?
![image](https://github.com/iobroker -community-adapters/ioBroker.snmp/assets/28575778/82baf888-b32d-4d37-a5fc-85c4a5398054)

Erreichbar im Expert mode via Objekte -> System -> Adapter -> snmp -> 0 (oder welche Instanz du hast)
Dort in der Zeile der Insanz auf den Belistift ganz rechts ("bearbeiten")

@FraatTailscale
Copy link
Author

Klar, keine blanks davor und dahinter.
"authSets": [
{
"authId": "ccu",
"authSecLvl": 3,
"authUser": "snmpuser",
"authAuthProto": 2,
"authAuthKey": "FOOblaFOObla",
"authEncProto": 2,
"authEncKey": "FOOblaFOObla"
}

und

root@homematic:~# snmpwalk -v3 -On -l authPriv -u snmpuser -a SHA -A "FOOblaFOObla" -x AES -X "FOOblaFOObla" 10.12.14.36 .1.3.6.1.2.1.25.1
.1.3.6.1.2.1.25.1.1.0 = Timeticks: (63068887) 7 days, 7:11:28.87

@FraatTailscale
Copy link
Author

Just for evidence:
Please add the releases installed at your system - not really prior, but for (later) eveidence.

sure, no issue, here my information:

adapter
admin 6.13.16
js-controller 5.0.17
node v20.11.0
o/s debian 12 on proxmox (8.1..4) lxc container

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Adapter ist 3.0.1 (aktuelle Version) nehme ich an ?

@mcm1957
Copy link
Member

mcm1957 commented Feb 25, 2024

Ansonsten muss ich im Moment passen.
Hab keine Idee was man jetzt noch konkret checken kann,

Ev. installier ich eine raspeberryMatic Testinstallation. Hab aber keine Ahnung wann ich dazu komme.
Meld mich wenn ich noch ne Idee hab.

Hast du noch andere Geräte die snmpV3 könnten um dagegen zu testen?

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

No branches or pull requests

3 participants