Viewing the Contents and Properties of a Secret and the Secret's Versions (Secret Bundles)

Learn how to view the contents of a specified secret, the properties of the secret (and it's secret version), and user-provided contextual metadata for the secret.

  • This task can't be completed in the Console.
  • Open a command prompt and run the oci secrets secret-bundle get command to view the contents and properties of the current secret version:

    oci secrets secret-bundle get --secret-id <target_secret_id> --stage <target_secret_version_rotation_state>

    For example:

    
    oci secrets secret-bundle get --secret-id ocid1.vaultsecret.oc1.iad.exampleaz5qacpqahuecvbjqzql4qmpbrtd7pprafhivcfik6wuitexample --stage CURRENT

    You can also query for a secret with its name and vault ID using the following command:

    oci secrets secret-bundle get-secret-bundle-by-name --secret-name target_secret_name --vault-id target_vault_id --stage target_secret_version_rotation_state
    For example:
    oci secrets secret-bundle get-secret-bundle-by-name --secret-name testSecret --vault-id ocid1.vault.oc1.iad.exampleyaaeuk.examplesuxtdqxczlvygwk4ouq2mhzr223g4o2ojs4o4q4ghmtddlexample --stage CURRENT

    For a complete list of parameters and values for CLI commands, see KMS CLI Command Reference.

  • Use the GetSecretBundle or GetSecretBundleByName APIs to retrieve the contents of the secret, properties of the secret (and secret version), and user-provided contextual metadata for the secret.

    For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.