Skip to main content

No project description provided

Project description

Quality Gate Status Coverage

aws-iam-mapper

When working on long lived environments, understanding the state of access is paramount to ensure least privelege. Over time access needs can change with existing permissions no longer needed. In order to adhere to the least privilege principle regular access reviews are needed to maintain an active security posture.

The core focus of this tool is to support organisations / account managers where the access controls have not been built in a centralised manner, resulting in a greater complexity to decipher access controls. For example instead of being centralised under IAM Roles or Lake Formation, decentralised resource policises such as S3 bucket policies could have been used.

Running aws-iam-map

This tool is configured to either run as a commandline tool either locally with a direct pip install or via docker.

#Python package via Pypi
python3 -m pip install awsiammapper
python3 -m awsiammapper -h

#Docker
docker run awsiammapper -h

Access Requirements

The tool requires read only access limited to listing resources and getting associated policies.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AwsIamMapper",
      "Action": [
        "s3:GetBucketPolicy",
        "s3:ListBucket"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}

Supporting new resouces

The IAM Mapper tool is built with extendability in mind, to add a new resource type add a new class within the clients.py module adhearing the the BaseClient interface. To then make it available the service needs to be added to the factory dictionary within the mapper.py module.

#awsiammapper.client
class BaseClient:
    """interface to AWS Services to list specific resources and their policies"""

    def list(self) -> list[str]:
        """list - list resources (does not use pagination)"""
        raise NotImplementedError()

    def get_policies(self, resources, exit_on_error=True):
        """get_policies - get a list of policies for each resources"""
        raise NotImplementedError()
#awsiammapper.mapper
clients = {"s3": S3Client}

Currently clients are written predominently as a boto3 wrapper making requests to AWS to retreive live information. This however is not strictly necessary although gives the truest snapshot in time of identity access mappings. Alternatively a client could be written to interpret sources code such as Terraform or CloudFormation.

Roadmap (Priority Items)

The priorisation of this tool from a personal perspective has bias towards prioritising data related services. Having said that happy to accept changes to any AWS Services given it is flexible to be extended a technical perspective. Longer term this tool may spread across multiple cloud services or I may buid a dedicated one per major cloud providers.

# overview value
0 IAM Service coverage increase - most access management controls are configured centrally within IAM
1 LakeFormation coverage increase - Data services leverage LakeFormation to manage access to datasets
2 Glue ecosystem coverage increase - core AWS Data Service

Development Approach

Repository setup

This project utilises Python 3.10 and Poetry with Pre-commit to management code checks.

poetry shell #activates local shell
poetry install #install project dependencies (including dev)

pre-commit install #add precommit hooks
pre-commit run --all-files #check repo state

Git

Trunk based Git branch strategy.

Tooling

  • GitHub Actions
  • Snyk
  • SonarCloud
  • DockerHub

Raise an issue

If there is a bug or change request please raise them on the associated GitHub board.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awsiammapper-0.1.5-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file awsiammapper-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: awsiammapper-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for awsiammapper-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 49fcd0cfaec08b2fd13346881a2100cbd9a68b7e24749834e1fce4b33f540294
MD5 0f9889742cca998f6830b28e534b9751
BLAKE2b-256 83055a8019e7c68aeeb8df0045d212eca47a6dfae9d18a4e10ecd6ff011b0843

See more details on using hashes here.

Provenance

The following attestation bundles were made for awsiammapper-0.1.5-py3-none-any.whl:

Publisher: release.yml on Joncpaske/aws-iam-mapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page