<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bhanu prakash</title>
    <description>The latest articles on DEV Community by Bhanu prakash (@bhanu_prakash_bd40068f3b6).</description>
    <link>https://dev.to/bhanu_prakash_bd40068f3b6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3738577%2F942e866b-c9d4-4f93-b928-56a51b7a9f0c.jpg</url>
      <title>DEV Community: Bhanu prakash</title>
      <link>https://dev.to/bhanu_prakash_bd40068f3b6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bhanu_prakash_bd40068f3b6"/>
    <language>en</language>
    <item>
      <title>Why We Killed Nested Namespaces (And You Probably Should Too)</title>
      <dc:creator>Bhanu prakash</dc:creator>
      <pubDate>Fri, 30 Jan 2026 02:08:50 +0000</pubDate>
      <link>https://dev.to/bhanu_prakash_bd40068f3b6/why-we-killed-nested-namespaces-and-you-probably-should-too-3b4b</link>
      <guid>https://dev.to/bhanu_prakash_bd40068f3b6/why-we-killed-nested-namespaces-and-you-probably-should-too-3b4b</guid>
      <description>&lt;p&gt;The Plan vs. Reality&lt;br&gt;
The real problem was our namespace architecture. We'd designed this beautiful parent-child hierarchy:&lt;br&gt;
&lt;code&gt;engineering/&lt;br&gt;
  ├── team-alpha/&lt;br&gt;
  ├── team-beta/&lt;br&gt;
research/&lt;br&gt;
  ├── lab-1/&lt;br&gt;
  ├── lab-2/&lt;/code&gt;&lt;br&gt;
Looked clean in diagrams. Worked terribly in practice.&lt;br&gt;
What Broke First&lt;br&gt;
Problem 1: Permission inheritance was a minefield&lt;br&gt;
Team Alpha couldn't understand why their policies sometimes worked and sometimes didn't. Turns out, parent namespace policies were interfering in ways nobody expected.&lt;br&gt;
Created a policy in engineering/? Congrats, it now affects engineering/team-alpha/ in weird ways.&lt;br&gt;
Problem 2: Mental overhead&lt;br&gt;
Support conversation:&lt;/p&gt;

&lt;p&gt;Team: "Our secret isn't working"&lt;br&gt;
Me: "Which namespace?"&lt;br&gt;
Team: "Uh... the team one?"&lt;br&gt;
Me: "Parent or child?"&lt;br&gt;
Team: "What's the difference?"&lt;/p&gt;

&lt;p&gt;Every. Single. Time.&lt;br&gt;
Problem 3: Automation nightmare&lt;br&gt;
Writing scripts that work across parent AND child namespaces meant handling two different permission models. Code got messy fast:&lt;br&gt;
&lt;code&gt;This got old real quick&lt;br&gt;
if is_parent_namespace(ns):&lt;br&gt;
    apply_parent_logic()&lt;br&gt;
else:&lt;br&gt;
    apply_child_logic()&lt;br&gt;
    check_parent_inheritance()&lt;br&gt;
    pray_it_works()&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Breaking Point
&lt;/h2&gt;

&lt;p&gt;I was onboarding a new team. Simple task: create their namespace, set up AppRole auth, done.&lt;/p&gt;

&lt;p&gt;Except their parent namespace had conflicting policies. Their child namespace inherited permissions they didn't need. Auth setup failed in ways the error messages didn't explain.&lt;/p&gt;

&lt;p&gt;Took me 3 hours to debug what should've been a 10-minute task.&lt;/p&gt;

&lt;p&gt;That's when I talked to the team: "What if we just... stopped doing this?"&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Go Flat
&lt;/h2&gt;

