web-dev-qa-db-ja.com

Prewikkaを初めてBionicに設定する方法は?

Prewikkaパッケージをインストールしようとしています。BionicのWebインターフェイスに基づいたセキュリティ情報およびイベント管理システムです。

Prewikkaパッケージのセットアップを開始すると、端末の指示に従い、確認が表示されます。

enter image description here

私はPrewikkaデータベースのパスワードの設定を提供しません。サイトで見つけようとします Docs ですが、問題を正確に見つけることができません。

dbconfig-common上のPrewikkaのパスワードを知るにはどうすればよいですか?原因として、以前の手順でdbconfig-commonデータベースをデフォルトとして選択したため、以下を参照してください。

enter image description here

#1を編集

Prewikkaの開発者は、Preludeについては、dbconfig-commonを使用し、管理者パスワードを与え、DBパスワードを入力することを選択しました。on this Docs for Prelude Managerへの統合を行うため、前の手順でdbconfig-commonを選択します。 Prelude開発者のすべてのドキュメントを読んでいるときに、Prewikka!のデータベースを作成するのを忘れていました。ああ、それは私の嘘です。そしてこの瞬間、私は理解できないエラーをいくつか受け取ります!しかし、PrewikkaのMySQLデータベースまたはPreludeのDBConfig-Commonの間でパスワードを入力する必要があるパスワードの確認で、まだ少し混乱していますか?

#2を編集

この時点で、私には理解できず、本当に複雑なエラーが発生します! Prewikkaのデフォルトポートを開くと、エラーが表示されます。

enter image description here

私の端末に表示されます:

$ Sudo prewikka-httpd
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 59, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 489, in __init__
    dh.apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 74, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 424, in apply
    self._apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in _apply
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in <listcomp>
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 87, in inner
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 221, in apply
    self.run()
  File "/usr/lib/python3/dist-packages/prewikka/sql/install.py", line 72, in run
    """)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 211, in query
    self.db.query(q)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 277, in process
    response = self._process_static(webreq) or self._process_dynamic(webreq)
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 244, in _process_dynamic
    self._prewikka_init_if_needed()
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 134, in _prewikka_init_if_needed
    raise self._prewikka_initialized
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 122, in _prewikka_init_if_needed
    env.db = database.Database(env.config.database)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 873, in __new__
    return MySQLDatabase(config)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 61, in inner
    raise DatabaseError(message=text_type(e))
prewikka.database.DatabaseError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/bin/prewikka-httpd", line 62, in application
    return wsgi.application(environ, start_response)
  File "/usr/lib/python3/dist-packages/prewikka/web/wsgi.py", line 161, in application
    core.process(WSGIRequest(environ, start_response))
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 280, in process
    response = err.respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 106, in respond
    return self._html_respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 90, in _html_respond
    from prewikka import baseview
  File "/usr/lib/python3/dist-packages/prewikka/baseview.py", line 27, in <module>
    from prewikka import error, history, hookmanager, resource, response, template, utils, view
  File "/usr/lib/python3/dist-packages/prewikka/history.py", line 102, in <module>
    crontab.schedule("search_history", N_("Search history deletion"), "0 * * * *", _regfunc=history._history_cron, enabled=True)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 240, in schedule
    self._init_system_job(ext_type, name, schedule, enabled, _regfunc)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 152, in _init_system_job
    res = env.db.query("SELECT 1 FROM Prewikka_Crontab WHERE ext_type=%s AND userid IS NULL", ext_type)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: Table 'prewikka.Prewikka_Crontab' doesn't exist
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 59, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 489, in __init__
    dh.apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 74, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 424, in apply
    self._apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in _apply
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in <listcomp>
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 87, in inner
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 221, in apply
    self.run()
  File "/usr/lib/python3/dist-packages/prewikka/sql/install.py", line 72, in run
    """)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 211, in query
    self.db.query(q)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 277, in process
    response = self._process_static(webreq) or self._process_dynamic(webreq)
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 244, in _process_dynamic
    self._prewikka_init_if_needed()
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 134, in _prewikka_init_if_needed
    raise self._prewikka_initialized
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 122, in _prewikka_init_if_needed
    env.db = database.Database(env.config.database)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 873, in __new__
    return MySQLDatabase(config)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 61, in inner
    raise DatabaseError(message=text_type(e))
prewikka.database.DatabaseError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/bin/prewikka-httpd", line 62, in application
    return wsgi.application(environ, start_response)
  File "/usr/lib/python3/dist-packages/prewikka/web/wsgi.py", line 161, in application
    core.process(WSGIRequest(environ, start_response))
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 280, in process
    response = err.respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 106, in respond
    return self._html_respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 90, in _html_respond
    from prewikka import baseview
  File "/usr/lib/python3/dist-packages/prewikka/baseview.py", line 27, in <module>
    from prewikka import error, history, hookmanager, resource, response, template, utils, view
  File "/usr/lib/python3/dist-packages/prewikka/history.py", line 102, in <module>
    crontab.schedule("search_history", N_("Search history deletion"), "0 * * * *", _regfunc=history._history_cron, enabled=True)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 240, in schedule
    self._init_system_job(ext_type, name, schedule, enabled, _regfunc)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 152, in _init_system_job
    res = env.db.query("SELECT 1 FROM Prewikka_Crontab WHERE ext_type=%s AND userid IS NULL", ext_type)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: Table 'prewikka.Prewikka_Crontab' doesn't exist

#3を編集

