Comments (7)
Hi @RoemIko -
Thank you for reporting this issue!
We have confirmed this issue as a bug, and have a fix ready for the 1.4.3
version. In the interim, here is a work around leveraging the Uber Class that should also accomplish what you are trying to do.
from os import listdir
from falconpy import APIHarnessV2
def import_workflows():
path_to_workflows_folder = "/home/REDACTED/workflows/
falcon_w = APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
for filename in listdir(path_to_workflows_folder):
if filename.endswith(".yaml") or filename.endswith(".yml"):
print(f'Importing {filename}')
with open(f'{path_to_workflows_folder + filename}', 'r') as yaml_file:
file_data = {"data_file": yaml_file.read(), "type": "application/x-yaml"}
workflow_response = falcon_w.command("WorkflowDefinitionsImport", files=file_data)
print(f'Workflow Response: {workflow_response}')
if workflow_response['status_code'] == 200:
print(f'Workflow {filename} imported successfully')
else:
print(f'Workflow {filename} failed to import')
from falconpy.
Hi @jshcodes,
Thank you for looking into it 🙏 , and many thanks for the workaround
from falconpy.
I have updated falconpy to 1.4.3 but now i receive an error 500 with "Keyword arguments are required to use this method." This happens when i use the initial code from the beginning of this thread
from falconpy.
Can we see your call to import_definition
? It still just includes the data_file argument?
from falconpy.
Yes it still includes the data_file argument
from os import listdir
def import_workflows():
path_to_workflows_folder = "/home/REDACTED/workflows/
falcon_w = Workflows(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
for filename in listdir(path_to_workflows_folder):
if filename.endswith(".yaml") or filename.endswith(".yml"):
print(f'Importing {filename}')
with open(f'{path_to_workflows_folder + filename}', 'r') as yaml_file:
workflow_response = falcon_w.import_definition(data_file=yaml_file)
print(f'Workflow Response: {workflow_response}')
if workflow_response['status_code'] == 200:
print(f'Workflow {filename} imported successfully')
else:
print(f'Workflow {filename} failed to import')
from falconpy.
Did you happen to look into this @jshcodes ?
The uber class works
from falconpy.
Yes we did! 😄
The consumption of the YAML file has been implemented within the service class, which should reduce the amount of code you need.
from os import listdir
def import_workflows():
path_to_workflows_folder = "/home/REDACTED/workflows/
falcon_w = Workflows(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)
for filename in listdir(path_to_workflows_folder):
if filename.endswith(".yaml") or filename.endswith(".yml"):
print(f'Importing {filename}')
workflow_response = falcon_w.import_definition(data_file=f'{path_to_workflows_folder + filename}')
print(f'Workflow Response: {workflow_response}')
if workflow_response['status_code'] == 200:
print(f'Workflow {filename} imported successfully')
else:
print(f'Workflow {filename} failed to import')
from falconpy.
Related Issues (20)
- Unable to retrieve incident comments
- cspm_registration.get_configuration_detection_ids_v2 limit is incorrect HOT 2
- getcspmscanschedule needs lowercase cloud names HOT 1
- Text/plain response can't be parsed, masking the response actual value HOT 3
- GetQueriesAlertsV2 Error in documentation HOT 1
- [ DOC ] GetCSPMAzureAccount parameter status filter is string has no list of allowed values. HOT 2
- Is there a way to create cloud-scopes/cloud-groups (UI) using the API HOT 1
- [ DOC ] FileVantage Documentation appears incorrect HOT 2
- [ BUG ] Large file uploads using UploadSampleV3 fail depending on syntax used HOT 3
- [ BUG ] Uber Class command method keyword "action" collides with action parameter utilized by updatePolicyHostGroups operation.
- download_sensor.py / no error message when authentification failed HOT 1
- [ DOC ] ids parameter should be composite_ids in https://falconpy.io/Service-Collections/Alerts.html#patchentitiesalertsv3 HOT 1
- Is indicator_create_v1 function support bulk create ? HOT 1
- Sample - host_search.py - Includes comments from hostname_file in output.csv HOT 1
- Inconsistency between Detects Advisor API and New "Endpoint detections" Web Page HOT 1
- [ BUG ] Missing "--base_url" argument for many scripts HOT 1
- [ DOC ] Incorrect kwarg in doc for 'perform_policies_action' method when editing rule groups. HOT 1
- [ENH] download_sensor.py / ability to choose base_url HOT 2
- [BUG] download_sensor.py / find sensors even if the os is invalid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from falconpy.