I'ld like to run a simple web server on demand, which would listen for POST requests and put the data posted in a file (or context).
So far I achieved similar by modifying community integration XSOAR-Web-Server, which use long lasting instance mode and creates web server using Python Bottle. Server is started by an integration in a simple oneliner:
run(host='0.0.0.0', port=listen_port, debug=True)
I then deal with POST requests with:
... # write to a file /tmp/data.txt locally
After web server received all the posts, I get the data form the XSOAR file system container ../diff/tmp/data.txt.
Is there a way to access the data from the container using the commands in that integration? Cause at the time the data is collected, there are no incidents associated with it. If i create a new command and try to access /tmp/data.txt - it seem to be executed in different container and does not have access to that file.
I think you'd be better off using something like the Generic Webhook integration to receive the post request, and then have the created Incident write the data to a file.
The POST would need to be JSON, but you could then map the data to a field, or drop it to labels. Then have your automation create the file and return it to the war room using the fileResult method (check the script helper)
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!