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

suricata rule update is broken #323

Closed
mmguero opened this issue Jan 4, 2024 · 0 comments
Closed

suricata rule update is broken #323

mmguero opened this issue Jan 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working regression It worked at one point... suricata
Milestone

Comments

@mmguero
Copy link
Collaborator

mmguero commented Jan 4, 2024

Due to some of the permissions cleaning up I did as part of #282 the suricata binary gets a PermissionError: [Errno 1] Operation not permitted: '/usr/bin/suricata' error when running in the suricata-offline container:

suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh: Traceback (most recent call last):
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/bin/suricata-update", line 36, in <module>
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     sys.exit(main.main())
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:              ^^^^^^^^^^^
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3/dist-packages/suricata/update/main.py", line 1369, in main
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     sys.exit(_main())
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:              ^^^^^^^
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3/dist-packages/suricata/update/main.py", line 1066, in _main
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     config.init(args)
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3/dist-packages/suricata/update/config.py", line 202, in init
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     build_info = suricata.update.engine.get_build_info(_config["suricata"])
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3/dist-packages/suricata/update/engine.py", line 43, in get_build_info
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     build_info_output = subprocess.check_output([suricata, "--build-info"])
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3.11/subprocess.py", line 548, in run
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     with Popen(*popenargs, **kwargs) as process:
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     self._execute_child(args, executable, preexec_fn, close_fds,
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:   File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh:     raise child_exception_type(errno_num, err_msg, err_filename)
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh: PermissionError: [Errno 1] Operation not permitted: '/usr/bin/suricata'
suricata-offline | 2024-01-02T18:00:00Z  /bin/bash /usr/local/bin/suricata-update-rules.sh: error running command: exit status 1
@mmguero mmguero added bug Something isn't working regression It worked at one point... suricata labels Jan 4, 2024
@mmguero mmguero added this to the v24.01.0 milestone Jan 4, 2024
@mmguero mmguero self-assigned this Jan 4, 2024
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue Jan 4, 2024
… told to use the suricata binary without setcap privileges assigned to it
@mmguero mmguero closed this as completed Jan 4, 2024
This was referenced Jan 17, 2024
mmguero added a commit that referenced this issue Jan 17, 2024
Malcolm v24.01.0 contains new features, improvements, bug fixes and component version updates.

v23.12.1...v24.0.1

* Features and enhancements
    + new Malcolm instance landing page (#252)
    + file carve download with password-protected .zip file (#288)
    + new "all files exept common plain text files" option for Malcolm's file carving to match Hedgehog capability (#290)
    + allow customizing indexes for logs written to OpenSearch/Elasticsearch (#313)
    + more consistently differentiate between uploaded and live-captured traffic (#321)
    + make download extracted file context item from Arkime smarter (#330)
    + improve netbox device type library import by using "official" import script (#384)
* Component version updates
    + Alpine Linux to [v3.19](https://alpinelinux.org/posts/Alpine-3.19.0-released.html) as the base for some Docker images
    + Fluent Bit to [v2.2.2](https://github.com/fluent/fluent-bit/releases/tag/v2.2.2)
    + Beats to [v8.11.4](https://www.elastic.co/guide/en/beats/libbeat/8.11/release-notes-8.11.4.html)
    + LogStash to [v8.11.4](https://www.elastic.co/guide/en/logstash/current/logstash-8-11-4.html)
* Bug fixes
    + Suricata Alerts dashboard "Alerts - Tags" visualization is useless (#314)
    + third party logs are not parsed correctly from fluentbit -> fluentd aggregator -> Malcolm (#318)
    + update document lookup APIs to search either network or host data (#322)
    + suricata rule update is broken (#323)
    + time sync from hedgehog to Malcolm opensearch instance not working (#324)
    + fix issue specifying database mode via command-line
    + have pruning of OpenSearch indices (based on size) include "other" Malcolm indices as well (e.g., nginx logs, system resources, third-party logs, etc.)
* Configuration changes (in [environment variables](https://idaholab.github.io/Malcolm/docs/malcolm-config.html#MalcolmConfigEnvVars) in [`./config/`](https://github.com/idaholab/Malcolm/tree/v24.0.1/config))
    + added the following variables with relation to #313
        - added `ARKIME_ROTATE_INDEX` to [`arkime.env`](https://github.com/idaholab/Malcolm/tree/v24.0.1/arkime.env.example) with default value of `daily` (see [Arkime docs on rotateIndex](https://arkime.com/settings#rotateIndex))
        - added the following variables and defaults to [`opensearch.env`](https://github.com/idaholab/Malcolm/tree/v24.0.1/opensearch.env.example):
        ```
        # OpenSearch index patterns and timestamp fields
        # Index pattern for network traffic logs written via Logstash (e.g., Zeek logs, Suricata alerts)
        MALCOLM_NETWORK_INDEX_PATTERN=arkime_sessions3-*
        # Default time field to use for network traffic logs in Logstash and Dashboards
        MALCOLM_NETWORK_INDEX_TIME_FIELD=firstPacket
        # Suffix used to create index to which network traffic logs are written (supports Ruby strftime strings in %{})
        MALCOLM_NETWORK_INDEX_SUFFIX=%{%y%m%d}
        # Index pattern for other logs written via Logstash (e.g., nginx, beats, fluent-bit, etc.)
        MALCOLM_OTHER_INDEX_PATTERN=malcolm_beats_*
        # Default time field to use for other logs in Logstash and Dashboards
        MALCOLM_OTHER_INDEX_TIME_FIELD=@timestamp
        # Suffix used to create index to which other logs are written (supports Ruby strftime strings in %{})
        MALCOLM_OTHER_INDEX_SUFFIX=%{%y%m%d}
        # Index pattern used specifically by Arkime (will probably match MALCOLM_NETWORK_INDEX_PATTERN, should probably be arkime_sessions3-*)
        ARKIME_NETWORK_INDEX_PATTERN=arkime_sessions3-*
        # Default time field used by for sessions in Arkime viewer
        ARKIME_NETWORK_INDEX_TIME_FIELD=firstPacket
        ```
    + changed default for `EXTRACTED_FILE_HTTP_SERVER_KEY` to `infected` in [`zeek-secret.env`](https://github.com/idaholab/Malcolm/tree/v24.0.1/zeek-secret.env.example)
    + added `EXTRACTED_FILE_HTTP_SERVER_ZIP` with default value of `false` in [`zeek.env`](https://github.com/idaholab/Malcolm/tree/v24.0.1/zeek.env.example), see (#288)
mmguero added a commit to cisagov/Malcolm that referenced this issue Jan 17, 2024
Malcolm v24.01.0 contains new features, improvements, bug fixes and component version updates.

v23.12.1...v24.0.1

* Features and enhancements
    + new Malcolm instance landing page (idaholab#252)
    + file carve download with password-protected .zip file (idaholab#288)
    + new "all files exept common plain text files" option for Malcolm's file carving to match Hedgehog capability (idaholab#290)
    + allow customizing indexes for logs written to OpenSearch/Elasticsearch (idaholab#313)
    + more consistently differentiate between uploaded and live-captured traffic (idaholab#321)
    + make download extracted file context item from Arkime smarter (idaholab#330)
    + improve netbox device type library import by using "official" import script (idaholab#384)
* Component version updates
    + Alpine Linux to [v3.19](https://alpinelinux.org/posts/Alpine-3.19.0-released.html) as the base for some Docker images
    + Fluent Bit to [v2.2.2](https://github.com/fluent/fluent-bit/releases/tag/v2.2.2)
    + Beats to [v8.11.4](https://www.elastic.co/guide/en/beats/libbeat/8.11/release-notes-8.11.4.html)
    + LogStash to [v8.11.4](https://www.elastic.co/guide/en/logstash/current/logstash-8-11-4.html)
* Bug fixes
    + Suricata Alerts dashboard "Alerts - Tags" visualization is useless (idaholab#314)
    + third party logs are not parsed correctly from fluentbit -> fluentd aggregator -> Malcolm (idaholab#318)
    + update document lookup APIs to search either network or host data (idaholab#322)
    + suricata rule update is broken (idaholab#323)
    + time sync from hedgehog to Malcolm opensearch instance not working (idaholab#324)
    + fix issue specifying database mode via command-line
    + have pruning of OpenSearch indices (based on size) include "other" Malcolm indices as well (e.g., nginx logs, system resources, third-party logs, etc.)
* Configuration changes (in [environment variables](https://idaholab.github.io/Malcolm/docs/malcolm-config.html#MalcolmConfigEnvVars) in [`./config/`](https://github.com/cisagov/Malcolm/tree/v24.0.1/config))
    + added the following variables with relation to idaholab#313
        - added `ARKIME_ROTATE_INDEX` to [`arkime.env`](https://github.com/cisagov/Malcolm/tree/v24.0.1/arkime.env.example) with default value of `daily` (see [Arkime docs on rotateIndex](https://arkime.com/settings#rotateIndex))
        - added the following variables and defaults to [`opensearch.env`](https://github.com/cisagov/Malcolm/tree/v24.0.1/opensearch.env.example):
        ```
        # OpenSearch index patterns and timestamp fields
        # Index pattern for network traffic logs written via Logstash (e.g., Zeek logs, Suricata alerts)
        MALCOLM_NETWORK_INDEX_PATTERN=arkime_sessions3-*
        # Default time field to use for network traffic logs in Logstash and Dashboards
        MALCOLM_NETWORK_INDEX_TIME_FIELD=firstPacket
        # Suffix used to create index to which network traffic logs are written (supports Ruby strftime strings in %{})
        MALCOLM_NETWORK_INDEX_SUFFIX=%{%y%m%d}
        # Index pattern for other logs written via Logstash (e.g., nginx, beats, fluent-bit, etc.)
        MALCOLM_OTHER_INDEX_PATTERN=malcolm_beats_*
        # Default time field to use for other logs in Logstash and Dashboards
        MALCOLM_OTHER_INDEX_TIME_FIELD=@timestamp
        # Suffix used to create index to which other logs are written (supports Ruby strftime strings in %{})
        MALCOLM_OTHER_INDEX_SUFFIX=%{%y%m%d}
        # Index pattern used specifically by Arkime (will probably match MALCOLM_NETWORK_INDEX_PATTERN, should probably be arkime_sessions3-*)
        ARKIME_NETWORK_INDEX_PATTERN=arkime_sessions3-*
        # Default time field used by for sessions in Arkime viewer
        ARKIME_NETWORK_INDEX_TIME_FIELD=firstPacket
        ```
    + changed default for `EXTRACTED_FILE_HTTP_SERVER_KEY` to `infected` in [`zeek-secret.env`](https://github.com/cisagov/Malcolm/tree/v24.0.1/zeek-secret.env.example)
    + added `EXTRACTED_FILE_HTTP_SERVER_ZIP` with default value of `false` in [`zeek.env`](https://github.com/cisagov/Malcolm/tree/v24.0.1/zeek.env.example), see (idaholab#288)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression It worked at one point... suricata
Projects
Status: Released
Development

No branches or pull requests

1 participant