私はこれからフォローしようとしました issue と彼はフォローで解決しました:

  • Prewikkaデータベースを削除しました
  • Prewikkaデータベースを再作成しました
  • Prewikkaの実行を再試行します

しかし、それは私にはうまくいきません、私も言及したような指示を使用していますHowto: https://www.prelude-siem.org/projects/prelude/wiki/InstallingPackageUbunt。だから私は何か人が不足しているのですか?

誰もが私を助けることができると思います!、事前に感謝します。

最初のインストールPreludeおよびPrewikkaパッケージの場合:

  1. インストール前にアラートを保存するデータベースが必要です。MySQLでデータベースを作成することを選択しました

    $ mysql -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 8
    Server version: 8.0.13 MySQL Community Server - GPL    
    Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.    
    Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.    
    mysql>CREATE USER user1@localhost IDENTIFIED BY 'pass';
    Query OK, 1 row affected (0,11 sec)    
    mysql>CREATE DATABASE prelude;
    Query OK, 1 row affected (2,09 sec)    
    mysql> GRANT ALL PRIVILEGES ON prelude.* TO user1@localhost;
    Query OK, 0 rows affected (0,93 sec)    
    mysql>CREATE DATABASE prewikka;
    Query OK, 1 row affected (2,10 sec)    
    mysql> GRANT ALL PRIVILEGES ON prelude.* TO user1@localhost;
    Query OK, 0 rows affected (0,94 sec)    
    mysql>FLUSH PRIVILEGES;
    mysql>EXIT;  
    
  2. プレリュードとプレウィッカのインストールが必要です

    $ Sudo apt install prelude-utils prelude-manager prelude-lml libpreludedb*
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following additional packages will be installed:
      dbconfig-common libmaxminddb0 prelude-lml-rules
    Suggested packages:
      dbconfig-mysql | dbconfig-pgsql | dbconfig-sqlite | dbconfig-sqlite3 | dbconfig-no-thanks mmdb-bin
    Recommended packages:
      default-mysql-client | postgresql-client
    The following NEW packages will be installed:
      dbconfig-common libmaxminddb0 libpreludedb0 libpreludedb7 libpreludedbcpp2 libpreludedb-dev libpreludedb-doc libpreludedb7-mysql libpreludedb7-pgsql libpreludedb7-sqlite prelude-lml prelude-lml-rules
      prelude-manager
    0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
    Need to get 968 kB of archives.
    After this operation, 3.881 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    

    dpkgの設定中に、dbconfig-commonに保存されているユーザーデータベース、名前データベース、およびパスワードデータベースを作成します。私の場合のようにそれらを忘れた場合は、/etc/prewikka/prewikka.confファイルで確認できます。

  3. エージェント登録の設定。

    マネージャーエージェントとLMLクライアントエージェントは、Prelude adminのアナライザーログオンとしてコマンドパッケージを実行する必要があります。

    • マネージャーエージェントを次のように追加する最初のこと:

      $ prelude-admin add prelude-manager --uid 0 --gid 0 #for user id and group id, you can check on `/etc/passwd` file.
      Generating 2048 bits RSA private key... This might take a very long time.
      [Increasing system activity will speed-up the process].
      Generation in progress... 
      Created profile 'prelude-manager' with analyzerID 'xxxxxxxxxxxxxxxx'.  
      
    • LMLエージェントを次のように登録する2番目のこと:

      $ prelude-admin register prelude-lml "idmef:w admin:r" 127.0.0.1 --uid 0 --gid 0
      Generating 2048 bits RSA private key... This might take a very long time.
      [Increasing system activity will speed-up the process].
      Generation in progress...   
      You now need to start "prelude-admin" registration-server on 127.0.0.1:
      example: "prelude-admin registration-server prelude-manager"  
      Enter the one-shot password provided on 127.0.0.1: 
      Confirm the one-shot password provided on 127.0.0.1:  
      Connecting to registration server (127.0.0.1:5553)... Authentication succeeded.
      Successful registration to 127.0.0.1:5553.  
      

マネージャーエージェントで次を実行します。

$ prelude-admin registration-server prelude-manager
The "password" password will be requested by "prelude-admin register"
in order to connect. Please remove the quotes before using it.  
Generating 1024 bits Diffie-Hellman key for anonymous authentication...
Waiting for peers install request on 0.0.0.0:5553...
Waiting for peers install request on :::5553...      
Connection from 127.0.0.1:45796...
Registration request for analyzerID="xxxxxxxxxxxxxxxx" permission="idmef:w admin:r".
Approve registration? [y/n]: y
127.0.0.1:45796 successfully registered.

証明書の検証後、do n't/etc/prelude/default/client.confファイル、/etc/prelude/default/global.confファイル、/etc/prelude-manager/prelude-manager.confファイル、および/etc/prelude-lml/prelude-lml.confファイルでサーバーのリスナーを構成することを忘れないでください。そして、Preludeのサービスを開始できます。

$ Sudo systemctl enable prelude-manager
$ Sudo systemctl start prelude-manager
$ Sudo systemctl enable prelude-lml
$ Sudo systemctl start prelude-lml

最後に/usr/bin/prewikka pythonスクリプトを実行した後、リスナーサーバーを0.0.0.0:8000として取得し、localhost:8000で参照するために入力できます出力エラーは表示されず、以下のように表示されます。

enter image description here

enter image description here

ソース: Prelude-WikiStartInstalling-from-SourcesCodeInstalling-from-PackageUbunt