-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compliance Rules failing - #37
Comments
Hello John, From the above logs I have noticed Rule Engine is not able to fetch the inventory "com.tmobile.pacman.util.ESUtils - error getting total documents Can you please check whether environment variable in Cloud watch rules ES_URI is correctly set(http://YourEShost:YourESPort) Generally this error comes when the ES_URI value is invalid. As Rule Engine was not able to fetch the data , Rule is not able to evaluate your assets and that's reason you are seeing 100% compliant in the Dashboard. |
I have the same problem and for me it seems to be caused by a missing index in ElasticSearch. The query that fails for me is:
If I instead create a new Asset Group through the UI the index is there and rules are evaluated after changing them to target the new group.
I suspect something is missing in the installer to correctly setup the Also the specific rule |
@kaykumar @santhoshigorle , it would possibly due to the missing index related to sticky exception. Could you please update with the index creation script? |
Could you please check the availability of an index "exceptions" in elasticsearch? If it is there please create it with the below given mapping. It may will your issue.
You can save it as exceptions.json and posted it with this: curl -X PUT vpc-pacman-esdomain-.us-east-2.es.amazonaws.com/exceptions -d @exceptions.json |
@jonshern , is this fixed the issue? if so , we could close this one. |
It seems to solve the issue for me (have not tried it on a fresh installation). I think either the documentation or the installer script should be updated with this before we close this issue since I suspect everyone will run into this problem. |
This is to be fixed in the coming release as we introduced an initializer to take care of these missing indexes etc. I will add this to the faq for now |
Issue is fixed as part of 1.1 release. |
Micro services
Rule Engine
Rules
ETL
Webapp
Summary
I noticed that in this environment i was 100% compliant.
Which surprised me, especially since it is sandbox.
So i tried creating a new Elastic IP and not using it to validate a failed rule state.
PacMan_UnusedElasticIpRule_version-1_UnusedElasticIpRule_elasticip-job
Reproduce steps
Added a new EIP and did not use it.
Expected Results
A Failed test based on the unused rule
Actual Results
All of the tests are passing.
I am bit surprised that things seem to be failing and i get a dashboard saying everything is passing.
The Pacman Rule Engine Job Stats are 1000+ Failed and 105 Succeeded.
Would seem like there is something broken with the deployment, but not sure what specifically i would need to fix.
Here are the logs
23:08:22,926 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@27ddd392 - Registering current configuration as safe fallback point
23:08:22,926 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@27ddd392 - Registering current configuration as safe fallback point
23:08:22
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
23:08:23
2018-10-29 23:08:23 [main] DEBUG c.t.pacman.executor.RuleExecutor - rule Param String {"autofix": false, "ruleType": "ManageRule", "alexaKeyword": "UnusedElasticIpRule", "ruleId": "PacMan_UnusedElasticIpRule_version-1_UnusedElasticIpRule_elasticip", "ruleRestUrl": "", "environmentVariables": [], "targetType": "elasticip", "ruleUUID": "09159bf1-a452-4746-bccf-6f9b162824ab", "params": [{"encrypt":
23:08:23
2018-10-29 23:08:23 [main] DEBUG c.t.pacman.executor.RuleExecutor - target Type :elasticip
23:08:23
2018-10-29 23:08:23 [main] DEBUG c.t.pacman.executor.RuleExecutor - rule Key : check-for-unused-elastic-ip
23:08:23
2018-10-29 23:08:23 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] DEBUG c.t.pacman.executor.RuleExecutor - uncaught exception handler engaged.
23:08:23
2018-10-29 23:08:23 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] DEBUG c.t.pacman.executor.RuleExecutor - shutdown hook engaged.
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] DEBUG com.tmobile.pacman.util.ESUtils - querying ES for target type:elasticip
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] ERROR com.tmobile.pacman.util.CommonUtils - {"query":{"bool":{"must":[{"term":{"latest":"true"}}]}}}
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] ERROR com.tmobile.pacman.util.CommonUtils - error closing issueunable to execute post request because Not Found
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] ERROR com.tmobile.pacman.util.ESUtils - error getting total documents
23:08:24
java.lang.Exception: unable to execute post request because Not Found
23:08:24
at com.tmobile.pacman.util.CommonUtils.doHttpPost(CommonUtils.java:201)
23:08:24
at com.tmobile.pacman.util.ESUtils.getTotalDocumentCountForIndexAndType(ESUtils.java:143)
23:08:24
at com.tmobile.pacman.util.ESUtils.getResourcesFromEs(ESUtils.java:90)
23:08:24
at com.tmobile.pacman.executor.RuleExecutor.run(RuleExecutor.java:182)
23:08:24
at com.tmobile.pacman.executor.RuleExecutor.main(RuleExecutor.java:91)
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] DEBUG com.tmobile.pacman.util.ESUtils - total resource count-1
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] DEBUG com.tmobile.pacman.util.ESUtils - inventory query{"size":10000,"query":{"bool":{"must":[{"term":{"latest":"true"}}]}}}
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] ERROR com.tmobile.pacman.util.CommonUtils - {"size":10000,"query":{"bool":{"must":[{"term":{"latest":"true"}}]}}}
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] ERROR com.tmobile.pacman.util.CommonUtils - error closing issueunable to execute post request because Not Found
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] ERROR com.tmobile.pacman.util.ESUtils - error retrieving inventory from ES
23:08:24
java.lang.Exception: unable to execute post request because Not Found
23:08:24
at com.tmobile.pacman.util.CommonUtils.doHttpPost(CommonUtils.java:201)
23:08:24
at com.tmobile.pacman.util.ESUtils.getDataFromES(ESUtils.java:373)
23:08:24
at com.tmobile.pacman.util.ESUtils.getResourcesFromEs(ESUtils.java:92)
23:08:24
at com.tmobile.pacman.executor.RuleExecutor.run(RuleExecutor.java:182)
23:08:24
at com.tmobile.pacman.executor.RuleExecutor.main(RuleExecutor.java:91)
23:08:24
2018-10-29 23:08:24 2b571590-2e58-4ee3-a690-8f3e382c7283 [main] ERROR c.t.pacman.executor.RuleExecutor - unable to get inventory for aws-all--elasticip
23:08:24
java.lang.Exception: unable to execute post request because Not Found
23:08:24
at com.tmobile.pacman.util.CommonUtils.doHttpPost(CommonUtils.java:201)
23:08:24
at com.tmobile.pacman.util.ESUtils.getDataFromES(ESUtils.java:373)
23:08:24
at com.tmobile.pacman.util.ESUtils.getResourcesFromEs(ESUtils.java:92)
23:08:24
at com.tmobile.pacman.executor.RuleExecutor.run(RuleExecutor.java:182)
The text was updated successfully, but these errors were encountered: