LogoLogo
User GuideDeveloper DocumentationIntegrationsRelease Notes
  • 🏠Veza Documentation
  • ☑️Getting Started
  • 📖Veza Glossary
  • ❓Product FAQ
  • 🛡️Security FAQ
    • Advanced Security FAQ
  • Release Notes
    • 🗒️Release Notes
      • Release Notes: 2025-05-14
      • Release Notes: 2025-04-30
      • Release Notes: 2025-04-16
      • Release Notes: 2025-04-02
      • Release Notes: 2025-03-19
      • Archive
        • 2024.9.23
        • 2024.9.16
        • 2024.9.9
        • 2024.9.2
        • 2024.8.26
        • 2024.8.19
        • 2024.8.12
        • 2024.8.5
        • 2024.7.29
        • 2024.7.22
        • 2024.7.15
        • 2024.7.1
        • 2024.6.24
        • 2024.6.17
        • 2024.6.10
        • 2024.6.3
        • 2024.5.27
        • 2024.5.20
        • 2024.5.13
        • 2024.5.6
        • 2024.4.29
        • 2024.4.22
        • 2024.4.15
        • 2024.4.8
        • 2024.4.1
        • 2024.3.25
        • 2024.3.18
        • 2024.3.11
        • 2024.3.4
        • 2024.2.26
        • 2024.2.19
        • 2024.2.12
        • 2024.2.5
        • 2024.1.29
        • 2024.1.22
        • 2024.1.15
        • 2024.1.8
        • 2024.1.1
        • 2023.12.18
        • 2023.12.11
        • 2023.12.4
        • 2023.11.27
        • 2023.11.20
        • 2023.11.13
        • 2023.11.6
        • 2023.10.30
        • 2023.10.23
        • 2023.10.16
        • 2023.10.9
        • 2023.10.2
        • 2023.9.25
        • 2023.9.18
        • 2023.9.11
        • 2023.9.4
        • 2023.8.28
        • 2023.8.21
        • 2023.8.14
        • 2023.8.7
        • 2023.7.31
        • 2023.7.24
        • 2023.7.17
        • 2023.7.10
        • 2023.7.3
        • 2023.6.26
        • 2023.6.19
        • 2023.6.12
        • 2023.6.5
        • 2023.5.29
        • 2023.5.22
        • 2023.5.15
        • 2023.5.8
        • 2023.5.1
        • 2023.4.24
        • 2023.4.17
        • 2023.4.10
        • 2023.4.3
        • 2023.3.27
        • 2023.3.20
        • 2023.3.13
        • 2023.3.6
        • 2023.2.27
        • 2023.2.20
        • 2023.2.13
        • 2023.2.6
        • 2023.1.30
        • 2023.1.23
        • 2023.1.16
        • 2023.1.9
        • 2023.1.2
        • 2022.12.12
        • 2022.12.5
        • 2022.11.28
        • 2022.11.14
        • 2022.11.7
        • 2022.10.31
        • 2022.10.24
        • 2022.10.17
        • 2022.10.1
        • 2022.6.2
        • 2022.6.1
        • 2022.5.1
        • 2022.4.1
        • 2022.3.1
  • Features
    • 🔎Access Visibility
      • Graph
      • Query Builder
      • Saved Queries
      • Filters
      • Query Mode
      • Intermediate Entities
      • Regular Expressions
      • Tags
      • Tagged Entity Search
      • Assumed AWS IAM Roles
      • Veza Query Language
        • Quick Start
        • Syntax
        • VQL API
    • 💡Access Intelligence
      • Overview
      • Dashboards
        • Reports
        • Scheduled Exports of Query Results via a Secure Email Link
      • Risks
      • Analyze
      • Compare
      • Rules and Alerts
      • Entities
      • NHI Identify Classification Logic
      • NHI Secrets
    • 🔏Access Reviews
      • Get Started: Access Reviewers
      • Get Started: Review Operators
      • Access Review Tasks
        • Assign Reviewers
        • Create a Configuration
        • Create a Review
        • Draft Reviews
        • Edit a Configuration
        • Filters and Bulk Actions
        • Manage Access Reviews
        • Using the Reviewer Interface
        • Row Grouping for Access Reviews
        • Schedule an Access Review
      • Access Review Configuration
        • Access Reviews Query Builder
        • Access Reviews Global Settings
        • Configuring a Global Identity Provider
          • Alternate Manager Lookup
        • Customizing Default Columns
        • Email Notifications and Reminders
        • Identity Provider and HRIS Enrichment
        • Entity Owners and Resource Manager Tags
        • Multi-Level Review
        • 1-Step Access Reviews
        • On-Demand Reviews
        • Veza Actions for Access Reviews
        • Review Intelligence Policies
        • Review Presentation Options
        • Reviewer Selection Methods
        • Reviewer Digest Notifications
      • Access Review Scenarios
        • Access Reviews: Active Directory Security Groups
        • Access Reviews: Okta App Assignments
        • Access Reviews: Okta Group Membership
        • Access Reviews: Okta Admin Roles
        • Access Reviews: Azure AD Roles
        • Access Reviews with Saved Queries
        • Source-Only Access Reviews
    • 📊Access Monitoring
    • 🔄Lifecycle Management
      • Implementation and Core Concepts
      • Access Profiles
      • Policies
      • Conditions and Actions
      • Attribute Sync and Transformers
        • Lookup Tables
      • Integrations
        • Active Directory
        • Exchange Server
        • Okta
        • Salesforce
        • Workday
    • ⚖️Separation of Duties (SoD)
      • Managing SoD Risks with Veza
      • Creating SoD Detection Queries
      • Analyzing Separation of Duties Query Results
      • Example Separation of Duties Queries
      • SoD Manager Assignment
      • Access Reviews for SoD
  • Integrations
    • ✨Veza Integrations
      • Adobe Enterprise
      • Amazon Web Services
        • Add Existing AWS Accounts
        • Automatically Add New AWS Accounts
        • AWS DynamoDB
        • AWS KMS
        • AWS RDS MySQL
        • AWS RDS PostgreSQL
        • AWS Redshift
        • Activity Monitoring for AWS
        • Using AWS Secrets Manager for RDS Extraction
        • Notes & Supported Entities
      • Anaplan
      • Atlassian Cloud Products
      • Auth0
      • BambooHR
      • Bitbucket Data Center
      • BlackLine
      • Beeline
      • Boomi
      • Box
      • Bullhorn
      • Cassandra
      • Cisco Duo
      • Clickhouse
      • Concur
      • Confluence Server
      • Confluent
      • Coupa
      • Coupa Contingent Workforce
      • Crowdstrike Falcon
      • CSV Upload
        • CSV Upload Examples
        • CSV Upload Troubleshooting
        • CSV Upload API
      • Databricks (Single Workspace)
      • Databricks (Unity Catalog)
      • Delinea Secret Server
      • Device42
      • DocuSign
      • Dropbox
      • Egnyte
      • Expensify
      • Exchange Online (Microsoft 365)
      • Fastly
      • Google Cloud
        • Check Google Cloud Permissions
        • Notes & Supported Entities
      • Google Drive
      • GitHub
      • GitLab
      • HashiCorp Vault
      • HiBob
      • Hubspot
      • IBM Aspera
      • iManage
      • Ivanti Neurons
      • Jamf Pro
      • Jenkins
      • JFrog Artifactory
      • Jira Data Center
      • Kubernetes
      • LastPass
      • Looker
      • MongoDB
      • Microsoft Active Directory
      • Microsoft Azure
        • Azure SQL Database
        • Azure PostgreSQL Database
        • Microsoft Dynamics 365 CRM
        • Microsoft Dynamics 365 ERP
        • Notes & Supported Entities
      • Microsoft Azure AD
      • Microsoft SharePoint Online
      • Microsoft SharePoint Server
      • Microsoft SQL Server
      • MuleSoft
      • MySQL
      • NetSuite
      • New Relic
      • Okta
        • Okta MFA status
      • OneLogin
      • OpenAI
      • Oracle Cloud Infrastructure
      • Oracle Database
      • Oracle Database (AWS RDS)
      • Oracle E-Business Suite (EBS)
      • Oracle EPM
      • Oracle Fusion Cloud
      • Oracle JD Edwards EnterpriseOne
      • PagerDuty
      • Palo Alto Networks SASE/Prisma Access
      • PingOne
      • PostgreSQL
      • Power BI
      • Privacera
      • PTC Windchill
      • Qualys
      • QNXT
      • Ramp
      • Redis Cloud
      • Rollbar
      • Salesforce
      • Salesforce Commerce Cloud
      • SCIM integration
      • ServiceNow
      • Slack
      • Smartsheet
      • Snowflake
        • Snowflake Native Application
        • Snowflake Row Access Policies
        • Snowflake Masking Policies
        • Exporting Saved Query Results to Snowflake
        • Audit Log Export
        • Event Export
      • Solarwinds
      • Spotio
      • Sumo Logic
      • Tableau Cloud
      • Teleport
      • Terraform
      • ThoughtSpot
      • Trello
      • Trino (PrestoSQL)
      • UKGPro
      • Veza
      • Windows Server
        • Enterprise Deployment
      • Workato
      • Workday
      • YouTrack
      • Zendesk
      • Zip
      • Zoom
      • Zscaler
      • 1Password
    • 🎯Integrations Overview
    • ⚠️Prerequisites and Connectivity
      • Insight Point
        • Deploying an Insight Point using the install script
        • Deploy with AWS EC2
        • Deploy with Virtual Appliance
          • Deploy with Virtual Appliance (Legacy)
        • Deploy with Azure Container Instances
        • Insight Point (Helm Chart)
      • Certificates with OpenSSL
    • ⚙️Configuring Integrations
      • Integrations FAQ
      • Extraction and Discovery Intervals
      • Custom Identity Mappings
      • Limiting Extractions
      • Enrichment Rules
      • ℹ️Running Veza Scripts with Python
  • Administration
    • 🛠️Veza Administration
      • Securing Your Veza Tenant
      • Veza Actions
        • Slack
        • ServiceNow
        • Jira
        • Webhooks
      • Virtual Private Veza
      • System Events
      • Sign-In Settings
        • Single Sign-On with Okta
        • Single Sign-On with Okta (OIDC)
        • Single Sign-On with Microsoft Entra
      • User Management
        • Multi-factor Authentication
        • Team Management
        • Support User Access
  • Developers
    • 🌐Veza APIs
      • Authentication
      • Troubleshooting
      • Pagination
      • Open Authorization API
        • Getting Started
        • Core Concepts
          • Connector Requirements
          • Using OAA Templates
          • Providers, Data Sources, Names and Types
          • Sourcing and Extracting Metadata
          • Naming and Identifying OAA Entities
          • Modeling Users, Permissions, and Roles
          • Custom Properties
          • Tagging with OAA
          • Cross Service IdP Connections
          • Incremental Updates
        • OAA Push API
          • OAA Operations
        • OAA Templates
          • Custom Application
          • Custom Identity Provider
          • Custom HRIS Provider
        • OAA .NET SDK
          • C# OAA Application Connector
        • OAA Python SDK
          • Application Outline
          • oaaclient modules
            • Client
            • Structures
            • Templates
            • Utils
        • Sample Apps
        • Example Connectors
      • Integration APIs
        • Enable/Disable Providers
        • Cloud Platforms and Data Providers
        • Identity Providers
        • Data Sources
        • Sync and Parse Status
      • Query APIs
        • Quick Start
        • Query Builder Terminology
        • Query Builder Parameters
        • Query Builder Results
        • List saved queries
        • Save a query
        • Get a saved query
        • Update a query
        • Delete a query
        • Get query node destinations
        • Get query nodes
        • Get query result
        • Get query spec node destinations
        • Get query spec nodes
        • Get query spec results
        • Private APIs
          • Get Access Relationship
          • Role Existence
          • Role Maintenance
          • Cohort Role Analysis
        • Tags
          • Create, Add, Remove Tag
          • Promoted Tags
      • Access Reviews APIs
        • Workflow Parameters Reference
        • List Workflows
        • List Certifications
        • List Certification Results
        • Update Certification Result
        • Force Update Result
        • Update Webhook Info
        • Get Certification Result
        • Manage Reviewer Deny List
        • Quick Filters
        • Help Page Templates
        • Smart Action Definitions
        • Delegate Reviewers
        • List Reviewer Infos
        • Get Access Graph
        • Automations API
        • Global Settings APIs
      • System Audit Logs
      • System Events
      • Notification Templates
        • Notification Templates API
      • Team and User Management APIs
        • Team API Keys
      • SCIM Provisioning
        • SCIM API Reference
        • SCIM Provisioning with Okta
  • Product Updates
    • 🆕Product Updates
      • Product Update: March'25
      • Product Update: February'25
      • UX Update - Integration Management
      • Product Update: January'25
      • Product Update: December'24
      • Product Update: November'24
      • Product Update: October'24
      • Product Update: September'24
      • Product Update: August'24
      • UX Update: Veza Integrations
      • Product Update: July'24
      • Product Update: June'24
      • Product Update: May'24
      • Product Update: April'24
      • UX Update - Enhanced Reviewer Experience for Veza Access Reviews
      • Product Update: March'24
      • Product Update: February'24
      • Design Update: February'24
      • UX Update - New Navigation Experience
      • UX Update - Access Review Dashboards
      • Building Veza’s Platform and Products
      • Veza Product Update - Jan'24
      • Veza Product Update - 2H 2023
      • Veza Product Update - December'23
      • Veza Product Update - November'23
      • Veza Product Update - October'23
      • Veza Product Update - September'23
      • Veza Product Update - August'23
      • Veza Product Update - July'23
      • Veza Product Update - June'23
      • Veza Product Update - May'23
      • Veza Product Update - April'23
      • Veza Product Update - March'23
      • Veza Product Update - Feb'23
      • Veza Product Update - Jan'23
