{"id":22297839,"url":"https://github.com/bincyber/vigilant","last_synced_at":"2025-08-25T02:07:50.184Z","repository":{"id":64304789,"uuid":"169505161","full_name":"bincyber/vigilant","owner":"bincyber","description":"a security controller for Kubernetes","archived":false,"fork":false,"pushed_at":"2019-02-08T02:30:30.000Z","size":11,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T06:05:01.588Z","etag":null,"topics":["controllers","kubernetes","security"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bincyber.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}},"created_at":"2019-02-07T01:48:16.000Z","updated_at":"2023-03-17T14:40:46.000Z","dependencies_parsed_at":"2023-01-15T10:15:51.517Z","dependency_job_id":null,"html_url":"https://github.com/bincyber/vigilant","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bincyber/vigilant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bincyber%2Fvigilant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bincyber%2Fvigilant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bincyber%2Fvigilant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bincyber%2Fvigilant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bincyber","download_url":"https://codeload.github.com/bincyber/vigilant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bincyber%2Fvigilant/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267616582,"owners_count":24116155,"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-07-28T02:00:09.689Z","response_time":68,"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":["controllers","kubernetes","security"],"created_at":"2024-12-03T17:51:37.841Z","updated_at":"2025-07-29T01:33:10.591Z","avatar_url":"https://github.com/bincyber.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vigilant\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Go](https://img.shields.io/badge/Go-1.11-blue.svg)](#)\n[![Version](https://images.microbadger.com/badges/version/bincyber/vigilant.svg)](https://microbadger.com/images/bincyber/vigilant)\n[![Layers](https://images.microbadger.com/badges/image/bincyber/vigilant.svg)](https://microbadger.com/images/bincyber/vigilant)\n[![CircleCI](https://circleci.com/gh/bincyber/vigilant.svg?style=svg)](https://circleci.com/gh/bincyber/vigilant)\n\n\n_vigilant_ is a Kubernetes security controller.\n\n## What It Does\n\n_vigilant_ ensures the following for every Namespace in your Kubernetes cluster:\n\n1. the Namespace has the label `name`\n\n```\n$ kubectl get namespaces --show-labels\n\nNAME          STATUS   AGE     LABELS\ndefault       Active   2m42s   name=default\nkube-public   Active   2m42s   name=kube-public\nkube-system   Active   2m42s   name=kube-system\n```\n\nThis faciliates the use of the `namespaceSelector` in [NetworkPolicy](https://kubernetes.io/docs/concepts/services-networking/network-policies/) objects.\n\nFor example, this NetworkPolicy can be applied without having to manually add the label `name=web-app` to the `web-app` Namespace:\n\n```\n---\napiVersion: networking.k8s.io/v1\nkind: NetworkPolicy\nmetadata:\n  name: allow-web-app\n  namespace: pgsql\nspec:\n  policyTypes:\n  - Ingress\n  podSelector:\n    matchLabels:\n      app: postgres-10\n  ingress:\n  - from:\n    - namespaceSelector:\n        matchLabels:\n          name: web-app\n```\n\n\n2. the Namespace has a default NetworkPolicy that denies all ingress and egress traffic:\n\n```\n---\napiVersion: networking.k8s.io/v1\nkind: NetworkPolicy\nmetadata:\n  name: default-deny-all\n  namespace: example\nspec:\n  policyTypes:\n  - Ingress\n  - Egress\n  podSelector: {}\n  ingress: []\n  egress:\n  - ports:\n    - port: 53\n      protocol: TCP\n    - port: 53\n      protocol: UDP\n```\n\nThis policy will apply to all Pods in the Namespace and only permit outbound DNS traffic.\n\n\n## How It Works\n\n_vigilant_ is a [DecoratorController](https://metacontroller.app/api/decoratorcontroller/).\n\nIt is registered with the [metacontroller](https://github.com/GoogleCloudPlatform/metacontroller) and watches for the creation of Namespace objects. When a new namespace is created, the metacontroller sends a POST request to _vigilant_ at its `/sync` endpoint. _vigilant_ returns the `name` label and NetworkPolicy to add to the namespace which is done by the metacontroller.\n\n```\n$ kubectl -n metacontroller logs metacontroller-0 --tail=12\n\nI0124 21:47:31.633272       1 controller.go:423] DecoratorController knsc: sync Namespace /kube-system\nI0124 21:47:31.636532       1 controller.go:423] DecoratorController knsc: sync Namespace /default\nI0124 21:47:31.638269       1 controller.go:423] DecoratorController knsc: sync Namespace /kube-public\nI0124 21:47:31.638274       1 controller.go:508] DecoratorController knsc: updating Namespace /kube-system\nI0124 21:47:31.642925       1 controller.go:508] DecoratorController knsc: updating Namespace /default\nI0124 21:47:31.644319       1 controller.go:508] DecoratorController knsc: updating Namespace /kube-public\nI0124 21:47:31.646605       1 manage_children.go:246] Namespace kube-system: creating NetworkPolicy kube-system/default-deny-all\nI0124 21:47:31.646648       1 manage_children.go:246] Namespace default: creating NetworkPolicy default/default-deny-all\nI0124 21:47:31.647014       1 manage_children.go:246] Namespace kube-public: creating NetworkPolicy kube-public/default-deny-all\nI0124 21:47:31.653321       1 controller.go:423] DecoratorController knsc: sync Namespace /metacontroller\nI0124 21:47:31.655149       1 controller.go:508] DecoratorController knsc: updating Namespace /metacontroller\nI0124 21:47:31.658274       1 manage_children.go:246] Namespace metacontroller: creating NetworkPolicy metacontroller/default-deny-all\n```\n\n## Prerequisites\n\n_vigilant_ requires the [metacontroller](https://github.com/GoogleCloudPlatform/metacontroller) add-on running in your Kubernetes cluster.\n\n\n## Usage\n\nDeploy _vigilant_:\n```\n$ kubectl apply -f https://raw.githubusercontent.com/bincyber/vigilant/master/manifests/deployment.yaml\n```\n\nRegister the DecoratorController with the metacontroller:\n```\n$ kubectl apply -f https://github.com/bincyber/vigilant/blob/master/manifests/decoratorcontroller.yaml\n```\n\nVerify that namespaces have had a `name` label added to them:\n```\n$ kubectl get namespaces --show-labels\n```\n\nVerify that a NetworkPolicy has been added to each namespace:\n```\n$ kubectl get networkpolicy --all-namespaces\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbincyber%2Fvigilant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbincyber%2Fvigilant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbincyber%2Fvigilant/lists"}