{"id":15949855,"url":"https://github.com/tomzx/policy-evaluator","last_synced_at":"2025-10-20T04:31:59.591Z","repository":{"id":57071538,"uuid":"81463825","full_name":"tomzx/policy-evaluator","owner":"tomzx","description":"Policy evaluator based on AWS AMI Policies.","archived":false,"fork":false,"pushed_at":"2018-02-19T23:16:44.000Z","size":23,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T15:25:55.518Z","etag":null,"topics":["aws","policies","policy","policy-evaluator"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/tomzx.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":"2017-02-09T15:21:43.000Z","updated_at":"2017-02-09T15:34:37.000Z","dependencies_parsed_at":"2022-08-24T14:54:28.098Z","dependency_job_id":null,"html_url":"https://github.com/tomzx/policy-evaluator","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/tomzx%2Fpolicy-evaluator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomzx%2Fpolicy-evaluator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomzx%2Fpolicy-evaluator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomzx%2Fpolicy-evaluator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomzx","download_url":"https://codeload.github.com/tomzx/policy-evaluator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237268005,"owners_count":19282329,"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":["aws","policies","policy","policy-evaluator"],"created_at":"2024-10-07T12:55:57.517Z","updated_at":"2025-10-20T04:31:54.330Z","avatar_url":"https://github.com/tomzx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Policy Evaluator\n\n[![License](https://poser.pugx.org/tomzx/policy-evaluator/license.svg)](https://packagist.org/packages/tomzx/policy-evaluator)\n[![Latest Stable Version](https://poser.pugx.org/tomzx/policy-evaluator/v/stable.svg)](https://packagist.org/packages/tomzx/policy-evaluator)\n[![Latest Unstable Version](https://poser.pugx.org/tomzx/policy-evaluator/v/unstable.svg)](https://packagist.org/packages/tomzx/policy-evaluator)\n[![Build Status](https://img.shields.io/travis/tomzx/policy-evaluator.svg)](https://travis-ci.org/tomzx/policy-evaluator)\n[![Code Quality](https://img.shields.io/scrutinizer/g/tomzx/policy-evaluator.svg)](https://scrutinizer-ci.com/g/tomzx/policy-evaluator/code-structure)\n[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/tomzx/policy-evaluator.svg)](https://scrutinizer-ci.com/g/tomzx/policy-evaluator)\n[![Total Downloads](https://img.shields.io/packagist/dt/tomzx/policy-evaluator.svg)](https://packagist.org/packages/tomzx/policy-evaluator)\n\n`Policy Evaluator` is a simple system based on AWS Policies. Given a set of statements, `Policy Evaluator` will then be able to answers to queries about whether this set of policies is allowed (or not) to perform a given action on a given resource.\n\n## Getting started\n`php composer.phar require tomzx/policy-evaluator`\n\n## Example\n```php\nuse tomzx\\PolicyEvaluator\\Evaluator;\nuse tomzx\\PolicyEvaluator\\Resource;\n\nResource::$prefix = 'arn';\n\n$evaluator = new Evaluator([\n\t'Statement' =\u003e [\n\t\t[\n\t\t\t'Action' =\u003e 'service:*',\n\t\t\t'Resource' =\u003e 'arn:aws:*',\n\t\t\t'Effect' =\u003e 'Allow',\n\t\t],\n\t\t[\n\t\t\t'Action' =\u003e 's3:*',\n\t\t\t'Resource' =\u003e 'arn:aws:s3:::my-bucket/*',\n\t\t\t'Effect' =\u003e 'Allow',\n\t\t],\n\t],\n]);\n\n$evaluator-\u003ecanExecuteActionOnResource('service:test', 'arn:aws:test');\n$evaluator-\u003ecanExecuteActionOnResource('s3:GetObject', 'arn:aws:s3:::my-bucket/some-file');\n```\n\n### Variables support\n```php\nuse tomzx\\PolicyEvaluator\\Evaluator;\nuse tomzx\\PolicyEvaluator\\Resource;\n\nResource::$prefix = 'arn';\n\n$evaluator = new Evaluator([\n\t'Statement' =\u003e [\n\t\t[\n\t\t\t'Action' =\u003e 'service:*',\n\t\t\t'Resource' =\u003e 'arn:aws:${aws:username}',\n\t\t\t'Effect' =\u003e 'Allow',\n\t\t],\n\t],\n]);\n\n$evaluator-\u003ecanExecuteActionOnResource('service:test', 'arn:aws:test', [\n    'aws:username' =\u003e 'someUsername',\n]);\n```\n\n## License\n\nThe code is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomzx%2Fpolicy-evaluator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomzx%2Fpolicy-evaluator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomzx%2Fpolicy-evaluator/lists"}