Powered by GitBook
On this page
  • Linux
  • Windows
  • Mac

Was this helpful?

Export as PDF
  1. Integrations
  2. Configuring Integrations

Running Veza Scripts with Python

Veza Python Script Setup and Execution Guide for Linux, Windows, and Mac

This document provides instructions for setting up and running Veza Python scripts on Linux, Windows, and Mac operating systems. Users seeking to automate Veza Python scripts on different platforms can refer to the sections below to learn about:

  • Verifying Python Installations

  • Installing Required Packages

  • Setting Environment Variables

  • Executing Scripts

  • Scheduling Periodic Script Runs

  • Setting Temporary and Persistent Environment Variables

These instructions are especially intended to help run and schedule Open Authorization API connectors provided as Python packages.

Linux

Setup

Verify Python3 Installation

Many current Linux distributions typically have python3 installed by default.

To verify that python3 is installed on your system, run the following command:

which python3
which pip3

If the outputs are filesystem paths (ex: /usr/bin/python3), the applications are installed.

Installing Required Packages

Veza Python scripts may rely on external dependencies; if this is the case, the script package will include a requirements.txt file.

To ensure that the dependencies are installed, run the following command from the directory in which the requirements.txt file is located:

pip3 install -r requirements.txt

Setting Environment Variables

