Connecting to OCI
To begin using OneLens, you need to connect your OCI account by configuring cost exports, creating a user and assigning required permissions for FinOps assessment. You can assign access at tenancy-level or compartment-level as per your needs.
Create a group
This step creates a group OneLensBillingReader to host the OneLens FinOps Reader user.
Navigate to
Identity & Security>Domains.

Select your domain.

Navigate to the
User Managementtab.

Scroll to
Groups, and selectCreate Group.

In the opened Create group window, enter the following details:
Name:
OneLensBillingReaderDescription:
Group containing OneLens FinOps Reader user for reading cost & usage data for FinOps analysis.

All other options can be left as default.
Click
Create.
Create a user
This step creates the OneLens FinOps Reader user and adds them to the group.
In the
User Managementtab, underUsers, clickCreate.

In the opened Create User window, enter the following details:
First name:
OneLens FinOps ReaderUsername / Email:
onelens.finops@astuto.aiUse the email address as the username:
EnabledGroups: select the
OneLensBillingReadergroupClick
Create.

Create a policy
This step creates a policy that allows the created user in the group to access cost & usage data, and read metadata about resources in your compartment or tenancy.
Search for and navigate to
Policies.Click
Create Policy.
Make sure that the the root compartment is selected.
Cost export policy statements are only supported in the root compartment.

