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

services start, that should not #346

Closed
neu5ron opened this issue Feb 4, 2019 · 6 comments
Closed

services start, that should not #346

neu5ron opened this issue Feb 4, 2019 · 6 comments
Assignees
Labels
awaiting merge Issue will be closed when PR referenced in issue is merged to master
Milestone

Comments

@neu5ron
Copy link
Contributor

neu5ron commented Feb 4, 2019

services start that are configured to 'False' under the config section 'Specify if a service is enabled on startup'.

rock config.yml

# Specify if a service is enabled on startup
enable_stenographer: False
enable_docket: False
enable_bro: True
enable_suricata: False
enable_snort: False
enable_suricata_update: False
enable_logstash: True
enable_elasticsearch: True
enable_kibana: True
enable_zookeeper: True
enable_kafka: True
enable_lighttpd: True
enable_fsf: False

then i rebooted

you will then notice stenographer, suricata, and fsf are running

[root@simplerockbuild admin]# systemctl status stenographer suricata docket fsf
● stenographer.service - packet capture to disk
   Loaded: loaded (/etc/systemd/system/stenographer.service; enabled; vendor preset: disabled)
   Active: active (exited) since Mon 2019-02-04 17:56:29 UTC; 2min 18s ago
  Process: 3372 ExecStartPost=/bin/echo View instance logs with `journalctl -u stenographer@*` (code=exited, status=0/SUCCESS)
  Process: 3360 ExecStartPost=/bin/echo View instance status with `systemctl status stenographer*`. (code=exited, status=0/SUCCESS)
  Process: 3345 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
  Process: 3326 ExecStartPre=/bin/echo Starting template instances. (code=exited, status=0/SUCCESS)
 Main PID: 3345 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/stenographer.service
