Skip to content

Commit 602f177

Browse files
committedNov 14, 2024·
Support multiprocessing strategy
1 parent 3a35968 commit 602f177

9 files changed

+28
-13
lines changed
 

‎Pipfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ verify_ssl = true
77

88
[packages]
99
colorama = ">=0.4.5"
10-
libsast = ">=3.1.4"
10+
libsast = ">=3.1.5"
1111
semgrep = "==1.86.0"
1212
sarif-om = ">=1.0.4"
1313
jschema-to-python = ">=1.2.3"

‎Pipfile.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ Requires Python 3.7+
3131

3232
```bash
3333
$ mobsfscan
34-
usage: mobsfscan [-h] [--json] [--sarif] [--sonarqube] [--html] [--type {android,ios,auto}] [-o OUTPUT] [-c CONFIG] [-w] [--no-fail] [-v] [path ...]
34+
usage: mobsfscan [-h] [--json] [--sarif] [--sonarqube] [--html] [--type {android,ios,auto}]
35+
[-o OUTPUT] [-c CONFIG] [-mp {default,billiard,thread}] [-w] [--no-fail] [-v]
36+
[path ...]
3537

3638
positional arguments:
3739
path Path can be file(s) or directories with source code
3840

39-
optional arguments:
41+
options:
4042
-h, --help show this help message and exit
4143
--json set output format as JSON
4244
--sarif set output format as SARIF 2.1.0
@@ -48,6 +50,8 @@ optional arguments:
4850
output filename to save the result
4951
-c CONFIG, --config CONFIG
5052
location to .mobsf config file
53+
-mp {default,billiard,thread}, --multiprocessing {default,billiard,thread}
54+
optional: specify multiprocessing strategy
5155
-w, --exit-warning non zero exit code on warning
5256
--no-fail force zero exit code, takes precedence over --exit-warning
5357
-v, --version show mobsfscan version

‎action.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,24 @@ inputs:
99
args:
1010
description: |
1111
positional arguments:
12-
path Path can be file(s) or directories with source code
12+
path Path can be file(s) or directories with source code
1313
1414
optional arguments:
1515
-h, --help show this help message and exit
1616
--json set output format as JSON
1717
--sarif set output format as SARIF 2.1.0
1818
--sonarqube set output format compatible with SonarQube
1919
--html set output format as HTML
20+
--type {android,ios,auto}
21+
optional: force android or ios rules explicitly
2022
-o OUTPUT, --output OUTPUT
2123
output filename to save the result
2224
-c CONFIG, --config CONFIG
23-
Location to .mobsf config file
25+
location to .mobsf config file
26+
-mp {default,billiard,thread}, --multiprocessing {default,billiard,thread}
27+
optional: specify multiprocessing strategy
2428
-w, --exit-warning non zero exit code on warning
29+
--no-fail force zero exit code, takes precedence over --exit-warning
2530
-v, --version show mobsfscan version
2631
required: true
2732

‎mobsfscan/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__title__ = 'mobsfscan'
77
__authors__ = 'Ajin Abraham'
88
__copyright__ = f'Copyright {datetime.now().year} Ajin Abraham, OpenSecurity'
9-
__version__ = '0.4.4'
9+
__version__ = '0.4.5'
1010
__version_info__ = tuple(int(i) for i in __version__.split('.'))
1111
__all__ = [
1212
'__title__',

‎mobsfscan/__main__.py

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ def main():
5757
parser.add_argument('-c', '--config',
5858
help='location to .mobsf config file',
5959
required=False)
60+
parser.add_argument('-mp', '--multiprocessing',
61+
help='optional: specify multiprocessing strategy',
62+
choices=['default', 'billiard', 'thread'],
63+
default='default')
6064
parser.add_argument('-w', '--exit-warning',
6165
help='non zero exit code on warning',
6266
action='store_true',
@@ -80,6 +84,7 @@ def main():
8084
is_json,
8185
args.type,
8286
args.config,
87+
args.multiprocessing,
8388
).scan()
8489
if args.sonarqube:
8590
sonarqube.sonarqube_output(

‎mobsfscan/mobsfscan.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
class MobSFScan:
24-
def __init__(self, paths, json, scan_type='auto', config=False) -> None:
24+
def __init__(self, paths, json, scan_type='auto', config=False, mp='default') -> None:
2525
self.scan_type = scan_type
2626
self.conf = get_config(paths, config)
2727
self.options = {
@@ -35,6 +35,7 @@ def __init__(self, paths, json, scan_type='auto', config=False) -> None:
3535
'ignore_rules': self.conf['ignore_rules'],
3636
'severity_filter': self.conf['severity_filter'],
3737
'show_progress': not json,
38+
'multiprocessing': mp,
3839
}
3940
self.paths = paths
4041
self.result = {

‎requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jschema-to-python==1.2.3
2020
jsonpickle==4.0.0
2121
jsonschema==4.23.0
2222
jsonschema-specifications==2024.10.1
23-
libsast==3.1.4
23+
libsast==3.1.5
2424
markdown-it-py==3.0.0
2525
mdurl==0.1.2
2626
opentelemetry-api==1.25.0

‎setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_version(rel_path):
5050
long_description_content_type='text/markdown',
5151
install_requires=[
5252
'colorama>=0.4.5',
53-
'libsast>=3.1.0',
53+
'libsast>=3.1.5',
5454
'semgrep==1.86.0',
5555
'sarif-om>=1.0.4',
5656
'jschema-to-python>=1.2.3',

0 commit comments

Comments
 (0)
Please sign in to comment.