Apps break on hosts where Splunk is configured to listen on IPv6 management port
まだ誰も着手していません。
評価
調査の方向性
Start in solnlib/splunkenv.py around get_splunkd_access_info(), especially the parsing of mgmtHostPort returned by get_conf_key_value(). Reproduce the failure with an IPv6 value such as [::]:8089 and verify that the management port is parsed correctly without breaking existing host:port values. The issue does not mention a specific test file, so add or locate coverage for these configurations before confirming the fix.
索引モデルが issue の本文から書いたものです。
説明
For apps which invoke the get_splunkd_access_info() function from splunkenv.py, errors are thrown when a host is configured to listen using IPv6 on the Splunk MGMT port.
This function uses get_conf_key_value() to read the value of mgmtHostPort from web.conf, and splits it based on the : delimiter in order to work out the value being used for the MGMT port on the current instance:
This obviously breaks when encountering IPv6 addresses, which use : as a delimiter as part of the address. This also breaks when deploying a Splunk-recommended configuration to listen on IPv6 as well as v4, which looks like this:
mgmtHostPort = [::]:8089
This type of construct is interestingly not included in the spec file for web.conf but in the spec file for server.conf, which states:
You might need to change the mgmtHostPort setting in the web.conf file. Use '[::1]' instead of '127.0.0.1'.
I'm not quite sure what the best way of fixing this is. It seems like using : as a delimiter should still be possible, but the function should take care to ensure that where multiple : delimiters are present, the rightmost value is taken as the integer used for the port value.
An example error from a Splunkbase app breaking because of this bug:
12-11-2023 17:07:25.671 +0000 ERROR AdminManagerExternal [109547 TcpChannelThread] - Stack trace from python handler:\nTraceback (most recent call last):\n File "/opt/splunk/lib/python3.7/site-packages/splunk/admin.py", line 108, in init_persistent\n hand = handler(mode, ctxInfo, data)\n File "/opt/splunk/etc/apps/TA-sandfly-security/bin/ta_sandfly_security/aob_py3/splunktaucclib/rest_handler/admin_external.py", line 95, in __init__\n get_splunkd_endpoint(),\n File "/opt/splunk/etc/apps/TA-sandfly-security/bin/ta_sandfly_security/aob_py3/splunktaucclib/rest_handler/admin_external.py", line 77, in get_splunkd_endpoint\n splunkd_uri = get_splunkd_uri()\n File "/opt/splunk/etc/apps/TA-sandfly-security/bin/ta_sandfly_security/aob_py3/solnlib/splunkenv.py", line 208, in get_splunkd_uri\n scheme, host, port = get_splunkd_access_info()\n File "/opt/splunk/etc/apps/TA-sandfly-security/bin/ta_sandfly_security/aob_py3/solnlib/splunkenv.py", line 188, in get_splunkd_access_info\n port = int(host_port.split(":")[1])\nValueError: invalid literal for int() with base 10: ''\n
- 主要言語
- Python
- スター
- 18
- フォーク
- 10
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
splunk/addonfactory-solutions-library-python のほかの issue
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
splunk/addonfactory-solutions-library-python#420 · コメント 4 件 · 担当者 1 名 ·
-
bug
splunk/addonfactory-solutions-library-python#311 · コメント 2 件 · 担当者 1 名 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
splunk/addonfactory-solutions-library-python の issue をすべて見る
似ている issue
-
documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
simonw/sqlite-utils#872 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100