Skip to content

netfoundry/zitified-mammoth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zitified-mammoth

zitified-mammoth provides an example of zitifying the Mammoth Python SDK mm-pysdk to encapsulate the API calls over a NetFoundry Zero Trust Overlay. This demo assumes that you have a Mammoth account and have the ability to create an api key pair

Setup and Configure the Example

Diagram

Create or use an existing ziti network with at least one NF hosted edge router. This can be accomplished using the NetFoundry Console.

  1. Create an ubuntu 24.04 vm in AWS or other location with internet access a. install prereqs

    sudo apt update

    sudo apt upgrade

    sudo apt install python3-pip python3-venv git

    b. ## Build the Example On the linux system that will run the Client clone the repo mkdir ~/repos cd ~/repos git clone https://github.com/netfoundry/zitified-mammoth.git cd zitified-mammoth/src

  2. Create and enroll a ziti identity place the identity json file in the ~/repos/zitified-mammoth/src on the VM created in step 1.

    a. mammoth_client01
    
  3. Add a customer hosted edge router e.g. "us-east-2-mammoth-edge01" to your network

Diagram

  1. Launch the customer hosted edge-router in aws region e.g. us-east-2 follow: https://support.netfoundry.io/hc/en-us/articles/ 360016342971-Deployment-Guide-for-AWS-Edge-Routers

  2. Create a NF service named "mammoth-api-service" and use wildcard address "*.mammoth.io" , protocol TCP and 443 as the port. Assign the router identity e.g. us-east-2-mammoth-edge01 as the hosting entity and forward address, protocol and port to yes.

Diagram

  1. Create a service policy to bind the identity to the NF service e.g.

Diagram

  1. Create a router policy and with the NF hosted edge-router and the mammoth_client01 as the identity e.g.

Diagram

  1. On the VM created in step one.

    a. Create a python virtual environment

    cd ~/repos/zitified-mammoth/src

    python3 -m venv mmsdk

    source mmsdk/bin/activate

    b. Install openziti and mammoth modules

    pip3 install openziti

    pip3 install git+ssh://git@github.com/EdgeMetric/mm-pysdk.git

    c. Enter Mammoth api key and secret as environmental variables e.g.

    export MAMMOTH_API_KEY="<key text>"
    export MAMMOTH_API_SECRET="<secret text>"
    

    d. Execute the script

    python3 zmammoth.py --ziti-identity zmammoth.json --upload-csv-file iris.csv --download-csv-file output.csv --workspace-id 5XXX --project-id 1XXX

    Sample output:

    Loading the OpenZiti identity...
    Initializing Mammoth API Client for workspace 5XXX...
    Setting project id to 1XXX
    Confirmed project_id = 1XXX
    Uploading iris.csv...
    Dataset created with id = 2XXXXY
    Retrieving list of dataviews...
    Dataview Name = View 1, Dataview Id = 2XXXXZ, Associated Dataset = 2XXXXY
    Downloading dataview id 2XXXXXZ of dataset id 2XXXXY to output.csv...
    Waiting for export job 14112885 to complete...
    Download URL: https://filesmammoth104.mammoth.io/temp_export_2XXXXY_2XXXXZ.csv
    Downloaded dataview CSV to output.csv
    

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages