Python matos gcp provider
Project description
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
- Clone this repository.
- Create a virtualenv and activate.
- Install requirement packages inside install_requires list of setup.py list.
- 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)
- Run prebuild package environment and unit test:
python -m pip install -U tox python -m tox -e py
- 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
pluginsfolder - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f40a24f401e9ca299319d5f1f8152512155ac58af784b1030c2b0a279e7e2332
|
|
| MD5 |
1091ea1c13c0899f30cf9dedd5ba3027
|
|
| BLAKE2b-256 |
d0f749ad05a465ac2ecbb5ced7cf718177975989bba2a12a4047c41fe081f762
|
File details
Details for the file matos_gcp_provider-1.0.12-py3-none-any.whl.
File metadata
- Download URL: matos_gcp_provider-1.0.12-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba8db3c58ef084733224df4b0e94c06bd0863a9899e037f6a183c20ab9c067c1
|
|
| MD5 |
b0b03359a16db5c0e1c6f4c7c08609ba
|
|
| BLAKE2b-256 |
421a03e9e74d8bad6c07e0e551726463d7d920ef2f31d141be8e23d971cfa385
|