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

Configparserer.py then KeyError #26

Open
piExpr opened this issue Sep 12, 2023 · 8 comments
Open

Configparserer.py then KeyError #26

piExpr opened this issue Sep 12, 2023 · 8 comments

Comments

@piExpr
Copy link

piExpr commented Sep 12, 2023

x:~$ python3 /home/ubuntu/zscaler-FalconX-integration/intelbridge/intelbridge.py
Traceback (most recent call last):
File "/home/ubuntu/zscaler-FalconX-integration/intelbridge/intelbridge.py", line 25, in
from indicators.indicators import get_indicators, prepare_indicators #, write_data
File "/home/ubuntu/zscaler-FalconX-integration/intelbridge/indicators/indicators.py", line 10, in
from auth.auth import cs_auth
File "/home/ubuntu/zscaler-FalconX-integration/intelbridge/auth/auth.py", line 16, in
cs_config = config['CROWDSTRIKE']
File "/usr/lib/python3.10/configparser.py", line 965, in getitem
raise KeyError(key)
KeyError: 'CROWDSTRIKE'

Any direction on how to fix this? I'm running this inside of lab ubuntu instance.

@marcispauls
Copy link
Contributor

from the error seems you dont have config.ini with [CROWDSTRIKE]

@piExpr
Copy link
Author

piExpr commented Oct 10, 2023

Using the config.ini with all the required API creds. Using VSCode on my machine with all the dependencies installed. Should the intelbridge.py be on env variable path? Is there anything else needed as far as making edits to the code? Getting no where with this. tia

@marcispauls
Copy link
Contributor

not really - did as described, created config and done

@piExpr
Copy link
Author

piExpr commented Oct 10, 2023

What was your env setup like? Local machine with some compiler? Docket container? Some flavor linux?

I'm running on my mac with VScode the folder path to repo

@piExpr
Copy link
Author

piExpr commented Oct 11, 2023

used the original repo with config.py then ran setup... appears to be working

recent repo kept returning config parser and all sorts of error

@rkslattery
Copy link

Hello, I have the integration working as expected and can call 'python3 intelbridge' and it works flawlessly, however, if I try to call the full path to the python script, I get the same exact error as the OP. I am trying to CRON this and it requires the full path. My output when calling the full path:

person@AZW-ZSCALER01:/var/log$ python3 /home/person/zscaler-FalconX-integration/intelbridge/intelbridge.py
Traceback (most recent call last):
File "/home/person/zscaler-FalconX-integration/intelbridge/intelbridge.py", line 25, in
from indicators.indicators import get_indicators, prepare_indicators #, write_data
File "/home/person/zscaler-FalconX-integration/intelbridge/indicators/indicators.py", line 10, in
from auth.auth import cs_auth
File "/home/person/zscaler-FalconX-integration/intelbridge/auth/auth.py", line 16, in
cs_config = config['CROWDSTRIKE']
File "/usr/lib/python3.10/configparser.py", line 965, in getitem
raise KeyError(key)
KeyError: 'CROWDSTRIKE'

Anyone else experience this or have a working CRON config? Thanks

@marcispauls
Copy link
Contributor

have you tried to change path to /home/person/zscaler-FalconX-integration/intelbridge/ and then launch?

@rkslattery
Copy link

Hello, thank you for your inquiry. Yes, it works when called from that directory. I resolved the whole CRON issue by creating a new service instead and enabling it on reboot. Since I was told CrowdStrike doesn't update their malicious urls very frequently, the default sleep time in this script of 12 hours was recommended.

New service
/etc/systemd/system/intelbridge.service

The file has the following entries:
[Unit]
Description=CrowStrike Integration with Zscaler

[Service]
WorkingDirectory=/home/atiadmin/zscaler-FalconX-integration
ExecStart=/usr/bin/python3 intelbridge
User=

[Install]
WantedBy=multi-user.target

Reload the daemon
systemctl daemon-reload

Start the service
systemctl start intelbridge.service

Check the status
systemctl status intelbridge.service

Enable on reboot
systemctl enable intelbridge.service

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

No branches or pull requests

3 participants