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

Kotlin and Swift scans returning differerent codes. #36

Closed
OlivettiOriana opened this issue Jun 7, 2022 · 3 comments
Closed

Kotlin and Swift scans returning differerent codes. #36

OlivettiOriana opened this issue Jun 7, 2022 · 3 comments

Comments

@OlivettiOriana
Copy link

OlivettiOriana commented Jun 7, 2022

Hi,
I have been digging for a while and I have not been able to find the reason why when running mobsf with a swift project, the return code is 0, and when I do it with a kotlin project, the return code is 1, even though it seems to run successfully.

I have a docker container which clones the mobile repos and runs mobsf. I am currently calling it with the python module subprocess like this.
process = subprocess.run( "mobsfscan --sarif -o report.sarif <mobilerepo>", shell=True, capture_output=True, universal_newlines=True, timeout=None )

and when I look at the process.returncode I get 1 for the kotlin project and 0 for the swift project, even though both scans seems to run successfully.
Unfortunately, I am not able to share the projects, but I was wondering if it is something that is happening at the mobsf sourcecode level, or something that I'm doing wrong.

Thanks in advance!

@ajinabraham
Copy link
Member

The exit codes depends on the scan results.

If the scan results have findings with ERROR severity, the exit code thrown will be 1 and 0 for the rest.
You can control the exit code for WARNING with the -w parameter.

sys.exit(1)
sys.exit(0)

@OlivettiOriana
Copy link
Author

Thanks for the reply, this is really helpful.
I wonder then, if the scan fails completely, for example, the report file could not be created. What exit code will it throw? 1 as well?

Thanks so much for the help!

@ajinabraham
Copy link
Member

It depends on the error. it will be non zero though.

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

2 participants