Veza Python scripts often require some variable input at run time (ex: API key, service URL).

Non-secret data can be passed to the script as arguments or set as environment variables, but sensitive data must be set as an environment variable.

See the README.md packaged with a script for a description of required input data.

Temporary Environment Variables

Environment variables can be set temporarily from the Linux shell; these settings will last until the shell process in which they are set is terminated.

To temporarily set an environment variable from the Linux shell, run the following command:

export <variable_name>="<value>"

An example setting VEZA_URL to the FQDN of a Veza instance:

export VEZA_URL="https://example.vezacloud.com"

To verify currently set environment variables and their values, run the env command from the terminal.

To remove a currently set environment variable, run the following command:

unset <variable_name>

Unsetting the previously established VEZA_URL example:

unset VEZA_URL

Persistent Environment Variables

Environment variables can be set persistently in several ways, each with their own scope.

In each case, edit the relevant file and add the following line to set the new variable:

export <variable_name>="<value>"
  • To set a persistent environment variable for only the currently logged-on user, edit ~/.bashrc and add the export to the end of the file.

  • To set a variable for all login shell sessions, edit /etc/profile and add the export to the end of the file.

  • To set a system-wide variable, edit /etc/environment and add the export to the end of the file.

Current shell sessions will not reflect the file update immediately - to make use of the newly set variable, source the file first:

