Lack of official hosted macro documentation
TL;DR - Writing policy modules is harder than it needs to be, because the documentation for the macros/interfaces in the reference policy is not easily discoverable. This could be helped by hosting the generated HTML documentation in a location that would be indexed/processed by search engines and AI chatbots.
Over the weekend, I wrote a policy module that allows a containerized service (running as container_t) to access shared content (public_content_t and/or public_content_rw_t).
Quoted 11 lines
policy_module(container-public-content, 0)require { type container_t; };bool
container_read_public_contentfalse;
ifcontainer_read_public_content{
miscfiles_read_public_files(container_t)
}
Quoted 4 lines
bool
container_manage_public_contentfalse; ifcontainer_manage_public_content{
miscfiles_manage_public_files(container_t)
}
In the end, it turned out to be extremely simple, but it took me most of a day to do this, because it took me that long to figure out the names of the macros that I should be using. I finally discovered the miscfiles_read_public_files and miscfiles_manage_public_files in the apache.te source file, but that was only after I wasted several hours asking search engines and AI chatbots what macro I should use for this purpose.
I was pretty sure that macros like these had to exist, but I was never able to discover them through Google searches, Google Gemini, or ChatGPT. (Google Gemini hallucinated a non-existent fs_read_access macro; ChatGPT did a bit better and referred me to files_read_public_content, which was real, but has been removed.)
From my POV, the problem is that documentation of the macros and interfaces in the reference policy is *reference* documentation, which is helpful if one needs the details of a known thing, but isn't helpful in actually identifying what thing one should use to accomplish a given task.
Fortunately, search engines and AIs have become pretty darn good at processing reference-style documentation and answering "what should I use to do this thing?" type questions (occasional hallucinations aside). But this only works if said reference documentation is available for the search engine/AI to index/process. AFAICT, the generated HTML docs are not available online anywhere (at least not anywhere that seems remotely official).
It feels like having this documentation hosted in a place where it is visible to these tools and given the appropriate weight (i.e. not just a copy of the docs on Joe Rando's web site) would go a long way toward making these macros more discoverable, which would make it much easier for policy authors to use them.
Thanks for reading my screed. :-)
Signature · 3 lines
======================================================================== Google Where SkyNet meets Idiocracy ========================================================================
Stephen Smalley
maintainerQuoted 55 lines · Ian Pilcher
TL;DR - Writing policy modules is harder than it needs to be, because the documentation for the macros/interfaces in the reference policy is not easily discoverable. This could be helped by hosting the generated HTML documentation in a location that would be indexed/processed by search engines and AI chatbots.
Over the weekend, I wrote a policy module that allows a containerized service (running as
container_t) to access shared content (public_content_tand/orpublic_content_rw_t).Quoted 11 lines
policy_module(container-public-content, 0)require { type container_t; };bool
container_read_public_contentfalse;
ifcontainer_read_public_content{
miscfiles_read_public_files(container_t)
}Quoted 4 lines
bool
container_manage_public_contentfalse;
ifcontainer_manage_public_content{
miscfiles_manage_public_files(container_t)
}In the end, it turned out to be extremely simple, but it took me most of a day to do this, because it took me that long to figure out the names of the macros that I should be using. I finally discovered the
miscfiles_read_public_filesandmiscfiles_manage_public_filesin the apache.te source file, but that was only after I wasted several hours asking search engines and AI chatbots what macro I should use for this purpose.I was pretty sure that macros like these had to exist, but I was never able to discover them through Google searches, Google Gemini, or ChatGPT. (Google Gemini hallucinated a non-existent
fs_read_accessmacro; ChatGPT did a bit better and referred me tofiles_read_public_content, which was real, but has been removed.)From my POV, the problem is that documentation of the macros and
interfaces in the reference policy is *reference* documentation, which is helpful if one needs the details of a known thing, but isn't helpful in actually identifying what thing one should use to accomplish a given task.Fortunately, search engines and AIs have become pretty darn good at processing reference-style documentation and answering "what should I use to do this thing?" type questions (occasional hallucinations aside). But this only works if said reference documentation is available for the search engine/AI to index/process. AFAICT, the generated HTML docs are not available online anywhere (at least not anywhere that seems remotely official).
Quoted 7 lines
It feels like having this documentation hosted in a place where it is visible to these tools and given the appropriate weight (i.e. not just a copy of the docs on Joe Rando's web site) would go a long way toward making these macros more discoverable, which would make it much easier for policy authors to use them.
Thanks for reading my screed. :-)
Great idea. I thought we actually used to have something like this but am not finding it now.
Chris, any clues?
Quoted 62 lines · Stephen Smalley
Quoted 61 lines · Ian Pilcher
TL;DR - Writing policy modules is harder than it needs to be, because the documentation for the macros/interfaces in the reference policy is not easily discoverable. This could be helped by hosting the generated HTML documentation in a location that would be indexed/processed by search engines and AI chatbots.
Over the weekend, I wrote a policy module that allows a containerized service (running as
container_t) to access shared content (public_content_tand/orpublic_content_rw_t).Quoted 11 lines
policy_module(container-public-content, 0)require { type container_t; };bool
container_read_public_contentfalse;
ifcontainer_read_public_content{
miscfiles_read_public_files(container_t)
}Quoted 4 lines
bool
container_manage_public_contentfalse;
ifcontainer_manage_public_content{
miscfiles_manage_public_files(container_t)
}In the end, it turned out to be extremely simple, but it took me most of a day to do this, because it took me that long to figure out the names of the macros that I should be using. I finally discovered the
miscfiles_read_public_filesandmiscfiles_manage_public_filesin the apache.te source file, but that was only after I wasted several hours asking search engines and AI chatbots what macro I should use for this purpose.I was pretty sure that macros like these had to exist, but I was never able to discover them through Google searches, Google Gemini, or ChatGPT. (Google Gemini hallucinated a non-existent
fs_read_accessmacro; ChatGPT did a bit better and referred me tofiles_read_public_content, which was real, but has been removed.)From my POV, the problem is that documentation of the macros and
interfaces in the reference policy is *reference* documentation, which is helpful if one needs the details of a known thing, but isn't helpful in actually identifying what thing one should use to accomplish a given task.Fortunately, search engines and AIs have become pretty darn good at processing reference-style documentation and answering "what should I use to do this thing?" type questions (occasional hallucinations aside). But this only works if said reference documentation is available for the search engine/AI to index/process. AFAICT, the generated HTML docs are not available online anywhere (at least not anywhere that seems remotely official).
It feels like having this documentation hosted in a place where it is visible to these tools and given the appropriate weight (i.e. not just a copy of the docs on Joe Rando's web site) would go a long way toward making these macros more discoverable, which would make it much easier for policy authors to use them.
Quoted 5 lines
Quoted 1 line
Thanks for reading my screed. :-)
Great idea. I thought we actually used to have something like this but am not finding it now.
Chris, any clues?
We did have some generated pages, but when the project moved to GitHub, there wasn't a place to put them. There hadn't been any requests for it to return, so I never looked into it.
make html in the repo checkout will generate them in the doc/html/ directory (from the repo root).
Signature · 1 line
Chris PeBenito
Stephen Smalley
maintainerQuoted 70 lines · Chris PeBenito
Quoted 62 lines · Stephen Smalley
Quoted 61 lines · Ian Pilcher
TL;DR - Writing policy modules is harder than it needs to be, because the documentation for the macros/interfaces in the reference policy is not easily discoverable. This could be helped by hosting the generated HTML documentation in a location that would be indexed/processed by search engines and AI chatbots.
Over the weekend, I wrote a policy module that allows a containerized service (running as
container_t) to access shared content (public_content_tand/orpublic_content_rw_t).Quoted 11 lines
policy_module(container-public-content, 0)require { type container_t; };bool
container_read_public_contentfalse;
ifcontainer_read_public_content{
miscfiles_read_public_files(container_t)
}Quoted 4 lines
bool
container_manage_public_contentfalse;
ifcontainer_manage_public_content{
miscfiles_manage_public_files(container_t)
}In the end, it turned out to be extremely simple, but it took me most of a day to do this, because it took me that long to figure out the names of the macros that I should be using. I finally discovered the
miscfiles_read_public_filesandmiscfiles_manage_public_filesin the apache.te source file, but that was only after I wasted several hours asking search engines and AI chatbots what macro I should use for this purpose.I was pretty sure that macros like these had to exist, but I was never able to discover them through Google searches, Google Gemini, or ChatGPT. (Google Gemini hallucinated a non-existent
fs_read_accessmacro; ChatGPT did a bit better and referred me tofiles_read_public_content, which was real, but has been removed.)From my POV, the problem is that documentation of the macros and
interfaces in the reference policy is *reference* documentation, which is helpful if one needs the details of a known thing, but isn't helpful in actually identifying what thing one should use to accomplish a given task.Fortunately, search engines and AIs have become pretty darn good at processing reference-style documentation and answering "what should I use to do this thing?" type questions (occasional hallucinations aside). But this only works if said reference documentation is available for the search engine/AI to index/process. AFAICT, the generated HTML docs are not available online anywhere (at least not anywhere that seems remotely official).
It feels like having this documentation hosted in a place where it is visible to these tools and given the appropriate weight (i.e. not just a copy of the docs on Joe Rando's web site) would go a long way toward making these macros more discoverable, which would make it much easier for policy authors to use them.
Quoted 5 lines
Quoted 1 line
Thanks for reading my screed. :-)
Great idea. I thought we actually used to have something like this but am not finding it now.
Chris, any clues?
Quoted 6 lines
We did have some generated pages, but when the project moved to GitHub, there wasn't a place to put them. There hadn't been any requests for it to return, so I never looked into it.
make htmlin the repo checkout will generate them in the doc/html/ directory (from the repo root).
Maybe we could put these in GitHub pages for SELinuxProject?
Quoted 14 lines · Stephen Smalley
Quoted 13 lines · Chris PeBenito
Quoted 11 lines · Stephen Smalley
Quoted 6 lines · Ian Pilcher
TL;DR - Writing policy modules is harder than it needs to be, because the documentation for the macros/interfaces in the reference policy is not easily discoverable. This could be helped by hosting the generated HTML documentation in a location that would be indexed/processed by search engines and AI chatbots.
Great idea. I thought we actually used to have something like this but am not finding it now.
Chris, any clues?
Quoted 8 lines
Quoted 6 lines
We did have some generated pages, but when the project moved to GitHub, there wasn't a place to put them. There hadn't been any requests for it to return, so I never looked into it.
make htmlin the repo checkout will generate them in the doc/html/ directory (from the repo root).Maybe we could put these in GitHub pages for SELinuxProject?
I have no objection.
Signature · 1 line
Chris PeBenito
Stephen Smalley
maintainerQuoted 20 lines · Chris PeBenito
Quoted 18 lines · Stephen Smalley
Quoted 17 lines · Chris PeBenito
Quoted 11 lines · Stephen Smalley
Quoted 6 lines · Ian Pilcher
TL;DR - Writing policy modules is harder than it needs to be, because the documentation for the macros/interfaces in the reference policy is not easily discoverable. This could be helped by hosting the generated HTML documentation in a location that would be indexed/processed by search engines and AI chatbots.
Great idea. I thought we actually used to have something like this but am not finding it now.
Chris, any clues?We did have some generated pages, but when the project moved to GitHub, there wasn't a place to put them. There hadn't been any requests for it to return, so I never looked into it.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
make htmlin the repo checkout will generate them in the doc/html/ directory (from the repo root).Maybe we could put these in GitHub pages for SELinuxProject?
I have no objection.
If someone else were to create a GitHub pages repo for SELinuxProject, I can help maintain it.
Paul Moore
maintainerQuoted 24 lines · Stephen Smalley
Quoted 23 lines · Chris PeBenito
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Chris PeBenito
Quoted 11 lines · Stephen Smalley
Quoted 6 lines · Ian Pilcher
TL;DR - Writing policy modules is harder than it needs to be, because the documentation for the macros/interfaces in the reference policy is not easily discoverable. This could be helped by hosting the generated HTML documentation in a location that would be indexed/processed by search engines and AI chatbots.
Great idea. I thought we actually used to have something like this but am not finding it now.
Chris, any clues?We did have some generated pages, but when the project moved to GitHub, there wasn't a place to put them. There hadn't been any requests for it to return, so I never looked into it.
make htmlin the repo checkout will generate them in the doc/html/ directory (from the repo root).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Maybe we could put these in GitHub pages for SELinuxProject?
I have no objection.
If someone else were to create a GitHub pages repo for SELinuxProject, I can help maintain it.
That's on my todo list, at least for a demo site to see how we like it.
Signature · 1 line
paul-moore.com