Example to costruct a secureJsonFields #253
-
Its little unclear how we can add the secureJsonFields to teh Datasources when downloaded from the grafana server with the secure_data json file from the secure directory, tried multiple options but still could not get it working, is there someone that has already worked on this and sharing a importer.yml sample and a sample of json from the secure directory with custom fields to be secured for some datasources would be realy helpful |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
hello @sureshoss The secure data is sensitive data so the Grafana API will never let you download that information. Same for user passwords etc. https://software.es.net/gdg/docs/gdg/configuration/#connection has an example of what the secureData looks like. There's also some example files here: https://github.com/esnet/gdg/tree/master/test/data/secure If we're using the test data as an example, I have two possible Auth I can use, complex.json and default.json. So in my configuration contexts:
testing:
output_path: test/data
connections:
credential_rules:
- rules:
- field: "name"
regex: "misc"
- field: "url"
regex: ".*esproxy2*"
secure_data: "complex.json"
- rules:
- field: "name"
regex: ".*"
secure_data: "default.json"
url: http://localhost:3000 Here's the standard secureData: {
"basicAuthPassword": "password",
"user": "user"
} There's a lot more fields you can pass but that varies on the connection type etc that you have. As You can see that secure_data references the file_name that lives inside your You can also get a really simple example configured using the context wizard: ./bin/gdg tools ctx new example That will walk you through a very basic CLI wizard to configure a connection, setup your secure/default.json that is referenced by default. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much, i will try it out and let this discussion thread on the outcomes |
Beta Was this translation helpful? Give feedback.
-
There's no real clear cut list of all possible fields, it really depends on your connection/datasource. The example above is the most clear cut 'simple' use case. For example all of these are valid: "secureJsonData": {
"accessKey": "Ol4pIDpeKSA6XikgOl4p",
"secretKey": "dGVzdCBrZXkgYmxlYXNlIGRvbid0IHN0ZWFs"
"basicAuthPassword": "basicpassword"
} In GDG's case just to keep everything together, I'm also adding the |
Beta Was this translation helpful? Give feedback.
hello @sureshoss
The secure data is sensitive data so the Grafana API will never let you download that information. Same for user passwords etc.
https://software.es.net/gdg/docs/gdg/configuration/#connection has an example of what the secureData looks like.
There's also some example files here: https://github.com/esnet/gdg/tree/master/test/data/secure
If we're using the test data as an example, I have two possible Auth I can use, complex.json and default.json.
So in my configuration