Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Language and OS related utilities.
Content in a nutshell:
if WINDOWS or LINUX or MAC or WSL:
import os
from coveo_systools.filesystem import find_paths, find_application, find_repo_root
os.getcwd()
# '/code/coveo-python-oss/coveo-systools'
find_application('git')
# WindowsPath('C:/Program Files/Git/cmd/git.EXE') # windows example for completeness
find_repo_root()
# Path('/code/coveo-python-oss')
list(find_paths('pyproject.toml', search_from=find_repo_root(), in_root=True, in_children=True))
# [Path('/code/coveo-python-oss/pyproject.toml'), ...]
An opinionated version of subprocess.check_call
and subprocess.check_output
.
New in 2.0.7: asyncio support, through async_check_call
and async_check_output
.
Adds the following features:
from pathlib import Path
from coveo_systools.subprocess import check_call
check_call('mypy', '--config-file', Path('configs/mypy.ini'), verbose=True)
Good programming practices requires files to be saved using a temporary filename and then renamed. This helper takes it a step further by skipping the write operation if the content did not change:
import json
from pathlib import Path
from coveo_systools.filesystem import safe_text_write
safe_text_write(Path('./path/to/file.txt'), json.dumps(...), only_if_changed=True)
Readability is important, not repeating yourself is important.
Forget about platform.platform()
and use bools directly:
from coveo_systools.platforms import WINDOWS, LINUX, IOS, WSL
if WINDOWS or WSL:
print("Hello Windows!")
elif LINUX or IOS:
print("Hello Unix!")
FAQs
Filesystem, language and OS related tools.
We found that coveo-systools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.