Solo developer building practical CLI tools for Linux auditing and B2B data extraction. Creator of Vaultcheck and NPILift. I write about silent failures, false green lights, and infrastructure reliabi
Two checks I would add, because both of these read back fine: for the ACL, prove it as the principal rather than reading the listing — sudo -u steve cat /path plus getfacl -p /path | grep -E '^(mask|group)' — since the mask gets recomputed every time setfacl touches a group entry, so a listing you took two commands ago can already be stale. For the Azure side, the id to assign is the service principal object id, not the app registration's: az ad sp show --id --query id -o tsv prints the one ARM will actually authorise, and the other one is accepted silently, which is exactly the failure you described.
@dafili Thank you for the comment. Proving it as the principal is the right instinct, though Steve needed to write as well as read on that file, so a cat test alone would still pass against a clipped mask.
One note on az ad sp show: that's the exact command the lab denied, which is what sent me to the token's oid claim in the first place. You're right about which ID it is, it just wasn't a route I had.
And the recalculation is slightly wider than group entries. setfacl recalculates unless a mask is given explicitly or you pass -n, and here it was the named user entry for Steve that widened it.
Solo developer building practical CLI tools for Linux auditing and B2B data extraction. Creator of Vaultcheck and NPILift. I write about silent failures, false green lights, and infrastructure reliabi
Before any cat or append test, let getfacl tell you: getfacl -p /path | grep -B1 effective prints an #effective:r-- comment next to every entry the mask clips, so a named user losing the write bit shows up as a string, not as a failed write you have to provoke. On the recalculation — re-read the mask line after each setfacl -m, because a group::r-- on the file plus u:steve:rw pushes mask to rw- and that widens the whole group class at once; -n only stops the recompute, the next -m without -n puts it back.
@dafili Taking the first one you noted. I think that's better than what I suggested. getfacl prints the comment by default for any line where the entry's rights differ from the effective rights, so the clip shows up as a string with no write to provoke. The comment sits on the entry's own line, though, so the -B1 isn't doing anything.
A wider mask doesn't widen the group class, because the access check needs the permission in both the entry and the mask. group::r-- with mask::rw- is still r-- for the owning group. What widens is the display, since the group mode bits correspond to the mask once one exists, which is the trap the post was about.
And agreed on -n being temporary, though setting the mask explicitly in the same -m also stops the recompute.
Solo developer building practical CLI tools for Linux auditing and B2B data extraction. Creator of Vaultcheck and NPILift. I write about silent failures, false green lights, and infrastructure reliabi
Right, -B1 buys nothing: the effective line is printed under the entry it belongs to, so the line above a clipped entry is that entry's own line.
The -n belongs on the setfacl, not the getfacl — setfacl recomputes the mask from the union of the group class on every -m unless you pass -n, so setfacl -n -m g:team:r-- f is the one that leaves a wider mask intact, and the plain -m form is what narrowed it in the first place.
Worth one line in the post: once a mask exists the group mode bits are that mask, so stat -c %a drifting from 755 to 750 is the cheap tell an ACL is in play at all.
@dafili Same conclusion, different reason. The effective comment is on the entry's own line, aligned to column 40 on a terminal and tab-separated otherwise, which is why the plain grep works and -B1 has nothing to catch.
Agreed on -n belonging to setfacl. Though the recalculation is to the union of the group class, so it can widen as well as narrow. In the post, it widened, since group::r-- plus user:steve:rw- gives rw-.
On stat, I'd stay with the +. If the union lands on the group bits already there, %a doesn't move at all, and it can't tell you an ACL exists either way. Coreutils documents that character as the marker for an alternate access method, which indicates whether the number drifted or not.
Hi @ndcodes bro, I hope everything is going great with you.😀 Just a gentle reminder that you haven't joined Necoz yet.😀 We would really appreciate it if you could join us when you're free. Looking forward to seeing you there!❤️🥰
Really happy to have you joining us.
“Small. Simple. Useful. Built together.” is exactly the spirit. Looking forward to seeing what you build, share, or just casually jump into with us!
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
The mask detail is the one I'll actually remember, ls -l showing rw- in the group field while the owning group only has r--, and the only hint is that little + at the end. Same story on the Azure side, ARM happily accepting the app ID for a policy that then authorises nobody, and Forbidden pointing everywhere except the wrong GUID. Your token oid trick is worth stealing for any lab where Graph is closed, though I'd love a note on what to do when even the token route is locked down. Which of the two caught you longer, the mask or the GUID?
The GUID, by a long way. The mask I only spotted afterwards, reading getfacl next to ls -l and seeing the two disagree, so it cost me nothing at the time. The GUID was most of the task, because a policy that reads back correctly gives you nothing to debug.
On the token route, it's harder to close than it looks. oid isn't a separate privilege, it rides in the token that authorises every other call, so if you can reach ARM you already have it. What usually breaks is the decode .
The claims reference says claims are only present if there's a value to fill them, and for users you need the profile scope to get oid. A service principal made that moot here, but I wouldn't assume it for a user-delegated token.
And outside a lab, the real answer is not to discover it at all. Whatever created the principal had the object ID in its create output, so it belongs in the pipeline as a parameter.
CTO & software architect, 15+ years in backend and infrastructure. Writing about bringing order to projects: observability, architecture, teams, processes. Blog: mind.mansur.expert
Re-running the encrypt/decrypt check after removing the temporary create permission is a particularly useful detail. It makes the verification describe the configuration actually left behind, which is easy to miss when the setup itself finally starts working.
That'sdefintely true, @fattakhov Mansur. That one cost me a rewrite because the first round trip passed while create was still in the policy and proved nothing about what I'd left behind.
The durable takeaway from troubleshooting policy issues is to record the effective configuration, not only the intended one. A small before-and-after check that prints the resolved policy and identity can prevent the same invisible mismatch on the next deployment.
@alexshev Alex. I totally agree with you that recording the effective, not only the intended, which is a valuable lesson, and printing the resolved identity alongside the policy would have caught this one in a line.
Thank you so much, Divya, that's very kind of you. 🙏
Honestly, the labs vary. Some I finish in minutes, others take a whole hour, and sometimes I fail the task and have to give it another go. The writing is the hard but exciting part. It takes one to three hours, and those hours are where I find out I didn't properly understand what I'd just done. But then I'll get to unlearn and learn new things.
Ten to go. Thank you for being here for so many of them.
I've spent 16 years finding things that don't work. These days, I also teach AI how to find them.
Somewhere along the way, I started writing stories about AI, work, and life.
Now I run The Third Cup.
Your café sitting directly above my ACL masks in the feed. Chinese philosophy over coffee, then a man complaining about GUIDs. The feed got the running order right. 😄 Five Elements is open in the next tab.
I've spent 16 years finding things that don't work. These days, I also teach AI how to find them.
Somewhere along the way, I started writing stories about AI, work, and life.
Now I run The Third Cup.
Information Technology student with a problem-solving mindset and hands-on experience across AI/ML and software development. Eager to apply technical and analytical skills to solve real-world problems
I've spent 16 years finding things that don't work. These days, I also teach AI how to find them.
Somewhere along the way, I started writing stories about AI, work, and life.
Now I run The Third Cup.
Ha, you were never in danger at all. You finished at 36, and I've still got ten to go, so you win on timing, and I only win on volume. 😄
The two series did keep leaning on each other, though. I've quoted Mark's line about hashes in my own write-ups more than once, which is a strange thing to be able to say about a coffee shop.
I love the Coffee idea, I am honoured to be a member alongside great minds.
I've spent 16 years finding things that don't work. These days, I also teach AI how to find them.
Somewhere along the way, I started writing stories about AI, work, and life.
Now I run The Third Cup.
Hahaha, volume counts too! I guess we're both winners then. 🎉
But hearing that Mark's line about hashes has made its way into your own write-ups is something else. I never expected one of my fictional café regulars to start showing up in someone else's technical writing. That's a pretty nice surprise.
And hey, you're one of us now. No need to feel honoured. Just pull up a chair, bring your stories.😂
Really glad to have you at The Third Cup, Nnamdi. ☕
Two checks I would add, because both of these read back fine: for the ACL, prove it as the principal rather than reading the listing — sudo -u steve cat /path plus getfacl -p /path | grep -E '^(mask|group)' — since the mask gets recomputed every time setfacl touches a group entry, so a listing you took two commands ago can already be stale. For the Azure side, the id to assign is the service principal object id, not the app registration's: az ad sp show --id --query id -o tsv prints the one ARM will actually authorise, and the other one is accepted silently, which is exactly the failure you described.
@dafili Thank you for the comment. Proving it as the principal is the right instinct, though Steve needed to write as well as read on that file, so a cat test alone would still pass against a clipped mask.
One note on az ad sp show: that's the exact command the lab denied, which is what sent me to the token's oid claim in the first place. You're right about which ID it is, it just wasn't a route I had.
And the recalculation is slightly wider than group entries. setfacl recalculates unless a mask is given explicitly or you pass -n, and here it was the named user entry for Steve that widened it.
Before any cat or append test, let getfacl tell you:
getfacl -p /path | grep -B1 effectiveprints an#effective:r--comment next to every entry the mask clips, so a named user losing the write bit shows up as a string, not as a failed write you have to provoke. On the recalculation — re-read the mask line after eachsetfacl -m, because agroup::r--on the file plusu:steve:rwpushes mask torw-and that widens the whole group class at once;-nonly stops the recompute, the next -m without -n puts it back.@dafili Taking the first one you noted. I think that's better than what I suggested. getfacl prints the comment by default for any line where the entry's rights differ from the effective rights, so the clip shows up as a string with no write to provoke. The comment sits on the entry's own line, though, so the -B1 isn't doing anything.
A wider mask doesn't widen the group class, because the access check needs the permission in both the entry and the mask. group::r-- with mask::rw- is still r-- for the owning group. What widens is the display, since the group mode bits correspond to the mask once one exists, which is the trap the post was about.
And agreed on -n being temporary, though setting the mask explicitly in the same -m also stops the recompute.
Right, -B1 buys nothing: the effective line is printed under the entry it belongs to, so the line above a clipped entry is that entry's own line.
The -n belongs on the setfacl, not the getfacl — setfacl recomputes the mask from the union of the group class on every -m unless you pass -n, so
setfacl -n -m g:team:r-- fis the one that leaves a wider mask intact, and the plain-mform is what narrowed it in the first place.Worth one line in the post: once a mask exists the group mode bits are that mask, so
stat -c %adrifting from 755 to 750 is the cheap tell an ACL is in play at all.@dafili Same conclusion, different reason. The effective comment is on the entry's own line, aligned to column 40 on a terminal and tab-separated otherwise, which is why the plain grep works and -B1 has nothing to catch.
Agreed on -n belonging to setfacl. Though the recalculation is to the union of the group class, so it can widen as well as narrow. In the post, it widened, since group::r-- plus user:steve:rw- gives rw-.
On stat, I'd stay with the +. If the union lands on the group bits already there, %a doesn't move at all, and it can't tell you an ACL exists either way. Coreutils documents that character as the marker for an alternate access method, which indicates whether the number drifted or not.
Hi @ndcodes bro, I hope everything is going great with you.😀 Just a gentle reminder that you haven't joined Necoz yet.😀 We would really appreciate it if you could join us when you're free. Looking forward to seeing you there!❤️🥰
@star123 Thank you for the nudge, Star, and apologies for being slow off the mark. 😄
Yes, please, I'd love to join. Send the invitation whenever suits you, and I'll be right in.
Small, simple and useful, built together, sounds exactly like my sort of thing. Looking forward to seeing what everyone's working on. ❤️
@nyaomaru bro Now it's your turn! :D
It's my turn! 😹💚
Invitation sent, @ndcodes! 🐈✨
Really happy to have you joining us.
“Small. Simple. Useful. Built together.” is exactly the spirit. Looking forward to seeing what you build, share, or just casually jump into with us!
And thanks for the nudge, @star123! 😸⭐
The mask detail is the one I'll actually remember, ls -l showing rw- in the group field while the owning group only has r--, and the only hint is that little + at the end. Same story on the Azure side, ARM happily accepting the app ID for a policy that then authorises nobody, and Forbidden pointing everywhere except the wrong GUID. Your token oid trick is worth stealing for any lab where Graph is closed, though I'd love a note on what to do when even the token route is locked down. Which of the two caught you longer, the mask or the GUID?
The GUID, by a long way. The mask I only spotted afterwards, reading getfacl next to ls -l and seeing the two disagree, so it cost me nothing at the time. The GUID was most of the task, because a policy that reads back correctly gives you nothing to debug.
On the token route, it's harder to close than it looks. oid isn't a separate privilege, it rides in the token that authorises every other call, so if you can reach ARM you already have it. What usually breaks is the decode .
The claims reference says claims are only present if there's a value to fill them, and for users you need the profile scope to get oid. A service principal made that moot here, but I wouldn't assume it for a user-delegated token.
And outside a lab, the real answer is not to discover it at all. Whatever created the principal had the object ID in its create output, so it belongs in the pipeline as a parameter.
Re-running the encrypt/decrypt check after removing the temporary create permission is a particularly useful detail. It makes the verification describe the configuration actually left behind, which is easy to miss when the setup itself finally starts working.
That'sdefintely true, @fattakhov Mansur. That one cost me a rewrite because the first round trip passed while create was still in the policy and proved nothing about what I'd left behind.
The durable takeaway from troubleshooting policy issues is to record the effective configuration, not only the intended one. A small before-and-after check that prints the resolved policy and identity can prevent the same invisible mismatch on the next deployment.
@alexshev Alex. I totally agree with you that recording the effective, not only the intended, which is a valuable lesson, and printing the resolved identity alongside the policy would have caught this one in a line.
Thank you for noting this.
90 days is such a long time and it takes so much patience! I truly admire your dedication. Huge congratulations! 👏🏻🎉
Thank you so much, Divya, that's very kind of you. 🙏
Honestly, the labs vary. Some I finish in minutes, others take a whole hour, and sometimes I fail the task and have to give it another go. The writing is the hard but exciting part. It takes one to three hours, and those hours are where I find out I didn't properly understand what I'd just done. But then I'll get to unlearn and learn new things.
Ten to go. Thank you for being here for so many of them.
🍻hahaha
😀😀😀
Your café sitting directly above my ACL masks in the feed. Chinese philosophy over coffee, then a man complaining about GUIDs. The feed got the running order right. 😄 Five Elements is open in the next tab.
Nice feed sequence! Enjoy the Five Elements read 😆
Really well explained!!
Thank you, Sarvesh. I appreciate that. 🙏
At nine-tenths now! Hahaha. Good thing I finished the 36 Stratagems first, or this series might have caught up with me! 😄
Ha, you were never in danger at all. You finished at 36, and I've still got ten to go, so you win on timing, and I only win on volume. 😄
The two series did keep leaning on each other, though. I've quoted Mark's line about hashes in my own write-ups more than once, which is a strange thing to be able to say about a coffee shop.
I love the Coffee idea, I am honoured to be a member alongside great minds.
Thank you @xulingfeng
Hahaha, volume counts too! I guess we're both winners then. 🎉
But hearing that Mark's line about hashes has made its way into your own write-ups is something else. I never expected one of my fictional café regulars to start showing up in someone else's technical writing. That's a pretty nice surprise.
And hey, you're one of us now. No need to feel honoured. Just pull up a chair, bring your stories.😂
Really glad to have you at The Third Cup, Nnamdi. ☕
Same! 😮
🥰