{"id":31482299,"url":"https://github.com/snowflake-labs/geff","last_synced_at":"2025-10-02T07:45:36.690Z","repository":{"id":37101663,"uuid":"388856007","full_name":"Snowflake-Labs/geff","owner":"Snowflake-Labs","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-02T16:47:07.000Z","size":306,"stargazers_count":18,"open_issues_count":20,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-26T16:37:00.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Snowflake-Labs.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-23T16:06:00.000Z","updated_at":"2025-04-04T03:41:47.000Z","dependencies_parsed_at":"2024-08-14T23:51:58.147Z","dependency_job_id":null,"html_url":"https://github.com/Snowflake-Labs/geff","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Snowflake-Labs/geff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snowflake-Labs%2Fgeff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snowflake-Labs%2Fgeff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snowflake-Labs%2Fgeff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snowflake-Labs%2Fgeff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Snowflake-Labs","download_url":"https://codeload.github.com/Snowflake-Labs/geff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snowflake-Labs%2Fgeff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277974426,"owners_count":25908396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-02T02:00:08.890Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-02T07:45:33.333Z","updated_at":"2025-10-02T07:45:36.686Z","avatar_url":"https://github.com/Snowflake-Labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Terraform](https://github.com/Snowflake-Labs/geff/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Snowflake-Labs/geff/actions/workflows/ci.yml)\n\n# GEFF\n\nThe Generic External Function Framework (GEFF) is a generic backend for [Snowflake External Functions](https://docs.snowflake.com/en/sql-reference/external-functions-introduction.html) which allows Snowflake users to invoke RPC endpoints via Call Drivers (e.g. HTTP, SMTP, XML-RPC), either returning results to Snowflake, or storing them with Write Drivers (e.g. to S3).\n\nGEFF empowers users to invoke a variety of external RPC's without changing infrastructure, allowing them to manage and threat model those RPC interfaces in Snowflake's Data Cloud using Snowflake RBAC in a single standardized interaction with CSP's.\n\nWe recommend deployed GEFF via the Terraform in [terraform-snowflake-api-integration-with-geff-aws](https://github.com/Snowflake-Labs/terraform-snowflake-api-integration-with-geff-aws) but you could also build it as an image on AWS ECR by invoking the bash script below or create a zip archive which can be uploaded into the AWS lambda UI using the `make` command. \n\n## Example\n\nAfter deploying GEFF behind an [API Integration](https://docs.snowflake.com/en/sql-reference/sql/create-api-integration.html), you can create external functions that specify a protocol and an authenticated endpoint, e.g. —\n\n~~~sql\nCREATE OR REPLACE EXTERNAL FUNCTION abuseipdb_check_ip(ip STRING, max_age_in_days NUMBER, verbose BOOL)\n  RETURNS VARIANT\n  VOLATILE\n  COMMENT='https://docs.abuseipdb.com/#check-endpoint'\n  API_INTEGRATION=SECENG\n  HEADERS=(\n    'auth'='arn:aws:secretsmanager:us-west-2:123456789012:secret:prod/seceng/abuseip-api-pmsbfa'\n    'params'='ipAddress={0}\u0026maxAgeInDays={1}\u0026{2}'\n    'url'='https://api.abuseipdb.com/api/v2/check'\n  )\n  AS 'https://r2vuxhftrg.execute-api.us-west-2.amazonaws.com/prod/https'\n;\n\nSELECT abuseipdb_check_ip('127.0.0.1', 365, TRUE);\n~~~\n\nGEFF will then retrieve the secret referenced in `auth`, e.g. `{\"host\": \"api.abuseipdb.com\", \"headers\": {\"Key\": \"fbgzxukuci...\"}}` and use that to authenticate the API call while maintaining a variety of [security, observability, and auditability committments](https://github.com/Snowflake-Labs/geff/wiki/I.-GEFF#security-guarantees).\n\n## Dev Instructions\n\n### Building and uploading GEFF Lambda image to ECR\n\n```bash\n# Clone repo\ngit clone git@github.com:Snowflake-Labs/geff.git\n\n# Run ecr.sh\n./ecr.sh 123556660 us-west-2 0.0.x-dev\n```\n\n### Deploying rest of Snowflake and AWS infra with Terraform\n\nBelow is an example as used in [`terraform-snowflake-aws-geff`](https://github.com/Snowflake-Labs/terraform-snowflake-aws-geff):\n\nNOTE: The handler is `geff.lambda_function.lambda_handler` as opposed to the default `lambda_function.lambda_handler`. We're invoking GEFF as a package.\n\n```hcl\nresource \"aws_lambda_function\" \"geff_lambda\" {\n  function_name = local.lambda_function_name\n  role          = aws_iam_role.geff_lambda_assume_role.arn\n\n  memory_size = \"4096\" # 4 GB\n  timeout     = \"900\"  # 15 mins\n\n  image_uri    = local.lambda_image_repo_version # this is the GEFF docker image uploaded using ecr.sh\n  package_type = \"Image\"\n}\n```\n\n### Setup\n\n```bash\ngit clone git@github.com:Snowflake-Labs/geff.git\npython3 -m venv ./venv\nsource ./venv/bin/activate\n\npip3 install -r requirements-dev.txt\n```\n\n### Test\n\n```bash\n# While in the venv\npython -m pytest tests/*\n```\n\n### Creating a zip archive of the code\n\n```bash\nmake pack\n```\n\n## TODO\n\n- [x] Lambda base code\n- [x] Basic tests needs environment variables to be set\n- [ ] Use mocks to simulate remote services and test all drivers\n- [ ] Test async functionality\n- [ ] Use moto for mocking boto3 and test s3 destination drivers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowflake-labs%2Fgeff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnowflake-labs%2Fgeff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowflake-labs%2Fgeff/lists"}