Skip to main content

Overview

ip2instance iterates through multiple AWS accounts, assuming IAM Roles in each account using the STS AssumeRole function and fetches information about instances in those accounts.

Prerequisites

  • That ip2instance be run on an AWS ec2 instance with an IAM role which has rights to assume other roles

  • That the list of other roles in various foreign AWS accounts
    • have the permission to Describe instances

    • allow the role applied to the ec2 instance running ip2instance to assume the target role

Instructions on setting up these roles can be found here : https://github.com/mozilla/security/tree/master/operations/aws-security-auditor

Configuration

The ip2instance configuration file is located at /etc/ip2instance.yaml . To configure ip2instance create this file and populate it with your role_session_name and roles

role_session_name

The role_session_name is an “identifier for the assumed role session. The session name is included as part of the AssumedRoleUser” according to the AWS Documentation

roles

The roles is a list of ARNs of all IAM Roles in foreign AWS accounts which ip2instance should assume when searching for instances.

Example Configuration

Here is an example configuration for two foreign AWS accounts

role_session_name: ip2instance
roles:
- arn:aws:iam::123456789012:role/security-audit-role-SecurityAuditRole-12XHTR13TAWGH  # 293989542403 Finance
- arn:aws:iam::345678901234:role/security-audit-role-SecurityAuditRole-FLGUX9CF36X6   # 345678901234 Client Frontend Development Team

Usage

ip2instance > instance-list.txt

How to Build

Here’s how to build this into an RPM on a RHEL 6 derivative

sudo yum install http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo yum install rubygems ruby-devel gcc python-setuptools rpm-build
sudo easy_install pip
sudo gem install fpm
git clone https://github.com/gene1wood/ip2instance.git

cd ip2instance # This is required
fpm -s python -t rpm --workdir ../ ./setup.py

Metadata

Release files for ip2instance 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ip2instance 1.2.2
File Size Uploaded Provenance
ip2instance-1.2.2.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ip2instance 1.2.2
File Interpreter ABI Platform
ip2instance-1.2.2-py2-none-any.whl Python 2 none any Details

Total release size: 11.8 kB

Release files / ip2instance-1.2.2.tar.gz

Download URL ip2instance-1.2.2.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
347632d2b154a831b71f447da03a98c162bd4b955f466ee5a067e6318bfa3d11
BLAKE2b-256 checksum
How to use checksums
c9718f73e38c628b27144712546de87586336db9f6369bfad796348a5f3a5a0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ip2instance-1.2.2-py2-none-any.whl

Download URL ip2instance-1.2.2-py2-none-any.whl
Size 6.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
1541d6d89a15e43c79f689c00c4972e75a16fc293437054b0eaebe1c955c688d
BLAKE2b-256 checksum
How to use checksums
67f0e1e07c45e3711e7c0c33ef68c0a73206d9c3078c8cde4376f5493ccf2135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ip2instance 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page