source ~/.bashrc

Execution

To run the Veza Python script, chmod the file to make it executable, then execute it:

chmod +x <script_name>.py
./<script_name>.py

To pass additional parameters not set as environment variables when executing the script:

./<script_name>.py --<parmeter1_name> <parameter1_value> --<flag_parmeter>

An example of setting a parameter with a value along with a flag parameter:

./veza_script.py --veza_url https://example.vezacloud.com --debug

Scheduling

Periodic executions of scripts can be configured to run via cron or via systemd, depending on your environment.

Cron

Scheduling via cron requires a line to be added to the crontab.

Note: cron executes commands without a login shell; environment variables set in ~/.bashrc or /etc/profile will not be loaded.

To edit the crontab, run crontab -e, then add the following:

VEZA_URL="https://example.vezacloud.com"
VEZA_API_KEY="k124c021...fc1d281"
0 * * * * /usr/bin/python3 /path/to/<veza_script.py>

Some distributions do not honor environment variables set in the crontab file; in those cases, they can be set inline:

0 * * * * root env VEZA_URL="https://example.vezacloud.com" VEZA_API_KEY="k124c021...fc1d281" /usr/bin/python3 /path/to/<veza_script.py>

Systemd

Scheduling via systemd requires a timer unit file and a corresponding service unit file.

