# Logstash -\> Elastic 403 permission issue

**URL:** <https://discuss.elastic.co/t/logstash-elastic-403-permission-issue/228131>\
**Category:** Logstash\
**Tags:** elastic-stack-security\
**Created:** [April 15, 2020, 1:29pm UTC](https://discuss.elastic.co/t/logstash-elastic-403-permission-issue/228131 "2020-04-15T13:29:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrey\_Sidorenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrey_sidorenko/32/45171_2.png) [@Andrey\_Sidorenko](https://discuss.elastic.co/u/Andrey_Sidorenko)\
**Post date:** [April 15, 2020, 1:29pm UTC](https://discuss.elastic.co/t/logstash-elastic-403-permission-issue/228131/1 "2020-04-15T13:29:27Z")

</div>

Hi,  
I am a new in ELK. At now i trying to configure and use my first elk server.  
I'm trying to configure security through basic realm and have a issue with logstash connection to elastic search. Following guide [https://www.elastic.co/guide/en/elasticsearch/reference/current/security-getting-started.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-getting-started.html) i configured a logstash\_writer role and add logstash\_internal user  
logstash\_writer role:

```auto
{
 "logstash_writer" : {
    "cluster" : [
      "monitor",
     "manage_index_templates"
    ],
    "indices" : [
      {
        "names" : [
         "*"
        ],
       "privileges" : [
          "create",
          "delete",
          "create_index",
          "write"
        ],
        "field_security" : {
          "grant" : [
            "*"
          ]
        },
        "allow_restricted_indices" : false
      }
    ],
    "applications" : [],
    "run_as" : [],
    "metadata" : { },
    "transient_metadata" : {
      "enabled" : true
    }
  }
}

```

logstash\_internal user:

```auto
{
  "logstash_internal" : {
    "username" : "logstash_internal",
    "roles" : [
      "logstash_writer"
    ],
    "full_name" : "",
    "email" : "",
    "metadata" : { },
    "enabled" : true
  }
}

```

On logstash starting he failed with HTTP 403 error from elasticsearch:  
LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError: Got response code '403' contacting Elasticsearch at URL '[http://localhost:9200/logstash](http://localhost:9200/logstash)'  
Output config:

```auto
output {
  elasticsearch {
    hosts => "localhost:9200"
# manage_template => false
# index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
    user => "logstash_internal"
    password => "Password"
  }
# stdout { codec => rubydebug }
}

```

curl -u logstash\_internal:Password [http://localhost:9200/](http://localhost:9200/) works fine  
curl -u logstash\_internal:Password [http://localhost:9200/logstash](http://localhost:9200/logstash) finihing with 403 error code  
\< {"error":{"root\_cause":[{"type":"security\_exception","reason":"action [indices:admin/get] is unauthorized for user [logstash\_internal]"}],"type":"security\_exception","reason":"action [indices:admin/get] is unauthorized for user [logstash\_internal]"},"status":403} /\>  
please help me understand where I made a mistake in the configuration and what needs to be changed

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 13, 2020, 1:29pm UTC](https://discuss.elastic.co/t/logstash-elastic-403-permission-issue/228131/2 "2020-05-13T13:29:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
