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

Sample - host_search.py - Includes comments from hostname_file in output.csv #1168

Closed
David-M-Berry opened this issue May 28, 2024 · 1 comment
Assignees
Labels
bug 🐛 Something isn't working code samples Functioning sample code to get you started enhancement 🌟 New feature or request hosts Hosts or Host Groups issues and questions

Comments

@David-M-Berry
Copy link
Contributor

Describe the bug
When running host_search.py and including a file with hostnames, if there are comments, the script will attempt to query for hosts with the full comment included. Comments should instead be ignored.

To Reproduce

  1. Ensure you have a text file available with comments in it.
test$ cat hosts.txt 
#ubuntu hosts

tester1-ubuntu
  1. run host_search.py with the -f HOSTNAME_FILE, --hostname_file HOSTNAME_FILE option
python3 host_search.py -f hosts.txt
  1. Observe the output.csv file as having the commented line as a hostname, and a host not found error:
test$ cat output.csv 
Hostname,CID,RFM,Last Seen,Landscape,Tag1,Tag2,Tag3,Tag4
tester1-ubuntu,<aid>,no,2023-05-28T17:54:40Z,FalconGroupingTags/devTest,
#ubuntu hosts,HOST NOT FOUND

Expected behavior
Comments in text files containing hostnames are useful for administrators, and should be ignored by the script.

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Python: Python 3.10.12
  • FalconPy: crowdstrike-falconpy (1.4.3)
@David-M-Berry David-M-Berry added the bug 🐛 Something isn't working label May 28, 2024
@jshcodes jshcodes added enhancement 🌟 New feature or request code samples Functioning sample code to get you started hosts Hosts or Host Groups issues and questions labels May 28, 2024
@jshcodes
Copy link
Member

jshcodes commented Jun 7, 2024

Resolved by #1178.

@jshcodes jshcodes closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working code samples Functioning sample code to get you started enhancement 🌟 New feature or request hosts Hosts or Host Groups issues and questions
Projects
None yet
Development

No branches or pull requests

2 participants