{"action":"closed","issue":{"url":"https://api.github.com/repos/SpiderLabs/ModSecurity/issues/962","labels_url":"https://api.github.com/repos/SpiderLabs/ModSecurity/issues/962/labels{/name}","comments_url":"https://api.github.com/repos/SpiderLabs/ModSecurity/issues/962/comments","events_url":"https://api.github.com/repos/SpiderLabs/ModSecurity/issues/962/events","html_url":"https://github.com/SpiderLabs/ModSecurity/issues/962","id":116481247,"number":962,"title":"How to run SecRuleScript python ?","user":{"login":"ngocthach","id":8916896,"avatar_url":"https://avatars.githubusercontent.com/u/8916896?v=3","gravatar_id":"","url":"https://api.github.com/users/ngocthach","html_url":"https://github.com/ngocthach","followers_url":"https://api.github.com/users/ngocthach/followers","following_url":"https://api.github.com/users/ngocthach/following{/other_user}","gists_url":"https://api.github.com/users/ngocthach/gists{/gist_id}","starred_url":"https://api.github.com/users/ngocthach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngocthach/subscriptions","organizations_url":"https://api.github.com/users/ngocthach/orgs","repos_url":"https://api.github.com/users/ngocthach/repos","events_url":"https://api.github.com/users/ngocthach/events{/privacy}","received_events_url":"https://api.github.com/users/ngocthach/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-12T05:14:09Z","updated_at":"2015-11-13T20:00:08Z","closed_at":"2015-11-13T20:00:08Z","body":"I write rule, run script shell script: post.sh, this is ok\r\nbut, now I want to run script by Python \"post.py\", i don't know write rule, error when use rule \r\n\r\n- Shell script:\r\nSecRule ARGS,REQUEST_METHOD \"^(POST)$\" \"id:112,pass,auditlog, setenv:bodypost=%{REQUEST_BODY}, exec:/usr/local/bin/post.sh\"\r\n\r\n      + post.sh:\r\n              #!/bin/sh\r\n              a=$bodypost\r\n               // --- I will process string here---//\r\n   --> OK\r\n\r\n- Python:\r\n    SecRule ARGS,REQUEST_METHOD \"^(POST)$\" \"id:112,pass,auditlog, setenv:bodypost=%{REQUEST_BODY}, exec:/usr/local/bin/post.py\"\r\n    + post.py:\r\n        #!/usr/bin/python\r\n         import string\r\n         rx_data=$bodypost\r\n      --> Error, no define \"bodypost\"\r\n\r\n\r\n\r\nWho can help me ? Thanks "}}