Skip to content

all APIs erroring on POSTS to ElasticSearch #445

Open
@animaxcg

Description

@animaxcg

Micro services

  • Spring boot Applications:

Webapp

  • 2.0

Setup

public ALB with public subnets (subnet has route table attachment with igw attached

Summary

all APIs erroring on POSTS to ElasticSearch

Reproduce steps

Deploy with public ALB login. no assest found (when looking at assets/volnerabillits cloudwatch logs all have stack traces when trying to do a http post to elasticsearch

Expected Results

The api's to work

Actual Results

assets cloudwatch logs:
2020-06-17T17:59:52.242-05:00
com.zaxxer.hikari.HikariDataSource.getConnection - HikariPool-1 - Start completed.
17-06-2020 23:00:07.536 [http-nio-80-exec-1] ERROR
c.t.p.api.commons.utils.PacHttpUtils.doHttpPost - URL: http://somedomain.us-east-1.es.amazonaws.com:80/aws/_search/?size=0 Body:
{
"size": "0",
"query": {
"bool": {
"must": [
{
"term": {
"latest": "true"
}
},
{
"term": {
"_entity": "true"
}
}
]
}
},
"aggs": {
"name": {
"terms": {
"field": "_type",
"size": 1000
}
}
}
}
17-06-2020 23:00:07.538 [http-nio-80-exec-1] ERROR


<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c142 79.160924, 2017/07/13-01:06:39 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""/>
</rdf:RDF>
</x:xmpmeta>

<style> .cls-1 { font-size: 229.167px; }
  .cls-1, .cls-2, .cls-3, .cls-4 {
    fill: #fff;
    font-family: "Titillium Web";
  }

  .cls-1, .cls-2, .cls-3 {
    font-weight: 700;
  }

  .cls-2 {
    font-size: 50px;
  }

  .cls-3 {
    font-size: 100px;
  }

  .cls-4 {
    font-size: 36px;
    font-weight: 300;
  }
</style>

Pacbot Titillium Aa ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzyz&£$%[]!?*º c.t.p.api.commons.utils.PacHttpUtils.doHttpPost - URL: http://somedomain.us-east-1.es.amazonaws.com:80/aws/_search/?size=0 Body: { "size": "0", "query": { "bool": { "must": [ { "term": { "latest": "true" } }, { "term": { "_entity": "true" } }, { "terms": { "_type": [ "ec2", "s3", "appelb", "asg", "classicelb", "stack", "dynamodb", "efs", "emr", "lambda", "nat", "eni", "rdscluster", "rdsdb", "redshift", "sg", "snapshot", "subnet", "targetgroup", "volume", "vpc", "api", "iamuser", "iamrole", "rdssnapshot", "account", "checks", "kms", "phd", "cloudfront", "elasticip", "routetable", "internetgateway", "launchconfig", "networkacl", "vpngateway", "asgpolicy", "snstopic", "dhcpoption", "peeringconnection", "customergateway", "vpnconnection", "directconnect", "virtualinterface", "elasticsearch", "elasticache" ] } } ] } }, "aggs": { "name": { "terms": { "field": "tags.Application.keyword", "size": 10000 }, "aggs": { "providers": { "terms": { "field": "_cloudType.keyword", "size": 10000 } } } } } } 17-06-2020 23:00:07.543 [http-nio-80-exec-3] ERROR 17-06-2020 23:00:07.543 [http-nio-80-exec-3] ERROR 17-06-2020 23:00:07.545 [http-nio-80-exec-3] ERROR 17-06-2020 23:00:07.545 [http-nio-80-exec-3] ERROR

c.t.p.a.a.r.AssetRepositoryImpl.getDistributionDataFromES - error retrieving inventory from ES
java.lang.Exception: unable to execute post request to http://somedomain.us-east-1.es.amazonaws.com:80/aws/_search/?size=0 because Not Found
at com.tmobile.pacman.api.commons.utils.PacHttpUtils.doHttpPost(PacHttpUtils.java:93)
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getDistributionDataFromES(AssetRepositoryImpl.java:354)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getTotalDistributionForIndexAndTypeWithProviders(AssetRepositoryImpl.java:281)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getApplicationAssetCountByAssetGroupWithProvider(AssetRepositoryImpl.java:249)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getApplicationAssetCountByAssetGroup(AssetRepositoryImpl.java:225)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getApplicationByAssetGroup(AssetRepositoryImpl.java:215)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl$$FastClassBySpringCGLIB$$26e07b49.invoke()

2020-06-17T18:00:07.546-05:00
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

2020-06-17T18:00:07.546-05:00
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl$$EnhancerBySpringCGLIB$$587823aa.getApplicationByAssetGroup()

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.service.AssetServiceImpl.getAssetGroupInfo(AssetServiceImpl.java:206)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.service.AssetServiceImpl$$FastClassBySpringCGLIB$$74f7e251.invoke()

2020-06-17T18:00:07.546-05:00
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.service.AssetServiceImpl$$EnhancerBySpringCGLIB$$7829db24.getAssetGroupInfo()

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.controller.AssetController.getAssetGroupInfo(AssetController.java:169)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.controller.AssetController$$FastClassBySpringCGLIB$$b72bbe2d.invoke()

2020-06-17T18:00:07.546-05:00
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

2020-06-17T18:00:07.546-05:00
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)

2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)

2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.controller.AssetController$$EnhancerBySpringCGLIB$$d2034a6d.getAssetGroupInfo()

2020-06-17T18:00:07.546-05:00
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2020-06-17T18:00:07.546-05:00
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

2020-06-17T18:00:07.546-05:00
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

2020-06-17T18:00:07.546-05:00
at java.lang.reflect.Method.invoke(Method.java:498)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)

2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)

on the front end it shows 500s and 417s when calling API's for assets/vulnerabilities etc

I have tried also with 1.2 and 1.5 and 1.6 and get the same issue. is there something on the routing that is missing from the documentation
https://github.com/tmobile/pacbot/blob/master/installer/FAQs.md

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions