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.
Wrapper for AWS CLI v2.
awscliv2
binariesawscliv2.api.AWSAPI
awsv2 --install
python -m pip install awscliv2
You can add an alias to your ~/.bashrc
or ~/.zshrc
to use it as a regular AWS CLI v2
alias aws='awsv2'
Install AWS CLI v2
:
# do not worry if this fails, you can still use awsv2 if you have docker installed
awsv2 --install
Configure default profile if needed:
AWS_ACCESS_KEY_ID='my-access-key'
AWS_SECRET_ACCESS_KEY='my-secret-key'
# --configure <profile_name> <aws_access_key_id> <aws_secret_access_key> [<aws_session_token>]
awsv2 --configure default ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY}
awsv2 configure set region us-west-1
Use AWS CLI
as usual:
# alias for
# docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli $@
awsv2 s3 ls
# or as a python module
python -m awscliv2 s3 ls
Also, you can check scripts/example.sh
Unless you run awsv2 --install
once, application will use amazon/aws-cli Docker image. The image is not ideal, and it uses root
user, so fix downloaded file permissions manually. Or just run awsv2 --install
Update it with docker pull amazon/aws-cli
.
Container uses two volumes:
$HOME/.aws
-> /root/.aws
- credentials and config store$(cwd)
-> /aws
- Docker image workdirawscliv2
contains a few commands to make your life easier, especially in CI or any non-TTY environment.
awsv2 -U/--update/--install
- Install AWS CLI v2
awsv2 --configure <profile_name> <aws_access_key_id> <aws_secret_access_key> [<aws_session_token>] [<region>]
- set profile in ~/.aws/credentials
awsv2 --assume-role <profile_name> <source_profile> <role_arn>
- create a new profile with assume role credentialsawsv2 -V/--version
- Output awscliv2
and AWS CLI v2
versionsBasic usage
from awscliv2.api import AWSAPI
from awscliv2.exceptions import AWSCLIError
aws_api = AWSAPI()
try:
output = aws_api.execute(["s3", "ls"])
except AWSCLIError as e:
print(f"Something went wrong: {e}")
else:
print(output)
Install binaries for your OS from Python
from awscliv2.installers import install_multiplatform
install_multiplatform()
You can also set credentials or assume roles
from awscliv2.api import AWSAPI
aws_api = AWSAPI()
aws_api.set_credentials(
profile_name="my_profile",
aws_access_key_id="access_key",
aws_secret_access_key="secret_key",
region="us-east-1",
)
aws_api.assume_role(
profile_name="my_profile",
source_profile="source_profile",
role_arn="role_arn",
)
poetry install
black
formatter in your IDEawscliv2
version follows PEP 440.
Full changelog can be found in Releases.
FAQs
Wrapper for AWS CLI v2
We found that awscliv2 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.