&lt;p&gt;We killed the hierarchy. New model:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
team-alpha/&lt;br&gt;
team-beta/&lt;br&gt;
lab-1/&lt;br&gt;
lab-2/&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Need logical grouping? Use naming conventions:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
eng_team-alpha/&lt;br&gt;
eng_team-beta/&lt;br&gt;
research_lab-1/&lt;br&gt;
research_lab-2/&lt;/code&gt;&lt;br&gt;
Underscores instead of slashes. Flat instead of nested.&lt;br&gt;
What Changed&lt;br&gt;
Onboarding went from 3 hours to 15 minutes&lt;br&gt;
One namespace model. One set of policies. No inheritance surprises.&lt;br&gt;
Support tickets dropped&lt;br&gt;
Teams understood their namespace. No more "which namespace am I in?" questions.&lt;br&gt;
Automation got stupid simple&lt;br&gt;
No special cases. No inheritance checks. Just works.&lt;br&gt;
Policies became predictable&lt;br&gt;
What you write is what you get. No parent namespace secretly modifying things.&lt;br&gt;
The Migration&lt;br&gt;
Wasn't instant. We had production services in nested namespaces.&lt;br&gt;
Phase 1: New namespaces use flat model only&lt;br&gt;
Phase 2: Migrate low-risk teams first&lt;br&gt;
Phase 3: Production migrations during maintenance windows&lt;br&gt;
Phase 4: Deprecate parent/child model entirely&lt;br&gt;
Took 3 months. Worth every minute.&lt;br&gt;
The Pushback&lt;br&gt;
"But we lose organizational structure!"&lt;br&gt;
No, you don't. Use naming: dept_team_project. You can still grep, filter, and organize.&lt;br&gt;
"What about RBAC across departments?"&lt;br&gt;
Use Vault groups and entity aliases. Group-based permissions work better than namespace inheritance anyway.&lt;br&gt;
"HashiCorp docs show parent/child namespaces!"&lt;br&gt;
Docs show what's possible, not what's practical at scale. We learned the hard way.&lt;br&gt;
When Nested Namespaces Make Sense&lt;br&gt;
Look, I'm not saying nested namespaces are always wrong. They work if:&lt;/p&gt;

&lt;p&gt;You have &amp;lt;10 namespaces total&lt;br&gt;
Your team deeply understands Vault internals&lt;br&gt;
You actually need different permission models per layer&lt;/p&gt;

&lt;p&gt;We had 50+ namespaces and growing. Engineering teams, not Vault experts. Flat was the right call.&lt;br&gt;
What I'd Tell My Past Self&lt;br&gt;
"That pretty hierarchy in your architecture diagram? Users don't care. They want their secrets to work. Keep it simple."&lt;br&gt;
Complexity is seductive in infrastructure design. Resist it.&lt;br&gt;
The Vault Philosophy We Learned&lt;br&gt;
Vault's "deny by default" model is powerful but unforgiving. Every layer of abstraction (like nested namespaces) adds opportunities for unexpected denials.&lt;br&gt;
Simpler architecture = fewer surprises = happier teams.&lt;br&gt;
Try This&lt;br&gt;
If you're using nested namespaces, run this check:&lt;br&gt;
bash# How many support tickets mention "namespace" or "permission denied"?&lt;br&gt;
If it's more than 10% of your Vault tickets, consider flattening.&lt;br&gt;
Your future self will thank you.&lt;/p&gt;

</description>
      <category>hashicorp</category>
      <category>vault</category>
      <category>yaml</category>
      <category>terraform</category>
    </item>
    <item>
      <title>How I Discovered a Critical Security Gap in Our HashiCorp Vault - And What It Taught Me About Policy Design</title>
      <dc:creator>Bhanu prakash</dc:creator>
      <pubDate>Thu, 29 Jan 2026 01:59:09 +0000</pubDate>
      <link>https://dev.to/bhanu_prakash_bd40068f3b6/how-i-discovered-a-critical-security-gap-in-our-hashicorp-vault-and-what-it-taught-me-about-55e3</link>
      <guid>https://dev.to/bhanu_prakash_bd40068f3b6/how-i-discovered-a-critical-security-gap-in-our-hashicorp-vault-and-what-it-taught-me-about-55e3</guid>
      <description>&lt;p&gt;The Day I Found a Security Hole in Our Vault Setup&lt;br&gt;
The "Oh Shit" Moment&lt;br&gt;
I was writing a Python script to inventory service accounts across our 50+ Vault namespaces when something caught my eye. Teams were creating auth mounts with weird names - stuff we never approved.&lt;/p&gt;

&lt;p&gt;Turns out, our wildcard policies had a massive flaw.&lt;/p&gt;