In the opened Create Policy window, enter the following details:
Name:
OneLensReaderPolicyDescription:
Policy statements for enabling OneLens FinOps Reader user to read cost & usage data, and resource-level metadata.Under
Policy Builder, clickShow manual editor.Paste the following policy block in the statement field:
For Tenancy-wide resource visibility:
If you want to have visibility into all resources in your tenancy, use the following policy blocks:
Cost & Usage statements (must be tenancy-level):
define tenancy reporting as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq
endorse group OneLensBillingReader to read objects in tenancy reporting
allow group OneLensBillingReader to read usage-reports in tenancy
allow group OneLensBillingReader to read metrics in tenancy
allow group OneLensBillingReader to read optimizer-api-family in tenancy
allow group OneLensBillingReader to read usage-budgets in tenancy
allow group OneLensBillingReader to read rate-cards in tenancy
allow group OneLensBillingReader to read organizations-family in tenancy
allow group OneLensBillingReader to inspect compartments in tenancy
allow group OneLensBillingReader to inspect tag-namespaces in tenancyResources visibility statement (tenancy-wide inspect with sensitive resources denied):
allow group OneLensBillingReader to inspect all-resources in tenancy where all { target.resource.type != 'user', target.resource.type != 'group', target.resource.type != 'policy', target.resource.type != 'dynamic-group', target.resource.type != 'network-source', target.resource.type != 'authentication-policy', target.resource.type != 'api-key', target.resource.type != 'auth-token', target.resource.type != 'smtp-credential', target.resource.type != 'customer-secret-key', target.resource.type != 'db-credential', target.resource.type != 'identity-provider', target.resource.type != 'identity-provider-group-mapping', target.resource.type != 'oauth2client', target.resource.type != 'vault', target.resource.type != 'key', target.resource.type != 'secret', target.resource.type != 'certificate', target.resource.type != 'private-ca-bundle', target.resource.type != 'console-history', target.resource.type != 'work-request' }For Compartment-scoped resource visibility:
If you want to have visibility into all resources in a specific compartment(s), use the following policy blocks:
Cost & Usage statements (must be tenancy-level):
define tenancy reporting as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq
endorse group OneLensBillingReader to read objects in tenancy reporting
allow group OneLensBillingReader to read usage-reports in tenancy
allow group OneLensBillingReader to read metrics in tenancy
allow group OneLensBillingReader to read optimizer-api-family in tenancy
allow group OneLensBillingReader to read usage-budgets in tenancy
allow group OneLensBillingReader to read rate-cards in tenancy
allow group OneLensBillingReader to read organizations-family in tenancy
allow group OneLensBillingReader to inspect compartments in tenancy
allow group OneLensBillingReader to inspect tag-namespaces in tenancyResources visibility statement (compartment-scoped inspect with sensitive resources denied):
allow group OneLensBillingReader to inspect all-resources in compartment id <CompartmentOCID> where all { target.resource.type != 'user', target.resource.type != 'group', target.resource.type != 'policy', target.resource.type != 'dynamic-group', target.resource.type != 'network-source', target.resource.type != 'authentication-policy', target.resource.type != 'api-key', target.resource.type != 'auth-token', target.resource.type != 'smtp-credential', target.resource.type != 'customer-secret-key', target.resource.type != 'db-credential', target.resource.type != 'identity-provider', target.resource.type != 'identity-provider-group-mapping', target.resource.type != 'oauth2client', target.resource.type != 'vault', target.resource.type != 'key', target.resource.type != 'secret', target.resource.type != 'certificate', target.resource.type != 'private-ca-bundle', target.resource.type != 'console-history', target.resource.type != 'work-request' }<CompartmentOCID> is to be replaced with your actual compartment OCID.
You can add multiple compartments by duplicating the statement with different compartment OCIDs.
For Resource family-scoped resource visibility:
Cost & Usage statements (must be tenancy-level):
define tenancy reporting as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr56u7cj63lf3wffbilvqknstgtvzub7vhqkggq
endorse group OneLensBillingReader to read objects in tenancy reporting
allow group OneLensBillingReader to read usage-reports in tenancy
allow group OneLensBillingReader to read metrics in tenancy
allow group OneLensBillingReader to read optimizer-api-family in tenancy
allow group OneLensBillingReader to read usage-budgets in tenancy
allow group OneLensBillingReader to read rate-cards in tenancy
allow group OneLensBillingReader to read organizations-family in tenancy
allow group OneLensBillingReader to inspect compartments in tenancy
allow group OneLensBillingReader to inspect tag-namespaces in tenancyResources visibility statements (only scoped to minimal resources):
allow group OneLensBillingReader to inspect instance-family in tenancy
allow group OneLensBillingReader to inspect volume-family in tenancy
allow group OneLensBillingReader to inspect virtual-network-family in tenancy
allow group OneLensBillingReader to inspect load-balancer-family in tenancy
allow group OneLensBillingReader to inspect database-family in tenancy
allow group OneLensBillingReader to inspect autonomous-database-family in tenancy
allow group OneLensBillingReader to inspect object-family in tenancy
allow group OneLensBillingReader to inspect file-family in tenancy
allow group OneLensBillingReader to inspect functions-family in tenancy
allow group OneLensBillingReader to inspect dns-family in tenancy 
Note that even though we have used inspect statement here (can only read metadata), we have added a deny block for disallowing the following sensitive resource types for added security:
Identity & credentials:
user
group
policy
dynamic-group
network-source
authentication-policy
api-key
auth-token
smtp-credential
customer-secret-key
db-credential
identity-provider
identity-provider-group-mapping
oauth2client
Keys & secrets:
vault
key
secret
certificate
private-ca-bundle
Logs & traces:
console-history
work-request
If you require any additional items to be explicitly denied, please feel free to reach out to the OneLens team.
Generating & sharing credentials
This step guides you to add a public key to the user, generating and sharing the Configuration File.
Navigate to
Identity & Security>Domains.Select your domain.
Navigate to the
User Managementtab.Under
Users,select theOneLens FinOps Readeruser.Navigate to the
API keystab and selectAdd API key.

In the opened
Add API keywindow, selectChoose public key file, and upload the Public Key shared to you by the OneLens team.Click
Add.

In the
API keyslist, click thethree dotsto the right of the API key just added, and clickView configuration file.

In the opened
Configuration file previewwindow, clickCopyto copy the content.

Share the copied value to the OneLens team over a secure channel like email.
Congratulations, you have completed the OCI integration with OneLens.
Read on for more details on how we generate keys to share with you, a full definition of permissions assigned and what they are used for.
Last updated

