boman-cli 2.6.1__tar.gz → 2.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {boman_cli-2.6.1 → boman_cli-2.6.2}/PKG-INFO +1 -1
- {boman_cli-2.6.1 → boman_cli-2.6.2}/boman_cli.egg-info/PKG-INFO +1 -1
- {boman_cli-2.6.1 → boman_cli-2.6.2}/boman_cli.egg-info/SOURCES.txt +1 -1
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/Config.py +1 -1
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/main.py +20 -20
- boman_cli-2.6.2/bomancli/malware_rules/boman/js/boman-malware-detection.yml +35 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/utils.py +2 -2
- {boman_cli-2.6.1 → boman_cli-2.6.2}/setup.cfg +2 -2
- {boman_cli-2.6.1 → boman_cli-2.6.2}/setup.py +1 -1
- boman_cli-2.6.1/bomancli/opengrep_rules/boman-malware-detection.yml +0 -36
- {boman_cli-2.6.1 → boman_cli-2.6.2}/README.md +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/boman_cli.egg-info/dependency_links.txt +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/boman_cli.egg-info/entry_points.txt +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/boman_cli.egg-info/requires.txt +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/boman_cli.egg-info/top_level.txt +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/_init_.py +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/auth.py +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/base_logger.py +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/dev_attribution.py +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/loc_finder.py +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/sbom_enricher.py +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/templates/template_plan.yaml +0 -0
- {boman_cli-2.6.1 → boman_cli-2.6.2}/bomancli/validation.py +0 -0
|
@@ -181,8 +181,8 @@ def runImage(data=None,type=None):
|
|
|
181
181
|
|
|
182
182
|
# logging.info('Semgrep token present')
|
|
183
183
|
logging.info("copying custom opengrep rules to the build directory")
|
|
184
|
-
Utils.copy_rules_to_base_docker('
|
|
185
|
-
command_line = f"{command_line} --config auto --config /src/
|
|
184
|
+
Utils.copy_rules_to_base_docker('malware_rules', Config.sast_build_dir)
|
|
185
|
+
command_line = f"{command_line} --config auto --config /src/malware_rules --exclude='/src/malware_rules/**' --exclude='/src/boman_opengrep.json'"
|
|
186
186
|
if Config.jenkins == 'yes':
|
|
187
187
|
|
|
188
188
|
logging.info('SAST Docker: Preparing %s scan for jenkins env with %s user ', tool_name , userid)
|
|
@@ -200,7 +200,7 @@ def runImage(data=None,type=None):
|
|
|
200
200
|
'bind': data['bind']}},user=userid,detach=detach,environment=env_var,remove=True)
|
|
201
201
|
logging.info('SAST Docker: SUCCESS !!!. Message: %s Scan Completed',tool_name)
|
|
202
202
|
logging.info('SAST Docker: Deleting custom opengrep rules from the build directory')
|
|
203
|
-
shutil.rmtree('
|
|
203
|
+
shutil.rmtree('malware_rules')
|
|
204
204
|
except errors.ContainerError as exc:
|
|
205
205
|
msg='\n The following error has been recorded while scanning SAST'
|
|
206
206
|
Utils.logError(msg,str(exc))
|
|
@@ -208,7 +208,7 @@ def runImage(data=None,type=None):
|
|
|
208
208
|
Config.sast_scan_status = 'Failed'
|
|
209
209
|
Config.sast_errors = f'Exit Status {exc.exit_status}:{str(exc)}]'
|
|
210
210
|
logging.info('SAST Docker: Deleting custom opengrep rules from the build directory')
|
|
211
|
-
shutil.rmtree('
|
|
211
|
+
shutil.rmtree('malware_rules')
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
|
|
@@ -869,23 +869,23 @@ def uploadReport(filename,toolname,tool_id,scan_details_id,type):
|
|
|
869
869
|
r = requests.post(url,json=values)
|
|
870
870
|
return 0
|
|
871
871
|
|
|
872
|
-
try:
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
872
|
+
# try:
|
|
873
|
+
# logging.info('Removing the result file')
|
|
874
|
+
# if type != "sbom" and type != "reachability":
|
|
875
|
+
# logging.info("removing file %s",path)
|
|
876
|
+
# os.remove(path)
|
|
877
|
+
# elif Config.reachability_present is not True and type == 'sbom':
|
|
878
|
+
# logging.info("removing file %s",path)
|
|
879
|
+
# os.remove(path)
|
|
880
|
+
# elif type == "reachability":
|
|
881
|
+
# os.remove(path)
|
|
882
|
+
# os.remove(Path(str(Config.sbom_build_dir))/Config.sbom_response[0]['output_file'])
|
|
883
|
+
# os.remove(path_reachability)
|
|
884
|
+
# os.remove(path_bom)
|
|
885
|
+
# logging.info("removing file %s, %s, %s, %s", path, path_reachability, path_bom, Path(str(Config.sbom_build_dir))/Config.sbom_response[0]['output_file'])
|
|
886
886
|
|
|
887
|
-
except Exception as e:
|
|
888
|
-
|
|
887
|
+
# except Exception as e:
|
|
888
|
+
# logging.error(f"unable to remove the file: {path} ---> Error: {e}")
|
|
889
889
|
|
|
890
890
|
tool_output = json.dumps(data, ensure_ascii=False, indent=4)
|
|
891
891
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
rules:
|
|
2
|
+
- id: global-require-capability-capture-obfuscation-potential-malware
|
|
3
|
+
languages: [regex]
|
|
4
|
+
severity: HIGH
|
|
5
|
+
metadata:
|
|
6
|
+
category: security
|
|
7
|
+
technique: capability-smuggling
|
|
8
|
+
confidence: HIGH
|
|
9
|
+
impact: HIGH
|
|
10
|
+
message: >
|
|
11
|
+
Obfuscated malicious code was identified within the source code repository.
|
|
12
|
+
The code appears to have been introduced through a third-party dependency or
|
|
13
|
+
inadvertently committed by a developer. Its presence poses a supply chain security risk
|
|
14
|
+
and may enable unauthorized actions, data exfiltration, or compromise the integrity of
|
|
15
|
+
the application and development environment.
|
|
16
|
+
pattern-regex: '(global(This)?)\s*(\[(?:[^\[\]]|\[[^\[\]]*\]){1,80}\]|\.[A-Za-z0-9_$]+)\s*=\s*require\b'
|
|
17
|
+
|
|
18
|
+
- id: json-file-contains-obfuscated-js-code-potential-malware
|
|
19
|
+
languages: [regex]
|
|
20
|
+
severity: HIGH
|
|
21
|
+
paths:
|
|
22
|
+
include:
|
|
23
|
+
- "*.json"
|
|
24
|
+
metadata:
|
|
25
|
+
category: security
|
|
26
|
+
technique: format-integrity
|
|
27
|
+
confidence: MEDIUM
|
|
28
|
+
impact: HIGH
|
|
29
|
+
message: >
|
|
30
|
+
Obfuscated malicious code was identified within the source code repository.
|
|
31
|
+
The code appears to have been introduced through a third-party dependency or
|
|
32
|
+
inadvertently committed by a developer. Its presence poses a supply chain security risk
|
|
33
|
+
and may enable unauthorized actions, data exfiltration, or compromise the integrity of
|
|
34
|
+
the application and development environment.
|
|
35
|
+
pattern-regex: '(?s)\A(?=.*(?:\brequire\s*\(|\bfunction\s*\(|\beval\s*\(|=>|\b(?:var|let|const)\s+\w+\s*=|;\s*$))'
|
|
@@ -391,9 +391,9 @@ def copy_rules_to_base_docker(opengrep_rules_path, base_docker_path):
|
|
|
391
391
|
logging.info('Copying the opengrep rules to base docker image')
|
|
392
392
|
try:
|
|
393
393
|
rules_path = pkg_resources.resource_filename(__name__,opengrep_rules_path)
|
|
394
|
-
os.makedirs(os.path.join(base_docker_path, opengrep_rules_path), exist_ok=True)
|
|
394
|
+
# os.makedirs(os.path.join(base_docker_path, opengrep_rules_path), exist_ok=True)
|
|
395
395
|
# logging.info(rules_path, os.path.join(base_docker_path, opengrep_rules_path))
|
|
396
|
-
shutil.
|
|
396
|
+
shutil.copytree(rules_path, os.path.join(base_docker_path, opengrep_rules_path))
|
|
397
397
|
logging.info('Copied the opengrep rules to base docker image successfully')
|
|
398
398
|
except Exception as e:
|
|
399
399
|
logging.error('Error while copying the opengrep rules to base docker image: %s', e)
|
|
@@ -46,7 +46,7 @@ setup(
|
|
|
46
46
|
license='BSD 2-clause',
|
|
47
47
|
entry_points = entry_points,
|
|
48
48
|
packages=['bomancli'],
|
|
49
|
-
package_data={'bomancli': ['templates/template_plan.yaml', '
|
|
49
|
+
package_data={'bomancli': ['templates/template_plan.yaml', 'malware_rules/**/*', 'malware_rules/**/**/*']},
|
|
50
50
|
install_requires=['docker<=7.0.0',
|
|
51
51
|
'requests<=2.31.0',
|
|
52
52
|
'pyyaml',
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
rules:
|
|
2
|
-
- id: boman-global-require-capability-capture-obfuscation
|
|
3
|
-
languages: [regex]
|
|
4
|
-
severity: HIGH
|
|
5
|
-
metadata:
|
|
6
|
-
category: security
|
|
7
|
-
technique: capability-smuggling
|
|
8
|
-
confidence: HIGH
|
|
9
|
-
impact: HIGH
|
|
10
|
-
message: >
|
|
11
|
-
Code stashes require/module/__dirname/__filename onto the global object
|
|
12
|
-
under a (possibly obfuscated/computed) property name -- a known technique
|
|
13
|
-
for smuggling Node.js module-loading capability into a context that
|
|
14
|
-
should not normally have it (config file, eval'd snippet, stripped
|
|
15
|
-
bundle). Seen in jsjiami/javascript-obfuscator-packed droppers.
|
|
16
|
-
pattern-regex: '(global(This)?)\s*(\[(?:[^\[\]]|\[[^\[\]]*\]){1,80}\]|\.[A-Za-z0-9_$]+)\s*=\s*require\b'
|
|
17
|
-
|
|
18
|
-
- id: boman-json-file-contains-obfuscated-js-code-tokens
|
|
19
|
-
languages: [regex]
|
|
20
|
-
severity: HIGH
|
|
21
|
-
paths:
|
|
22
|
-
include:
|
|
23
|
-
- "*.json"
|
|
24
|
-
metadata:
|
|
25
|
-
category: security
|
|
26
|
-
technique: format-integrity
|
|
27
|
-
confidence: MEDIUM
|
|
28
|
-
impact: HIGH
|
|
29
|
-
message: >
|
|
30
|
-
This .json file contains tokens that are not legal outside a JSON string
|
|
31
|
-
value (require(, function(, eval(, var/let/const declarations, =>,
|
|
32
|
-
statement-terminating semicolons). A well-formed JSON document should
|
|
33
|
-
never contain executable-looking code -- this is a strong signal that
|
|
34
|
-
non-JSON content has been appended/smuggled into a file that tooling
|
|
35
|
-
(bundlers, config loaders) treats as trusted configuration.
|
|
36
|
-
pattern-regex: '(?s)\A(?=.*(?:\brequire\s*\(|\bfunction\s*\(|\beval\s*\(|=>|\b(?:var|let|const)\s+\w+\s*=|;\s*$))'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|