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

[Bug] Permission denied #13

Open
TiiTcHY opened this issue Apr 5, 2022 · 4 comments
Open

[Bug] Permission denied #13

TiiTcHY opened this issue Apr 5, 2022 · 4 comments

Comments

@TiiTcHY
Copy link

TiiTcHY commented Apr 5, 2022

Expected Behavior
I would expect to be able to import the module with no issues.

Actual Behavior
the module fails to import for the following reasons:
[Errno 13] Permission denied: '/.stixmarx'

This is on a linux box. I have create a docket image with the following: mitreattack-python,pandas,pyattck,bs4,colour,openpyxl,stix2,taxii2-client,numpy,drawSvg,Pillow,tqdm,xlsxwriter,tabulate,stix2-elevator

When i run the python script against this docker image i get the error where it has failed to run due to permission denied.

The module is installed here "/usr/local/lib/python3.9/site-packages/stixmarx/" however, looking at the script i believe its this line which is casing me an issue " Line 33: user_path = os.path.join(os.path.expanduser("~"), ".stixmarx")" which is inside of stixmarx\fields\__init.py. This is then thinking that the user directory is root which is why the error is [Errno 13] Permission denied: '/.stixmarx' as i do not have permission to write in root.

I raised the issue here MITRE BUG

@clenk
Copy link

clenk commented Apr 7, 2022

Hi @TiiTcHY, have you tried running your docker image as a different user other than root?

Let me know it that won't work for you.

@TiiTcHY
Copy link
Author

TiiTcHY commented Apr 8, 2022

Hello @clenk I am unable to change the user that its being run via a SOAR platform. I'm looking to automate the tasks within the palform but unable to due to this issue with the creation of the file.

@rishabhsiitk
Copy link

@TiiTcHY Here is a quick fix, it worked for me.
Define a HOME environment variable with value of home directory of user or path where user has write access.

@meirmedigate
Copy link

This will solve the root cause, making it possible to define the directory that the files are stored in -
#14

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

4 participants