{"id":20863913,"url":"https://github.com/eziodevio/azurefunctionclamavkubernetes","last_synced_at":"2026-04-25T10:34:26.017Z","repository":{"id":229087629,"uuid":"775732458","full_name":"EzioDEVio/AzureFunctionClamavKubernetes","owner":"EzioDEVio","description":"deploying an Azure Function integrated with ClamAV within a Kubernetes environment","archived":false,"fork":false,"pushed_at":"2024-06-11T20:35:31.000Z","size":201,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T21:55:03.378Z","etag":null,"topics":["azurefunction","clamav-scanning","kubernetes-cluster","kubernetes-deployment"],"latest_commit_sha":null,"homepage":"https://theslash84.github.io/AzureFunctionClamavKubernetes/","language":"C#","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/EzioDEVio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-03-21T23:59:55.000Z","updated_at":"2024-03-26T19:58:41.000Z","dependencies_parsed_at":"2024-03-29T14:47:31.525Z","dependency_job_id":"2f6157c4-e758-4f8c-a15d-c8b5cf2705b3","html_url":"https://github.com/EzioDEVio/AzureFunctionClamavKubernetes","commit_stats":null,"previous_names":["theslash84/azurefunctionclamavkubernetes","eziodevio/azurefunctionclamavkubernetes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EzioDEVio/AzureFunctionClamavKubernetes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EzioDEVio%2FAzureFunctionClamavKubernetes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EzioDEVio%2FAzureFunctionClamavKubernetes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EzioDEVio%2FAzureFunctionClamavKubernetes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EzioDEVio%2FAzureFunctionClamavKubernetes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EzioDEVio","download_url":"https://codeload.github.com/EzioDEVio/AzureFunctionClamavKubernetes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EzioDEVio%2FAzureFunctionClamavKubernetes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32259472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"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":["azurefunction","clamav-scanning","kubernetes-cluster","kubernetes-deployment"],"created_at":"2024-11-18T05:34:32.432Z","updated_at":"2026-04-25T10:34:25.982Z","avatar_url":"https://github.com/EzioDEVio.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Trivy Scan and Report](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/trivy-repo-scan.yml/badge.svg)](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/trivy-repo-scan.yml) \n[![CodeQL](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/codeql.yml/badge.svg)](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/codeql.yml) [![Build and Push Docker image](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/dockerize-function-app.yml/badge.svg)](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/dockerize-function-app.yml) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/theslash84/AzureFunctionClamavKubernetes) ![GitHub last commit](https://img.shields.io/github/last-commit/theslash84/AzureFunctionClamavKubernetes) ![GitHub top language](https://img.shields.io/github/languages/top/theslash84/AzureFunctionClamavKubernetes)  ![GitHub License](https://img.shields.io/github/license/theslash84/AzureFunctionClamavKubernetes) [![Docker CI](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/GHCR-Docker.yml/badge.svg)](https://github.com/theslash84/AzureFunctionClamavKubernetes/actions/workflows/GHCR-Docker.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=theslash84_AzureFunctionClamavKubernetes\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=theslash84_AzureFunctionClamavKubernetes) [![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=theslash84_AzureFunctionClamavKubernetes)](https://sonarcloud.io/summary/new_code?id=theslash84_AzureFunctionClamavKubernetes) [![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-black.svg)](https://sonarcloud.io/summary/new_code?id=theslash84_AzureFunctionClamavKubernetes) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=theslash84_AzureFunctionClamavKubernetes\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=theslash84_AzureFunctionClamavKubernetes) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=theslash84_AzureFunctionClamavKubernetes\u0026metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=theslash84_AzureFunctionClamavKubernetes) \n\n\n\n\n\n\n### ✨Azure Function with ClamAV in Kubernetes: Comprehensive Deployment Guide ✨\n\nThis README elaborates on deploying an Azure Function integrated with ClamAV within a Kubernetes environment. We'll take you through containerizing your Azure Function, orchestrating its deployment alongside ClamAV in Kubernetes, addressing potential hitches, and optimizing the setup for efficient operation...\n\n🌟**Key Functionality Highlight**:\n\n**Azure Function with Blob Trigger**: Our Azure Function is designed to react to new blob uploads in an Azure Storage container. Upon detecting a new blob, the function invokes **ClamAV** to scan the blob for potential threats.\nClamAV Scanning: ClamAV, deployed within the same **Kubernetes cluster**, scans the incoming blobs. If it identifies any malicious content, the Azure Function is programmed to take necessary actions, such as deleting the questionable blob, thereby ensuring real-time threat mitigation.\nEvent-Driven Security: This setup exemplifies an event-driven approach to security, where blob uploads trigger immediate scans, minimizing the window of vulnerability.\n\n## Prerequisites 🛠️\n\n**Docker**: Used for containerizing applications.\n\n**Kubernetes (Minikube)**: Provides a local Kubernetes cluster to deploy and test the application.\n\n**kubectl**: A command-line tool for Kubernetes cluster management.\n\n**Azure CLI**: Facilitates interactions with Azure resources.\n\n**Git**: Manages version control for your source code.\n\n\n---\n## Project Structure 📂\n```\nAzureFunctionClamAVKubernetes/\n│\n├── 📁 BlobScanFunctionApp/            # Azure Function app directory.\n│   ├── 📁 .vscode/                    # VSCode settings.\n│   ├── 📁 bin/                        # Build artifacts.\n│   ├── 📁 obj/                        # Build outputs.\n│   ├── 📁 Properties/                 # Project configurations.\n│   └── ...                            # Additional resources.\n│\n└── 📁 clamAV deployment/              # Kubernetes manifests for ClamAV \u0026 Azure Function.\n    ├── 📄 clamav-config.yaml          # ClamAV ConfigMap.\n    ├── 📄 clamav-deployment.yaml      # ClamAV deployment manifest.\n    ├── 📄 azurefunction-config.yaml   # Azure Function ConfigMap.\n    ├── 📄 azurefunction-deployment.yaml # Azure Function deployment manifest.\n    └── ...                            # Other necessary Kubernetes files.\n\n```\n\n***Detailed File Explanations and Descriptions*** 📑📑📑\nKubernetes Deployment Files\n\n- **clamav-configmap.yaml**:\nThis file defines a ConfigMap containing configuration settings for ClamAV. It separates the application configuration from the application logic, allowing for easier updates and management.\n\n- **clamav-deployment.yaml**:\nA Deployment manifest that specifies how ClamAV pods should be created, including details like the container image, resources, and volumes. It ensures that the desired number of ClamAV instances are maintained in the cluster.\n\n- **function-configmap.yaml**:\nSimilar to the ClamAV ConfigMap, this provides configuration data for the Azure Function, allowing environment-specific settings to be managed independently of the application code.\n\n- **function-secrets.yaml**:\nThis file manages sensitive information required by the Azure Function, such as API keys or passwords, ensuring that such data is kept secure and separate from other configuration data.\n\n- **function-deployment.yaml**:\nThis Deployment manifest defines how the Azure Function pods should be created and managed within Kubernetes, detailing aspects like the container image, associated ConfigMaps or Secrets, and resource requirements.\n\n- **clamav-pv.yaml**:\nDeclares a Persistent Volume for ClamAV, providing it with a specific, durable storage resource that persists across pod restarts and rescheduling, essential for retaining ClamAV's state.\n\n- **clamav-pvc.yaml**:\nSpecifies a Persistent Volume Claim for ClamAV, which requests and links the necessary storage resources defined in the PV to the ClamAV pods, ensuring they have the required storage available.\n\n🎯 **Each file contributes to setting up and managing the necessary components for the Azure Function and ClamAV deployment within a Kubernetes environment, focusing on configuration, security, and resource management**🎯\n\n---\n## Deployment Steps 🚀\n# 1. Containerize the Azure Function:\nDockerize your function app and push the image to a container registry.\n```\ndocker build -t myazurefunction:latest .\n```\nTagging the Image:\n```\ndocker image tag myazurefunction:latest USER/myazurefunction:latest\n```\nPushing to Docker Hub:\n```\ndocker image push USER/myazurefunction:latest\n##### Replace yourdockerhubusername/azurefunctionimage:latest with the actual path to your Docker image.\n```\n\nRun the Docker Container\n```\ndocker run -p 80:80 myazurefunction:latest\n```\n\n---\n# 2. Set Up Kubernetes (Minikube)\nMinikube provides a quick way to set up a local Kubernetes cluster for testing environments. It's ideal for development and testing, offering a simplified version of larger, managed Kubernetes platforms.\n\n# Installation and Initialization:🛠️\n-Install Minikube: Follow the Minikube installation guide.\n-Start Minikube: Use minikube start to launch a local Kubernetes cluster.\n-Check Configuration: Use kubectl get nodes to ensure Minikube is up and kubectl is configured correctly.\n\n**Differences from Managed Kubernetes Platforms**🌐:\n\nIsolation: Minikube is local and isolated, contrasting with the networked nature of managed cloud Kubernetes services.\nResources: Limited to your local machine's capabilities, unlike the scalable cloud-based offerings.\nManagement: Lacks the advanced management features of cloud services but provides a simpler, more accessible environment.\nCost: Free to use, making it an economical choice for developers.\nThis setup ensures you have a functional, isolated environment to deploy and test your Kubernetes applications locally before moving to a production-grade setup.\n\n---\n# 3. Deploy ClamAV and Azure Function\n\nApply Kubernetes manifests to deploy ClamAV and the Azure Function within the cluster.\n\n```\n#Apply all the YAML files to your AKS cluster:\n\nkubectl apply -f clamav-configmap.yaml\nkubectl apply -f clamav-deployment.yaml\nkubectl apply -f function-configmap.yaml\nkubectl apply -f function-secrets.yaml\nkubectl apply -f function-deployment.yaml\nkubectl apply -f clamav-pv.yaml\nkubectl apply -f clamav-pvc.yaml\n\n```\n#Check that all pods are running and services are functioning\n```\nkubectl get all\n```\n\n# Verify the Deployment\n```\nkubectl get pods\n```\n```\nkubectl describe pod \u003cazure-function-pod-name\u003e\n```\n---\n# 4. Validate and Monitor\nEnsure both deployments are up and verify intercommunication.\n```\nkubectl get pods\n```\n```\nkubectl logs \u003cpod_name\u003e\n```\n## Automating Deployment with GitHub Actions 🚀\nGitHub Actions enables automation of your workflows, allowing you to execute your deployment pipeline right from your GitHub repository. Below, we outline how to set up workflows for the BlobFunction app and the Minikube cluster.\n\n# Setting Up Workflow for the BlobFunction App\nCreate a Workflow File:\n\nNavigate to the .github/workflows directory in your repository.\nCreate a new file named blobfunction-app.yml.\nDefine your workflow using the YAML syntax, specifying triggers, jobs, steps, and actions.\nDefine the Workflow:\n\n# Setting Up Workflow for Minikube\nCreate a Workflow File for Minikube:\n\nIn the .github/workflows directory, create a file named minikube-deployment.yml.\nStructure your workflow to include Minikube installation, cluster setup, and application deployment steps.\nDefine Minikube Workflow:\n\nEnsure the workflow installs Minikube, starts the cluster, and applies Kubernetes manifests.\nUse actions that interact with Minikube, such as setting up kubectl and applying your deployment YAML files.\nWorkflow Example:\n\nSet up the workflow to trigger on push events to your repository or on pull request events to specific branches.\nDefine a job that checks out your code, sets up the environment, builds the container image, and pushes it to a container registry.\nFinal Notes\nCommit and push your workflow files to the repository. GitHub Actions will automatically recognize and execute the workflows based on the defined triggers.\nMonitor the Actions tab in your GitHub repository to track the execution status and view logs.\nBy integrating these workflows, you streamline the deployment processes for your BlobFunction app and Minikube environment, ensuring consistent and automated update\n\n# Troubleshooting 🛠️\nAddress issues highlighted in pod logs or status. Common problems include image pull errors, configuration mismatches, or resource constraints.\nMaintenance and Upgrades 🔄\nKeep your deployment files and container images up-to-date. Regularly review Kubernetes resources and logs to optimize performance and security.\nConclusion 🎉:\nFollowing this guide, you've successfully deployed an Azure Function with ClamAV in Kubernetes, showcasing real-time security enforcement for your cloud storage. Adapt these steps and configurations to fit the specific needs and context of your application.\n\nHappy Deploying! 🚀\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feziodevio%2Fazurefunctionclamavkubernetes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feziodevio%2Fazurefunctionclamavkubernetes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feziodevio%2Fazurefunctionclamavkubernetes/lists"}