Skip to main content

Python matos gcp provider

Project description

Unit Test Pylint

matos-gcp-provider

The 'matos-gcp-provider' is an open-source python package for developing security tools to identify threats in your Google Cloud Platform (GCP) infrastructure. It uses the service providers Cloud SDK to deduce the current state and metadata of the underlying services.

Quickstart

  1. Clone this repository.
  2. Create a virtualenv and activate.
  3. Install requirement packages inside install_requires list of setup.py list.
  4. Sample demo, import working folder into path src\matos_gcp_provider
from matos_gcp_provider.provider import Provider 
#credential can be import by either input dict or json load inside /credentials folder
dummy_credential = {
  "tenantId": "",
  "clientId": "",
  "clientSecret": "",
  "subscription_id": ""
}
# construct provider object, optional resource type for select specific resource
provider = Provider(dummy_credential=dummy_credential, resource_type="")
# asset discover 
assets = provider.get_assets()
# fetching resource details 
resources = provider.get_resource_inventories(assets)
  1. Run prebuild package environment and unit test:
    python -m pip install -U tox
    python -m tox -e py
    
  2. Build local wheel file
    python -m pip install -U setuptools wheel build
    python -m build .
    

Add resource api plugin

  • resource provider register through plugin design pattern, adding new plugin inside plugins folder
  • Example resource and register step
class SamplePlugin(BaseProvider):
    """service plugins

    Args:
        BaseProvider (Class): base provider class
    """
    def __init__(self, resource: Dict, **kwargs) -> None:
        """
        Construct cluster service
        """
        super().__init__(**kwargs)

    def get_inventory(self) -> Any:
        """
        Service discovery
        """
        pass
    
def register() -> Any:
    """Register plugins type"""
    factory.register("resource_type", SamplePlugin)

Version handling and publish release

  • Version is managed through bumpversion. Command to update new version, setup.py and .bumpversion.cfg will auto update
    bumpversion major|minor|patch --allow-dirty(optional)
    

Project details


Download files

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

Source Distribution

matos-gcp-provider-1.0.12.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

matos_gcp_provider-1.0.12-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file matos-gcp-provider-1.0.12.tar.gz.

File metadata

  • Download URL: matos-gcp-provider-1.0.12.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for matos-gcp-provider-1.0.12.tar.gz
Algorithm Hash digest
SHA256 f40a24f401e9ca299319d5f1f8152512155ac58af784b1030c2b0a279e7e2332
MD5 1091ea1c13c0899f30cf9dedd5ba3027
BLAKE2b-256 d0f749ad05a465ac2ecbb5ced7cf718177975989bba2a12a4047c41fe081f762

See more details on using hashes here.

File details

Details for the file matos_gcp_provider-1.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for matos_gcp_provider-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 ba8db3c58ef084733224df4b0e94c06bd0863a9899e037f6a183c20ab9c067c1
MD5 b0b03359a16db5c0e1c6f4c7c08609ba
BLAKE2b-256 421a03e9e74d8bad6c07e0e551726463d7d920ef2f31d141be8e23d971cfa385

See more details on using hashes here.

Supported by

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