{"id":19890101,"url":"https://github.com/haproxy/spoa-example","last_synced_at":"2025-05-02T18:30:52.968Z","repository":{"id":63059408,"uuid":"360071743","full_name":"haproxy/spoa-example","owner":"haproxy","description":"Example implementation of a very simple agent to use with HAProxy's SPOE filtering","archived":false,"fork":false,"pushed_at":"2023-10-12T11:56:07.000Z","size":58,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T04:33:03.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haproxy.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-21T07:27:40.000Z","updated_at":"2024-10-25T12:47:00.000Z","dependencies_parsed_at":"2022-11-12T01:03:11.776Z","dependency_job_id":null,"html_url":"https://github.com/haproxy/spoa-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haproxy%2Fspoa-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haproxy%2Fspoa-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haproxy%2Fspoa-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haproxy%2Fspoa-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haproxy","download_url":"https://codeload.github.com/haproxy/spoa-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252088242,"owners_count":21692764,"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","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":"2024-11-12T18:12:56.888Z","updated_at":"2025-05-02T18:30:52.620Z","avatar_url":"https://github.com/haproxy.png","language":"C","readme":"A Random IP reputation service acting as a Stream Processing Offload Agent\n--------------------------------------------------------------------------\n\nThis is a very simple service that implement a \"random\" ip reputation\nservice. It will return random scores for all checked IP addresses. It only\nshows you how to implement a ip reputation service or such kind of services\nusing the SPOE.\n\n\n  Start the service\n---------------------\n\nAfter you have compiled it, to start the service, you just need to use \"spoa\"\nbinary:\n\n    $\u003e ./spoa  -h\n    Usage: ./spoa [-h] [-d] [-p \u003cport\u003e] [-n \u003cnum-workers\u003e]\n        -h                  Print this message\n        -d                  Enable the debug mode\n        -p \u003cport\u003e           Specify the port to listen on (default: 12345)\n        -n \u003cnum-workers\u003e    Specify the number of workers (default: 5)\n\nNote: A worker is a thread.\n\n\n  Configure a SPOE to use the service\n---------------------------------------\n\nAll information about SPOE configuration can be found in \"doc/SPOE.txt\". Here is\nthe configuration template to use for your SPOE:\n\n    [ip-reputation]\n\n    spoe-agent iprep-agent\n        messages check-client-ip\n\n        option var-prefix iprep\n\n        timeout hello      100ms\n        timeout idle       30s\n        timeout processing 15ms\n\n        use-backend iprep-backend\n\n    spoe-message check-client-ip\n        args src\n        event on-client-session\n\n\nThe engine is in the scope \"ip-reputation\". So to enable it, you must set the\nfollowing line in a frontend/listener section:\n\n    frontend my-front\n        ...\n        filter spoe engine ip-reputation config /path/spoe-ip-reputation.conf\n\t....\n\nwhere \"/path/spoe-ip-reputation.conf\" is the path to your SPOE configuration\nfile. The engine name is important here, it must be the same than the one used\nin the SPOE configuration file.\n\nIMPORTANT NOTE:\n    Because we want to send a message on the \"on-client-session\" event, this\n    SPOE must be attached to a proxy with the frontend capability. If it is\n    declared in a backend section, it will have no effet.\n\n\nBecause, in SPOE configuration file, we declare to use the backend\n\"iprep-backend\" to communicate with the service, you must define it in HAProxy\nconfiguration. For example:\n\n    backend iprep-backend\n        mode tcp\n\ttimeout server 1m\n\tserver iprep-srv 127.0.0.1:12345 check maxconn 5\n\n\nIn reply to the \"check-client-ip\" message, this service will set the variable\n\"ip_score\" for the session, an integer between 0 and 100. If unchanged, the\nvariable prefix is \"iprep\". So the full variable name will be\n\"sess.iprep.ip_score\".\n\nYou can use it in ACLs to experiment the SPOE feature. For example:\n\n    tcp-request content reject if { var(sess.iprep.ip_score) -m int lt 20 }\n\nWith this rule, all IP address with a score lower than 20 will be rejected\n(Remember, this score is random).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaproxy%2Fspoa-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaproxy%2Fspoa-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaproxy%2Fspoa-example/lists"}