Feb 04 17:56:29 simplerockbuild.simplerock.lan systemd[1]: Starting packet capture to disk...
Feb 04 17:56:29 simplerockbuild.simplerock.lan echo[3326]: Starting template instances.
Feb 04 17:56:29 simplerockbuild.simplerock.lan echo[3360]: View instance status with `systemctl status stenographer*`.
Feb 04 17:56:29 simplerockbuild.simplerock.lan echo[3372]: View instance logs with `journalctl -u stenographer@*`
Feb 04 17:56:29 simplerockbuild.simplerock.lan systemd[1]: Started packet capture to disk.
● suricata.service - Suricata Intrusion Detection Service
   Loaded: loaded (/etc/systemd/system/suricata.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-02-04 17:56:29 UTC; 2min 18s ago
 Main PID: 3319 (Suricata-Main)
   CGroup: /system.slice/suricata.service
           └─3319 /sbin/suricata -c /etc/suricata/suricata.yaml --af-packet
Feb 04 17:56:29 simplerockbuild.simplerock.lan systemd[1]: Started Suricata Intrusion Detection Service.
Feb 04 17:56:29 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:56:29 - <Info> - Including configuration file rocknsm-overrides.yaml.
Feb 04 17:56:29 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:56:29 - <Info> - Configuration node 'default-rule-path' redefined.
Feb 04 17:56:29 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:56:29 - <Info> - Configuration node 'rule-files' redefined.
Feb 04 17:56:29 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:56:29 - <Info> - Configuration node 'af-packet' redefined.
Feb 04 17:56:29 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:56:29 - <Info> - Configuration node 'default-log-dir' redefined.
Feb 04 17:56:29 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:56:29 - <Info> - Configuration node 'outputs' redefined.
Feb 04 17:56:29 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:56:29 - <Notice> - This is Suricata version 4.0.6 RELEASE
Feb 04 17:57:05 simplerockbuild.simplerock.lan suricata[3319]: 4/2/2019 -- 17:57:05 - <Notice> - all 3 packet processing threads, 4 management threads initialized, engine started.
● docket.service - Docket uWSGI app
   Loaded: loaded (/usr/lib/systemd/system/docket.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
● fsf.service - File Scanning Framework (FSF-Server) Service
   Loaded: loaded (/usr/lib/systemd/system/fsf.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-02-04 17:56:29 UTC; 2min 17s ago
  Process: 3385 ExecStart=/opt/fsf/fsf-server/main.py start (code=exited, status=0/SUCCESS)
  Process: 3344 ExecStartPre=/bin/chown -R fsf:fsf /run/fsf (code=exited, status=0/SUCCESS)
  Process: 3324 ExecStartPre=/bin/mkdir -p /run/fsf (code=exited, status=0/SUCCESS)
 Main PID: 3418 (python)
   CGroup: /system.slice/fsf.service
           └─3418 python /opt/fsf/fsf-server/main.py start
@bndabbs bndabbs added this to the 2.4 milestone Feb 4, 2019
@neu5ron
Copy link
Contributor Author

neu5ron commented Feb 18, 2019

rock_start and rock_stop work correctly because they look at the config.yml

if grep -qiE "^with_$1: (true|yes)" /etc/rocknsm/config.yml; then

however, the systemctl rockctl -- just blindly starts and stops everything. Also, would need to mention snort is not in the list either.

psprocs=( zookeeper kafka bro suricata filebeat elasticsearch logstash kibana stenographer )

@jeffgeiger
Copy link
Contributor

Good point. So, for a fix, it needs the config.yml to be fully populated again. e.g. Just merge the "reference config" and config.yml into one thing again. @bndabbs, what say you?

@bndabbs
Copy link
Contributor

bndabbs commented Feb 18, 2019

rock_start is deprecated, so we should just get rid of that. For the 2nd piece, I think the easiest path forward would be to convert rockctl to a template and populate the list of procs per-host based on the inventory.

Something like the following:

psprocs=( {{ group_names }} )

From the Ansible docs:
"group_names is a list (array) of all the groups the current host is in. This can be used in templates using Jinja2 syntax to make template source files that vary based on the group membership (or role) of the host"

@jeffgeiger
Copy link
Contributor

Oooh. I like that.

neu5ron added a commit to neu5ron/rock that referenced this issue Feb 19, 2019
jeffgeiger added a commit that referenced this issue Feb 19, 2019
@dcode dcode mentioned this issue Feb 22, 2019
dcode added a commit that referenced this issue Feb 22, 2019
* New: Add ability to do multi-host deployment of sensor + data tiers (#339, [bndabbs@gmail.com](mailto:bndabbs@gmail.com))
* New: Integrate Docket into Kibana by default ([derek@rocknsm.io](mailto:derek@rocknsm.io))
* New: Improvements and additional Kibana dashboards (spartan782)
* Fixes: issue with Bro failing when monitor interface is down (#343, [bndabbs@gmail.com](mailto:bndabbs@gmail.com))
* Fixes: issue with services starting that shouldn’t (#346, [therealneu5ron@gmail.com](mailto:therealneu5ron@gmail.com))
* Fixes: race condition on loading dashboards into Kibana (#356, [derek@rocknsm.io](mailto:derek@rocknsm.io))
* Fixes: configuration for Docket allowing serving from non-root URI (#361, [derek@rocknsm.io](mailto:derek@rocknsm.io))
* Change: bro log retention value to one week rather than forever (#345, [sean.cochran@gmail.com](mailto:sean.cochran@gmail.com))
* Change: Greatly improve documentation  (#338, [sean.cochran@gmail.com](mailto:sean.cochran@gmail.com))
* Change: Reorganize README (#308, [bradford.dabbs@elastic.co](mailto:bradford.dabbs@elastic.co))
* Change: Move ECS to rock-dashboards repo (#305, [derek@rocknsm.io](mailto:derek@rocknsm.io))
* Change: Move RockNSM install paths to filesystem heirarchy standard locations (#344, [bndabbs@gmail.com](mailto:bndabbs@gmail.com))
@neu5ron
Copy link
Contributor Author

neu5ron commented Mar 11, 2019

since filebeat is in rockctl and in config.yml only has enable_filebeat and not a with_filebeat - filebeat now gets disabled due to this script -- need to add with_filebeat to config.yml due to the usage in rockctl

if grep -qiE "^with_$1: (true|yes)" /etc/rocknsm/config.yml; then

@bndabbs will probably need your help on this... due to limited knowledge of the meta universe of deployment

@bndabbs
Copy link
Contributor

bndabbs commented Mar 14, 2019

#381 should fix this @neu5ron.

dcode pushed a commit that referenced this issue Mar 14, 2019
This allows for more advanced tests, such as intersect.

Will require updates to rockctl.

Affects #346
@bndabbs bndabbs added the awaiting merge Issue will be closed when PR referenced in issue is merged to master label Mar 26, 2019
dcode pushed a commit that referenced this issue Mar 29, 2019
This allows for more advanced tests, such as intersect.

Will require updates to rockctl.

Affects #346
@bndabbs bndabbs closed this as completed Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge Issue will be closed when PR referenced in issue is merged to master
Projects
None yet
Development

No branches or pull requests

5 participants