Begin by creating the timer unit file (vim /etc/system/systemd/<veza_script>.timer):

[Unit]
Description=Execute Veza Python Script Every Hour

[Timer]
OnCalendar=daily

Unit=<veza_script>.service

[Install]
WantedBy=timers.target

Then create the service file (vim /etc/system/systemd/<veza_script>.service):

[Unit]
Description=Veza Python Script Service

[Service]
# Environment variables can be defined here
Environment=VEZA_URL="https://example.vezacloud.com"
Environment=VEZA_API_KEY="k124c021...fc1d281"
Type=simple
ExecStart=/usr/bin/python3 /path/to/<veza_script.py>

[Install]
WantedBy=multi-user.target

Run the following commands to reload service definitions and enable the new service:

systemctl daemon-reload
systemctl enable <veza_script>.service
systemctl start <veza_script>.service

Windows

Setup

Verify Python Installation

Note: During installation, ensure the Add python.exe to PATH checkbox is selected.

To ensure that python and pip are properly installed and added to the PATH, open a Command Prompt and run:

where python
where pip

Both commands will return paths on the filesystem if the executables are located.

Installing Required Packages

Veza Python scripts may rely on external dependencies; if this is the case, the script package will include a requirements.txt file.

To ensure that the dependencies are installed, run the following command from the directory in which the requirements.txt file is located:

pip install -r requirements.txt

Setting Environment Variables

Temporary Environment Variables

Command Prompt

To set an environment variable for an existing Command Prompt session, run the following:

set <variable_name>=<value>

An example setting VEZA_URL to the FQDN of a Veza instance:

set VEZA_URL="https://example.vezacloud.com"

To remove the previously set VEZA_URL example:

set VEZA_URL=

PowerShell

To set an environment variable for an existing PowerShell session, run the following:

$env:<variable_name> = '<value'

An example setting VEZA_URL to the FQDN of a Veza instance:

$env:VEZA_URL = 'https://example.vezacloud.com'

To remove the previously set VEZA_URL example:

Remove-Item env:\VEZA_URL

Persistent Environment Variables

To set environment variables on a Windows system, follow these steps:

  • On the taskbar, right-click the Windows icon and click System

  • In the Settings window, locate and click Advanced system settings

  • In the System Properties window that appears, click the Environment Variables button near the bottom.

  • In the Environment Variables window that appears, choose the scope for the new variable. User-specific variables are listed at the top of the window with system-wide variables below.

  • Click the New button underneath the appropriate scope.

  • Complete the New System Variable dialog that appears, providing a Variable name and Variable value, then click OK Note: no quotes are required for complex variable values when set via this method

Current Command Prompt and PowerShell sessions will not update immediately - to make use of the newly set variable, start a new Command Prompt or PowerShell session.

Execution

To run the Veza Python script, open a Command Prompt window and execute the following:

python <script_name>.py

To pass additional parameters not set as environment variables when executing the script:

./<script_name>.py --<parmeter1_name> <parameter1_value> --<flag_parmeter>

An example of setting a parameter with a value along with a flag parameter:

./veza_script.py --veza_url https://example.vezacloud.com --debug

Scheduling

Periodic executions of scripts can be configured via the Task Scheduler interface on Windows.

Note: ensure that any required environment variables have been stored as system-wide variables before scheduling a task that utilizes them. Also stop the Taskeng.exe process to force Task Scheduler to reload environment variables.

  • In the search bar, type Task Scheduler, then click on the search result to open the interface.

  • In the Actions pane on the right side of the window, click Create Basic Task

  • In the Create Basic Task Wizard, provide the following:

    • Name: A name for the scheduled task

    • Description: An optional longer description of what the task does

    • Trigger: Select a time-based trigger (Daily)

    • Daily time settings for task triggering

    • Program/script: Enter or browse to the installation location of the python executable

      • Add arguments: <script_name>.py --<parameter1_name> <parameter1_value>

      • Start in: c:\path\to\script\

Mac

Setup

Verify Python3 Installation

To install python3 on MacOS, ensure that Homebrew is installed and run the following command:

brew install python

To verify that python3 is installed on your system, run the following command:

which python3
which pip3

If the outputs are filesystem paths (ex: /usr/local/bin/python3), the applications are installed.

Installing Required Packages

Veza Python scripts may rely on external dependencies; if this is the case, the script package will include a requirements.txt file.

To ensure that the dependencies are installed, run the following command from the directory in which the requirements.txt file is located:

pip3 install -r requirements.txt

Setting Environment Variables

Veza Python scripts often require some variable input at run time (ex: API key, service URL).

Non-secret data can be passed to the script as arguments or set as environment variables, but sensitive data must be set as an environment variable.

See the README.md packaged with a script for a description of required input data.

Temporary Environment Variables

Environment variables can be set temporarily from the Linux shell; these settings will last until the shell process in which they are set is terminated.

To temporarily set an environment variable from the Linux shell, run the following command:

export <variable_name>="<value>"

An example setting VEZA_URL to the FQDN of a Veza instance:

export VEZA_URL="https://example.vezacloud.com"

To verify currently set environment variables and their values, run the env command from the terminal.

To remove a currently set environment variable, run the following command:

unset <variable_name>

Unsetting the previously established VEZA_URL example:

unset VEZA_URL

Persistent Environment Variables

Environment variables can be set persistently in several ways, each with their own scope.

In each case, edit the relevant file and add the following line to set the new variable:

export <variable_name>="<value>"
  • To set a persistent environment variable for only the currently logged-on user, edit ~/.zshrc and add the export to the end of the file.

  • To set a variable for all login shell sessions, edit /etc/profile and add the export to the end of the file.

Current shell sessions will not reflect the file update immediately - to make use of the newly set variable, source the file first:

source ~/.zshrc

Execution

To run the Veza Python script, chmod the file to make it executable, then execute it:

chmod +x <script_name>.py
./<script_name>.py

To pass additional parameters not set as environment variables when executing the script:

./<script_name>.py --<parmeter1_name> <parameter1_value> --<flag_parmeter>

An example of setting a parameter with a value along with a flag parameter:

./veza_script.py --veza_url https://example.vezacloud.com --debug

Scheduling

Cron

Scheduling via cron requires a line to be added to the crontab.

Note: cron executes commands without a login shell; environment variables set outside of the crontab will not be loaded.

To edit the crontab, run crontab -e, then add the following:

VEZA_URL="https://example.vezacloud.com"
VEZA_API_KEY="k124c021...fc1d281"
0 * * * * /usr/bin/python3 /path/to/<veza_script.py>
PreviousEnrichment RulesNextVeza Administration

Last updated 1 year ago

Was this helpful?

Install python by browsing to and selecting the latest stable 64-bit installer.

Alternatively, on Windows workstations, Python may be installed via the Microsoft Store. See for details.

⚙️
ℹ️
https://www.python.org/downloads/windows/
https://learn.microsoft.com/en-us/windows/python/beginners