&lt;p&gt;What We Screwed Up&lt;br&gt;
Our policy looked innocent enough:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;path "auth/*" {&lt;br&gt;
  capabilities = ["create", "read", "update", "delete", "list"]&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
We thought: "Let teams manage auth in their namespace. What could go wrong?"&lt;/p&gt;

&lt;p&gt;Everything. Everything could go wrong.&lt;/p&gt;

&lt;p&gt;That wildcard meant teams could create any auth mount type, not just the standard AppRole we supported. So they did:&lt;/p&gt;

&lt;p&gt;Custom AppRole mounts: auth/my-special-approle/&lt;/p&gt;

&lt;p&gt;Random Kubernetes auth (we don't even use K8s auth)&lt;/p&gt;

&lt;p&gt;LDAP configs that bypassed our central auth&lt;/p&gt;

&lt;p&gt;Experimental mounts nobody remembered creating&lt;/p&gt;

&lt;p&gt;Out of 50+ namespaces, 15% had rogue auth mounts we didn't know existed.&lt;/p&gt;

&lt;p&gt;Why This Actually Mattered&lt;br&gt;
Monitoring blindspot: Our Splunk dashboards looked for auth/approle/. These custom mounts were invisible.&lt;/p&gt;

&lt;p&gt;Support hell: Teams configured Vault Agents wrong, got auth failures, opened tickets. We couldn't help because their setup didn't match our docs.&lt;/p&gt;

&lt;p&gt;Future nightmare: Try migrating 50 namespaces when everyone's doing their own thing.&lt;/p&gt;

&lt;p&gt;How I Found It&lt;br&gt;
Simple inventory script:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for namespace in all_namepaces:&lt;br&gt;
    auth_mounts = vault_client.sys.list_auth_methods()&lt;br&gt;
    for mount in auth_mounts:&lt;br&gt;
        if mount not in ['approle/', 'token/']:&lt;br&gt;
            print(f"WTF is this: {namespace}/{mount}")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The output was... concerning.&lt;/p&gt;

&lt;p&gt;Checked Splunk to see if anyone was actually using these:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;index=vault_audit request.path="auth/*/login"&lt;br&gt;
| stats count by request.namespace request.path&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;40% had zero logins in 90 days. Dead mounts from old experiments.&lt;/p&gt;

&lt;p&gt;The Fix&lt;br&gt;
Step 1: Stop the bleeding - locked down policies immediately:&lt;/p&gt;

&lt;p&gt;`Old (bad)&lt;br&gt;
path "auth/*" { capabilities = ["create", "read", "update", "delete"] }&lt;/p&gt;

&lt;h1&gt;
  
  
  New (specific)
&lt;/h1&gt;

&lt;p&gt;path "auth/approle/*" { capabilities = ["create", "read", "update", "delete"] }`&lt;/p&gt;

&lt;p&gt;Step 2: Reached out to teams, made migration plans&lt;/p&gt;

&lt;p&gt;Step 3: Still migrating production stuff months later (it takes time)&lt;/p&gt;

&lt;p&gt;What I Learned&lt;br&gt;
Wildcards are dangerous. Be explicit. Always.&lt;/p&gt;

&lt;p&gt;Your monitoring only catches what you're looking for. Inventory everything, not just what you expect.&lt;/p&gt;

&lt;p&gt;Standards aren't real until you enforce them. Documentation doesn't count if the system allows chaos.&lt;/p&gt;

&lt;p&gt;Fixing production takes forever. We're still cleaning this up.&lt;/p&gt;

&lt;p&gt;The Bigger Issue&lt;br&gt;
This also exposed that our parent/child namespace model was overly complex. We eventually flattened everything - but that's Part 2.&lt;/p&gt;

&lt;p&gt;If You Run Vault&lt;br&gt;
Check your policies right now:&lt;/p&gt;

&lt;p&gt;vault policy read your-policy | grep "*"&lt;/p&gt;

&lt;p&gt;Every wildcard is a potential problem. Can you be more specific?&lt;/p&gt;

&lt;p&gt;Then actually inventory what exists in your Vault. I bet you'll find surprises.&lt;/p&gt;

&lt;p&gt;Next up: Why we ditched nested namespaces and went flat. Plus the monitoring system I built to catch this stuff automatically.&lt;/p&gt;

&lt;p&gt;Drop a comment if you've hit similar issues. I know I'm not the only one.&lt;/p&gt;

</description>
      <category>hashicorp</category>
      <category>vault</category>
      <category>python</category>
      <category>splunk</category>
    </item>
  </channel>
</rss>
