oci-dbm-vault
Skill3 starsChanged 7 months agoMITView on GitHub
Creates or validates a vault secret for the ADB ADMIN password and ensures the IAM policy has both required statements for DBM secret access. Trigger when a user says "set up vault for DBM", "create the DBM secret", or when oci-dbm-commission directs here.
In this repository8 other files it gives its agents.
- oci-dbm-commissionSkill
- oci-dbm-enableSkill
- oci-dbm-jobsSkill
- oci-dbm-networkSkill
- oci-dbm-provisionSkill
- oci-dbm-serverSkill
- oci-dbm-workloadSkill
- oci-setupSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Call VaultsClient.list_secrets(compartment_id=compartment_ocid, vault_id=vault_ocid) and filter by secret_name.
- Very specific: line 33
If a matching secret is found with lifecycle_state not PENDING_DELETION or DELETED: print its OCID, confirm it, and skip creation (go to …
- Distinctive: line 34
If not found, proceed to Step 2.
- Very specific: line 38
Call KmsManagementClient.list_keys(compartment_id=compartment_ocid) to retrieve the master encryption key OCID (key_id) from the vault.
- Very specific: line 54
Call IdentityClient.list_policies(compartment_id=compartment_ocid) and scan all policies for these two statements (substituting actual …
- Very specific: line 70
If the target policy exists, retrieve its current statements, append the missing one, and call IdentityClient.update_policy() using …
- Very specific: line 71
If no policy exists yet, create one with IdentityClient.create_policy() containing both statements.
- Distinctive: line 91
Before handing off, verify:
- Distinctive: line 95
Do not proceed if either check fails.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
oci-dbm-vault
This skill is a worker in the oci-dbm-commission chain. It does NOT generate scripts. It uses the OCI Python SDK directly to store the ADB ADMIN password as a vault secret and to configure the two IAM policy statements that Database Management requires to read that secret.
Inputs
These values are passed by oci-dbm-commission (or supplied directly by the user):
| Input | Description | Example |
compartment_ocid | OCID of the compartment where the vault and policy live | ocid1.compartment.oc1..aaa... |
vault_ocid | OCID of an existing OCI Vault (must already exist) | ocid1.vault.oc1.iad.aaa... |
admin_password | The ADB ADMIN password — prompt securely if not provided; never log it | Str0ngP@ss! |
secret_name | Name for the secret (default: <dbname>_admin_pwd) | dbmdemo_admin_pwd |
db_name | ADB DB name, used to derive default secret_name if not specified | dbmdemo |
policy_name | Name of the IAM policy to create or update | dbm-secret-access-policy |
What This Skill Executes
Step 1 — Check Whether the Secret Already Exists
Call VaultsClient.list_secrets(compartment_id=compartment_ocid, vault_id=vault_ocid) and filter by secret_name.
- If a matching secret is found with
lifecycle_statenotPENDING_DELETIONorDELETED: print its OCID, confirm it, and skip creation (go to Step 3). - If not found, proceed to Step 2.
Step 2 — Create the Secret
- Call
KmsManagementClient.list_keys(compartment_id=compartment_ocid)to retrieve the master encryption key OCID (key_id) from the vault. - Base64-encode the
admin_password:import base64 encoded = base64.b64encode(admin_password.encode()).decode() - Call
VaultsClient.create_secret()with:compartment_id=compartment_ocidvault_id=vault_ocidkey_id=key_idsecret_name=secret_namesecret_content=Base64SecretContentDetails(content=encoded, content_type='BASE64', stage='CURRENT')
- Poll until
secret.lifecycle_state == 'ACTIVE'. Print the resultingsecret_ocid.
Step 3 — Verify IAM Policy Has Both Required Statements
Call IdentityClient.list_policies(compartment_id=compartment_ocid) and scan all policies for these two statements (substituting actual compartment name and secret OCID):
Statement A — grants DBM managed database principal access to the secret:
Allow any-user to read secret-family in compartment <compartment_name>
where ALL {target.secret.id = '<secret_ocid>',
request.principal.type = 'dbmgmtmanageddatabase'}Statement B — grants the DBM service itself access during the enablement process:
Allow service dbmgmt to read secret-family in compartment <compartment_name>
where target.secret.id = '<secret_ocid>'For each missing statement:
- If the target policy exists, retrieve its current statements, append the missing one, and call
IdentityClient.update_policy()usingUpdatePolicyDetails(statements=[...existing + new...], version_date=None)— do not passversion_date(see Gotcha 2). - If no policy exists yet, create one with
IdentityClient.create_policy()containing both statements.
Step 4 — Output
Print a summary:
- Secret name and OCID
- The two IAM policy statements, confirmed present
Output the following values for the next skill:
secret_ocid: <ocid>
compartment_ocid: <ocid>
vault_validated: trueConfirmation Before Finishing
Before handing off, verify:
VaultsClient.get_secret(secret_id=secret_ocid)returnslifecycle_state = ACTIVE- Both IAM policy statements are present when
list_policiesis re-read
Do not proceed if either check fails.
What This Skill Hands Back
Outputs passed to oci-dbm-commission (and subsequently to oci-dbm-enable):
secret_ocid— OCID of the active vault secret containing the ADMIN passwordcompartment_ocid— unchanged, forwarded for downstream skillsvault_validated: true— signal that this step completed successfully
Gotchas
Gotcha 1 — Statement B is required even before a managed database exists.
Statement A (granting dbmgmtmanageddatabase principal type) only takes effect once the database is registered as a managed database. Statement B (granting service dbmgmt) is what allows the enablement call itself to read the secret. Omitting Statement B causes a silent credential-access failure during enable_autonomous_database_management_feature(). Both statements must be present before calling the enable skill.
Gotcha 2 — Omit version_date from UpdatePolicyDetails.
Passing version_date (even as None explicitly typed as a date object, or as an empty string) triggers a 400 InvalidParameter error from the IAM API. Leave the field entirely absent from the UpdatePolicyDetails constructor, or pass version_date=None only if the SDK accepts it as a no-op. Test with a GET after the update to confirm the statements persisted.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

