Tools written in Python can use the built-in
ast module to parse and analyze other Python code into an “Abstract Syntax Tree“.
Flake8, PyFlakes, PyLint, Radon, or another tool that provides style checking, lint discovery, or complexity computation. They all use the AST to provide that functionality.
There’s also a tool called Bandit that uses the AST to provide static security analysis of Python programs.
pip install bandit
# Or if you're working with a Python 3 project
pip3 install bandit
bandit -r path/to/your/code
Bandit scans our files for any known vulnerabilities and then provides us with explicit feedback about what it found, the severity of the problem, and how confident it is in its discovery.
sudo update-alternatives –config editor
Find the servers on which playbooks exectuion are failing [you can find the failed servers list in site.retry]
Find the name of the tasks that are failing from the ansible playbook execution output.
Open the playbook
Go to the failing task, study/understand what the task is about and if the task is dependent on other tasks then study those too.
Use ansible register module with the failing tasks to store the output of task into a variable.
Use ansible Debug module to get the output.
Use ansible tags for the failing tasks.
Execute the playbook on the failed servers using “–limit” option.
Eg: ansible-playbook -i inventory playbook.yml –limit “failed-server1:failed-server2” –tags “tag-name1,tag-name2”
sudo apt-get install python-pip -y
sudo pip install boto3
Follow these steps from the command line to install the AWS CLI using the bundled installer.
To install the AWS CLI using the bundled installer
- Download the AWS CLI Bundled Installer.
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
- Unzip the package.
If you don’t have
unzip, use your Linux distribution’s built in package manager to install it.
- Run the install executable.
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
The above steps as mentioned in the article http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html, worked for me but when I tried “pip install awscli –upgrade –user” on my mac book, the installation went fine but not sure why I was unable to use the cli command “aws”.
$ aws configure
give your aws-key-id and aws-secret-key