{"id":35566041,"url":"https://github.com/imperva/terraform-provider-incapsula","last_synced_at":"2026-04-26T15:00:47.764Z","repository":{"id":37007810,"uuid":"164398718","full_name":"imperva/terraform-provider-incapsula","owner":"imperva","description":"This package is a plugin for Terraform, and is designed to be used to auto-provision sites in Incapsula via Incapsula’s API from the terraform cli/yaml configurations.","archived":false,"fork":false,"pushed_at":"2026-04-23T11:27:33.000Z","size":16950,"stargazers_count":47,"open_issues_count":7,"forks_count":91,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-04-23T13:27:13.538Z","etag":null,"topics":["imperva","security","terraform","waf"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imperva.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-01-07T08:06:35.000Z","updated_at":"2026-04-23T11:27:39.000Z","dependencies_parsed_at":"2023-02-19T06:31:15.123Z","dependency_job_id":"a8d056c0-e8fc-4022-95c7-4175156cee03","html_url":"https://github.com/imperva/terraform-provider-incapsula","commit_stats":null,"previous_names":[],"tags_count":120,"template":false,"template_full_name":null,"purl":"pkg:github/imperva/terraform-provider-incapsula","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperva%2Fterraform-provider-incapsula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperva%2Fterraform-provider-incapsula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperva%2Fterraform-provider-incapsula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperva%2Fterraform-provider-incapsula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imperva","download_url":"https://codeload.github.com/imperva/terraform-provider-incapsula/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imperva%2Fterraform-provider-incapsula/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32301330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"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":["imperva","security","terraform","waf"],"created_at":"2026-01-04T15:13:21.912Z","updated_at":"2026-04-26T15:00:47.758Z","avatar_url":"https://github.com/imperva.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Terraform `Incapsula` Provider\n=========================\n\n- Website: https://www.terraform.io\n- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)\n- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)\n\n\u003cimg src=\"assets/HashiCorp_Logo.png\" width=\"600px\"\u003e\n\nMaintainers\n-----------\n\nThis provider plugin is maintained by the team at [Imperva](https://www.imperva.com/).\n\nRequirements\n------------\n\n-\t[Terraform](https://www.terraform.io/downloads.html) 0.14.x\n-\t[Go](https://golang.org/doc/install) 1.23.0 (to build the provider plugin)\n\nBuilding The Provider\n---------------------\n\nClone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-incapsula`\n\n```sh\n$ git clone git@github.com:imperva/terraform-provider-incapsula $GOPATH/src/github.com/terraform-providers/terraform-provider-incapsula\n```\n\nEnter the provider directory and build the provider\n\n```sh\n$ cd $GOPATH/src/github.com/imperva/terraform-provider-incapsula\n$ make build\n```\n\nUsing the provider\n----------------------\nIf you're building the provider, follow the instructions to [install it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) After placing it into your plugins directory,  run `terraform init` to initialize it. Documentation about the provider specific configuration options can be found on the [provider's website](https://www.terraform.io/docs/providers/incapsula/index.html).\n\nDeveloping the Provider\n---------------------------\n\nIf you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.11+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.\n\nTo compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.\n\n```sh\n$ make bin\n...\n$ $GOPATH/bin/terraform-provider-incapsula\n...\n```\n\nIn order to test the provider, you can simply run `make test`.\n\n```sh\n$ make test\n```\n\nIn order to run the full suite of Acceptance tests, run `make testacc`.\n\n*Note:* Acceptance tests create real resources, and often cost money to run.\n\n```sh\n$ make testacc\n```\n\nAn automation script is provided for Mac darwin 64amd based developers that \nencapsulates initial setups along make described commands. \nPlease note that OS_ARCH=darwin_amd64 is uncommented in GNUmakefile for default Mac users, if needed for Linux users comment back and uncomment OS_ARCH=linux_amd64\n\nBrew is a pre-requisite for this script, as the main package manager to install \nthe dependent libraries such as Golang, Terraform and Git.\nMore details about this script is provided as inner code comments and description.\n\nScript location **/scripts/tf-provider-incap-orch.sh**.\n\nScript installation command will clone this repository to /workspace folder\nas a first step and pull from git in subsequent runs.\n\nIt's recommended to download the script to some directory in local machine and start\nwith installation command execution\n\n```sh\n./tf-provider-incap-orch.sh -i \"youApiID\" \"youApiKey\"\n```\n\nMock Server for Testing\n-----------------------\n\nA mock Imperva API server is provided for running tests without requiring real API credentials. This enables CI/CD pipelines and local development without access to a live Imperva environment.\n\n### Starting the Mock Server\n\n```sh\nmake server\n```\n\nThis starts the mock server on port 19443. The server outputs the required environment variables:\n\n```sh\nexport INCAPSULA_API_ID=mock-api-id\nexport INCAPSULA_API_KEY=mock-api-key\nexport INCAPSULA_BASE_URL=http://localhost:19443\nexport INCAPSULA_BASE_URL_REV_2=http://localhost:19443\nexport INCAPSULA_BASE_URL_REV_3=http://localhost:19443\nexport INCAPSULA_BASE_URL_API=http://localhost:19443\nexport INCAPSULA_CUSTOM_TEST_DOMAIN=.mock.incaptest.com\n```\n\n### Running Tests with Mock Server\n\n```sh\n# Terminal 1: Start the mock server\nmake server\n\n# Terminal 2: Run tests (requires mock server to be running)\nmake test\n```\n\n### Implemented Endpoints\n\nThe mock server implements the following Imperva API endpoints:\n\n#### Account Management ([Cloud v1 API Documentation](https://docs-cybersec-be.thalesgroup.com/api/bundle/api-docs/page/cloud-v1-api-definition.htm))\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/accounts/add` | POST | Create account |\n| `/account` | POST | Get account status |\n| `/accounts/configure` | POST | Update account |\n| `/accounts/delete` | POST | Delete account |\n| `/accounts/data-privacy/show` | POST | Get data privacy settings |\n| `/accounts/data-privacy/set-region-default` | POST | Set default data region |\n\n#### Site Management ([Cloud v1 API Documentation](https://docs-cybersec-be.thalesgroup.com/api/bundle/api-docs/page/cloud-v1-api-definition.htm))\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/sites/add` | POST | Create site |\n| `/sites/status` | POST | Get site status |\n| `/sites/configure` | POST | Update site |\n| `/sites/delete` | POST | Delete site |\n\n#### CSP Pre-Approved Domains ([CSP API Documentation](https://docs-cybersec-be.thalesgroup.com/api/bundle/api-docs/page/csp-api-definition.htm))\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/csp-api/v1/sites/{siteId}/preapprovedlist` | GET | List pre-approved domains |\n| `/csp-api/v1/sites/{siteId}/preapprovedlist` | POST | Add pre-approved domain |\n| `/csp-api/v1/sites/{siteId}/preapprovedlist/{domainRef}` | GET | Get specific domain |\n| `/csp-api/v1/sites/{siteId}/preapprovedlist/{domainRef}` | DELETE | Remove domain |\n| `/csp-api/v1/sites/{siteId}/domains/{domainRef}/status` | GET/PUT | Domain status |\n| `/csp-api/v1/sites/{siteId}/domains/{domainRef}/notes` | GET/POST/DELETE | Domain notes |\n\n### Response Format\n\nAll API responses follow the standard Imperva format:\n\n```json\n{\n  \"res\": 0,\n  \"res_message\": \"OK\",\n  \"debug_info\": {...},\n  \"account|site|data\": {...}\n}\n```\n\nError responses use non-zero `res` codes as documented in the [API documentation](https://docs-cybersec-be.thalesgroup.com/api/bundle/api-docs/page/cloud-v1-api-definition.htm).\n\n### Adding New Endpoints\n\nTo add new endpoints to the mock server:\n\n1. Add the route in `mock_server.go` in the `router()` function\n2. Implement the handler function following existing patterns\n3. Add tests in `mock_server_test.go`\n4. Update this documentation\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimperva%2Fterraform-provider-incapsula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimperva%2Fterraform-provider-incapsula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimperva%2Fterraform-provider-incapsula/lists"}