{"id":37709727,"url":"https://github.com/cdot65/pan-os-typescript","last_synced_at":"2026-01-16T13:17:15.757Z","repository":{"id":213562724,"uuid":"734408937","full_name":"cdot65/pan-os-typescript","owner":"cdot65","description":"TypeScript SDK for PAN-OS and Panorama appliances","archived":false,"fork":false,"pushed_at":"2024-01-07T18:17:37.000Z","size":1329,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-23T14:21:54.291Z","etag":null,"topics":["firewall","networkautomation","networksecurity","paloaltonetworks","pan-os","sdk","typescript"],"latest_commit_sha":null,"homepage":"https://cdot65.github.io/pan-os-typescript/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdot65.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-21T15:53:44.000Z","updated_at":"2024-04-23T14:21:54.292Z","dependencies_parsed_at":"2024-01-06T14:43:53.506Z","dependency_job_id":null,"html_url":"https://github.com/cdot65/pan-os-typescript","commit_stats":null,"previous_names":["cdot65/pan-os-typescript"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cdot65/pan-os-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdot65%2Fpan-os-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdot65%2Fpan-os-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdot65%2Fpan-os-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdot65%2Fpan-os-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdot65","download_url":"https://codeload.github.com/cdot65/pan-os-typescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdot65%2Fpan-os-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firewall","networkautomation","networksecurity","paloaltonetworks","pan-os","sdk","typescript"],"created_at":"2026-01-16T13:17:14.073Z","updated_at":"2026-01-16T13:17:15.747Z","avatar_url":"https://github.com/cdot65.png","language":"TypeScript","readme":"# 🌐 Panos TypeScript SDK\n\n![Stage](https://img.shields.io/badge/stage-alpha-blue.svg)\n![Version](https://img.shields.io/badge/version-0.0.9-blue.svg)\n![Language](https://img.shields.io/github/languages/top/cdot65/pan-os-typescript?color=blue\u0026label=TypeScript)\n\n- [🌐 Panos TypeScript SDK](#-panos-typescript-sdk)\n  - [🚀 Introduction](#-introduction)\n  - [🌟 Features](#-features)\n  - [📦 Installation](#-installation)\n  - [📖 Detailed Documentation](#-detailed-documentation)\n  - [📚 Quick Examples](#-quick-examples)\n    - [Generating an API key](#generating-an-api-key)\n    - [Requesting System Info](#requesting-system-info)\n  - [🤝 Contributing](#-contributing)\n  - [📄 License](#-license)\n  - [✉️ Contact](#️-contact)\n\n## 🚀 Introduction\n\nPanos TypeScript SDK is a modern library tailored for interacting with Palo Alto Networks firewalls and Panorama appliances. It facilitates task automation, configuration management, and data retrieval from PAN-OS devices with a focus on ease of use and modularity.\n\n## 🌟 Features\n\n- 🔑 Simplified API key generation.\n- 🛠️ Convenient methods for PAN-OS operations.\n- 🌐 Compatibility with major web frameworks like Angular and React.\n- 🧩 Modular and structured service and interface design.\n\n## 📦 Installation\n\n```bash\nnpm i pan-os-typescript\n```\n\n## 📖 Detailed Documentation\n\nFor comprehensive API documentation, including usage examples, configuration details, and service descriptions, visit our [GitHub Pages](https://cdot65.github.io/pan-os-typescript/).\n\n## 📚 Quick Examples\n\nExamples can be found in the [tests/](tests/) directory.\n\n### Generating an API key\n\n```typescript\nimport { ApiKeyGenerator } from '../src/index';\nimport dotenv from 'dotenv';\nimport { hideBin } from 'yargs/helpers';\nimport logger from '../src/utils/logger';\nimport yargs from 'yargs';\n\n/**\n * Loads environment configuration based on the NODE_ENV setting.\n * Configures the script to use either production or development environment variables.\n */\ndotenv.config({\n  path: process.env.NODE_ENV === 'production' ? '.env.prod' : '.env.dev',\n});\n\n/**\n * Defines the structure for command-line arguments used in the script.\n */\ninterface Arguments {\n  logLevel: string;\n  hostname: string;\n  password: string;\n  username: string;\n}\n\n/**\n * Parses command-line arguments to configure the script's runtime settings.\n * Allows setting of log level, hostname, username, and password.\n */\nconst argv = yargs(hideBin(process.argv))\n  .options({\n    logLevel: {\n      type: 'string',\n      default: 'info',\n      choices: ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'],\n      description: 'Set the logging level',\n    },\n    hostname: {\n      type: 'string',\n      default: process.env.PANOS_HOSTNAME || 'datacenter.cdot.io', // Provide a default value or handle the absence\n      description: 'Set the target device hostname',\n    },\n    password: {\n      type: 'string',\n      default: process.env.PANOS_PASSWORD, // Adjusted to PANOS_PASSWORD\n      description: 'Set the user password',\n      demandOption: true, // Require this option\n    },\n    username: {\n      type: 'string',\n      default: process.env.PANOS_USERNAME,\n      description: 'Set the user name',\n      demandOption: true, // Require this option\n    },\n  })\n  .parseSync() as Arguments;\n\n// Set the logger level based on the argument\nlogger.level = argv.logLevel;\n\n/**\n * Test function to generate an API key for a PAN-OS device.\n * Utilizes the ApiKeyGenerator to generate an API key based on provided credentials.\n */\nasync function testGenerateApiKey() {\n  // Initialize the ApiKeyGenerator\n  const apiClient = new ApiKeyGenerator(argv.hostname);\n\n  try {\n    // Generate an API key\n    const apiKey = await apiClient.generateApiKey(\n      argv.username,\n      argv.password,\n    );\n\n    // Log the generated API key to the console\n    logger.info(`Generated API Key: ${apiKey}`);\n  } catch (error) {\n    // Handle and log any errors that occur during the API key generation\n    console.error('Error:', error);\n  }\n}\n\n// Execute the test function to generate an API key\ntestGenerateApiKey();\n```\n\nExecuting with `ts-node`:\n\n```bash\n$ ts-node tests/testGenerateApiKey.ts --username automation --password paloalto#1! --hostname datacenter.cdot.io\ninfo: Generated API Key: LUFRPT1iN2N1M0Z4ZjdrT0IyZlQxUmpDVlRUOXZKVTQ9N2dxVE1qdUZFM0FROE40Tm9WVFRLSmx5QWRCdnlKRnduQ3dDZUxPek5hMXpJcGJnVVU5R1lMMEUvckdRSHg2d2ZsbTc1UzBzclozNGJhakJxYmlPc2c9PQ== {\"timestamp\":\"2023-12-31T14:13:58.052Z\"}\n```\n\n\n\n\n### Requesting System Info\n\n```typescript\n// tests/testShowSystemInfoResponse.ts\n\nimport { Firewall } from '../src/index';\nimport dotenv from 'dotenv';\nimport { hideBin } from 'yargs/helpers';\nimport logger from '../src/utils/logger';\nimport yargs from 'yargs';\n\n/**\n * Script for testing the retrieval of system information from a PAN-OS device.\n * Demonstrates the use of the Firewall class to fetch system details.\n * Utilizes environment variables for configuration and command-line arguments to set the logging level.\n */\n\n// Load and configure environment variables based on the current environment setting.\ndotenv.config({\n  path: process.env.NODE_ENV === 'production' ? '.env.prod' : '.env.dev',\n});\n\n/**\n * Defines the structure for command-line arguments used in the script.\n */\ninterface Arguments {\n  logLevel: string;\n}\n\n// Parse command-line arguments to configure the script's runtime settings.\nconst argv = yargs(hideBin(process.argv))\n  .options({\n    logLevel: {\n      type: 'string',\n      default: 'info',\n      choices: ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'],\n      description: 'Set the logging level',\n    },\n  })\n  .parseSync() as Arguments;\n\n// Set the logger level based on the argument\nlogger.level = argv.logLevel;\n\n/**\n * Test function to retrieve and log system information from a PAN-OS device.\n * Validates the SDK's ability to interact with the device API and process the data.\n * @async\n * @throws An error if the API key is not set in the environment variables or if there is a failure in fetching the information.\n */\nasync function testShowSystemInfoResponse() {\n  const hostname = process.env.PANOS_HOSTNAME || 'datacenter.cdot.io';\n  const apiKey = process.env.PANOS_API_KEY || '';\n\n  // Ensure the API key is present before attempting the operation; otherwise, throw an error.\n  if (!apiKey) {\n    throw new Error('API key is not set in environment variables.');\n  }\n\n  // Initialize a new instance of the Firewall class with API key and hostname.\n  const firewall = new Firewall(hostname, apiKey);\n\n  try {\n    // Fetch the system information from the PAN-OS device using the Firewall class's method.\n    const systemInfo = await firewall.showSystemInfoResponse();\n\n    // Log the retrieved system information to the console for verification.\n    logger.info('System Info:', systemInfo);\n  } catch (error) {\n    // Log any errors encountered during the retrieval process.\n    console.error('Error retrieving system info:', error);\n  }\n}\n\n// Run the function to test system information retrieval.\ntestShowSystemInfoResponse();\n```\n\nExecuting with ts-node:\n\n```bash\n$ts-node tests/testShowSystemInfo.ts\ninfo: System Info: {\"result\":{\"system\":{\"ZTP\":\"Disabled\",\"advanced-routing\":\"off\",\"app-release-date\":\"2023/12/19 16:38:55 CST\",\"app-version\":\"8792-8469\",\"av-release-date\":\"2023/12/16 06:03:28 CST\",\"av-version\":\"4668-5186\",\"base_mac\":\"c8:29:c8:49:be:00\",\"cloud-mode\":\"non-cloud\",\"default-gateway\":\"10.0.0.1\",\"device-certificate-status\":\"Valid\",\"device-dictionary-release-date\":\"2023/12/29 13:37:56 CST\",\"device-dictionary-version\":\"108-460\",\"devicename\":\"DataCenter\",\"family\":\"400\",\"global-protect-client-package-version\":\"6.2.2\",\"global-protect-clientless-vpn-version\":\"0\",\"global-protect-datafile-release-date\":\"unknown\",\"global-protect-datafile-version\":\"0\",\"hostname\":\"DataCenter\",\"ip-address\":\"10.0.0.3\",\"ipv6-address\":\"unknown\",\"ipv6-link-local-address\":\"fe80::1f36:7aff:fe02:5485/64\",\"is-dhcp\":\"no\",\"logdb-version\":\"11.0.0\",\"mac-address\":\"1f:36:7a:02:54:85\",\"mac_count\":\"254\",\"model\":\"PA-440\",\"multi-vsys\":\"off\",\"netmask\":\"255.255.255.0\",\"operational-mode\":\"normal\",\"platform-family\":\"400\",\"plugin_versions\":{\"entry\":{\"pkginfo\":\"dlp-4.0.2\"}},\"public-ip-address\":\"unknown\",\"serial\":\"0123456789010\",\"sw-version\":\"11.0.3\",\"threat-release-date\":\"2023/12/19 16:38:55 CST\",\"threat-version\":\"8792-8469\",\"time\":\"Sun Dec 31 08:16:31 2023\\n\",\"uptime\":\"14 days, 2:18:15\",\"url-db\":\"paloaltonetworks\",\"url-filtering-version\":\"20231231.20213\",\"vpn-disable-mode\":\"off\",\"wf-private-release-date\":\"unknown\",\"wf-private-version\":\"0\",\"wildfire-rt\":\"Disabled\",\"wildfire-version\":\"0\"}},\"timestamp\":\"2023-12-31T14:16:32.437Z\"}\n```\n\n## 🤝 Contributing\n\nWe welcome contributions. Please:\n\n- Write clear and concise code.\n- Include tests for new features.\n- Adhere to the existing code style.\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\n\n## 📄 License\n\nLicensed under the [MIT License](LICENSE).\n\n## ✉️ Contact\n\nFor queries or feedback, open an issue on [GitHub Issues](https://github.com/cdot65/pan-os-typescript/issues).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdot65%2Fpan-os-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdot65%2Fpan-os-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdot65%2Fpan-os-typescript/lists"}