Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def security_scan_with_justifications(

# Call the individual scan functions from SaferPickle to sets of results.
# Picklemagic Scan
picklemagic_results = safer_pickle.picklemagic_scan(pickle_bytes)
picklemagic_results = saferpickle.picklemagic_scan(pickle_bytes)

safe_results.update(picklemagic_results.safe_results)
unsafe_results.update(picklemagic_results.unsafe_results)
suspicious_results.update(picklemagic_results.suspicious_results)
unknown_results.update(picklemagic_results.unknown_results)

# Genops Scan
genops_results = safer_pickle.genops_scan(
genops_results = saferpickle.genops_scan(
pickle_bytes, pickle_file_path=file_path
)
safe_results.update(genops_results.safe_results)
Expand All @@ -97,15 +97,15 @@ def security_scan_with_justifications(
num_unsafe,
num_suspicious,
_, # The unknown_score is not used for classification, only reporting
) = safer_pickle.score_results(
) = saferpickle.score_results(
final_safe_results,
final_unsafe_results,
final_suspicious_results,
final_unknown_results,
)

# Check for safety and return the results with justifications.
if safer_pickle.is_unsafe(num_safe, num_unsafe, num_suspicious):
if saferpickle.is_unsafe(num_safe, num_unsafe, num_suspicious):
if num_unsafe > num_suspicious:
classification = "unsafe"
all_results = []
Expand Down
8 changes: 7 additions & 1 deletion lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
"cProfile",
"cloudpickle.load",
"cloudpickle.loads",
"code.interact",
"code.InteractiveConsole",
"code.InteractiveInterpreter",
"codecs.decode",
"codeop.compile_command",
Expand All @@ -101,6 +103,7 @@
"eval",
"exec",
"execfile",
"fileinput",
"get_type_hints",
"gzip",
"hashlib",
Expand Down Expand Up @@ -134,7 +137,9 @@
"read",
"requests",
"runpy",
"safer_pickle_hook",
"safer_pickle",
"saferpickle",
"shutil",
"socket",
"ssl",
"stdin",
Expand Down Expand Up @@ -184,6 +189,7 @@
"reconstruct",
"scipy",
"set",
"shutil.disk_usage",
"sklearn",
"spacy",
"str",
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Utility functions for safer_pickle."""
"""Utility functions for saferpickle."""

import ast
import bz2
Expand Down
Loading