no permissions for [cluster:monitor/main]

so, I am using elastic’s official elastic search image to run elastcsearch version 6.7.2 and installing search guard plugin version com.floragunn:search-guard-6:6.7.2-25.1 in the Dockerfile. Now the very same thing works when I tried it all with elasticsearch version 7.0.1 but getting below error If I run that docker image which runs the version 6.7.2
Dockerfile can be found at

{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "no permissions for [cluster:monitor/main] and User [name=admin, roles=[], requestedTenant=null]"
}
],
"type": "security_exception",
"reason": "no permissions for [cluster:monitor/main] and User [name=admin, roles=[], requestedTenant=null]"
},
"status": 403
}

I tried to change the sg_roles_mapping.yml with mentioned values but agadmin failed with below error
sg_roles_mapping.yml

sg_user:
  users:
    - admin:
    readall: true

sgadmin.sh error

Will update 'sg/rolesmapping' with ../sgconfig/sg_roles_mapping.yml 
   FAIL: Configuration for 'rolesmapping' failed because of com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException: while parsing a block collection
 in 'reader', line 37, column 5:
        - admin:
        ^
expected <block end>, but found Key
 in 'reader', line 38, column 5:
        readall: true  
        ^

It looks like an issue with the format in which I am making the the entry , but I was not able to resolve that.
Once more thing, do I actually need to do this, because I dont get any error if try to do the same thing and install it on my ubuntu machine and not in docker.
Any help is appreciated.