selinux-knowledge-patch
SELinux changes since training cutoff (latest: 0.1.0) — CIL policy language, udica container policies, allowxperm netlink filtering, default object rules. Load before working with SELinux.
What this skill does
# SELinux Knowledge Patch
Covers SELinux policy development features added after Claude's training cutoff.
**Baseline knowledge**: SELinux modes (enforcing/permissive/disabled), security contexts (user:role:type:level), booleans (`setsebool`/`getsebool`), basic policy management (`semanage`, `semodule`, `restorecon`), and `audit2allow`.
## Quick Reference: CIL vs Kernel Policy Language
CIL (Common Intermediate Language) replaces M4-based `.te`/`.if`/`.fc` policy modules with S-expression syntax:
| Kernel Policy | CIL Equivalent | Notes |
|---|---|---|
| `attribute` | `typeattribute` | Declares a type attribute |
| `typeattribute` | `typeattributeset` | Assigns types to an attribute |
| `attribute_role` | `roleattribute` | Declares a role attribute |
| `allow` | `allow` | Same syntax, S-expression form |
| `module` / `require` | `block` / `blockinherit` | Namespacing replaces module system |
CIL eliminates M4 macro dependency and module load-ordering requirements.
## CIL Policy Basics
CIL uses `(block ...)` for namespacing — all declarations inside a block are scoped:
```cil
(block myapp
(type process)
(type data)
(role app_r)
(roletype app_r process)
(allow process data (file (read write open getattr)))
)
```
Types are referenced across blocks as `blockname.typename` (e.g., `myapp.process`).
### Block Inheritance
Blocks can inherit from other blocks, replacing the M4 template/interface pattern:
```cil
(block base_app
(type process)
(type data)
)
(block webapp
(blockinherit base_app)
;; webapp.process and webapp.data now exist
(allow process data (file (read write)))
)
```
### Access Rule Syntax
CIL access rules group permissions by object class in S-expressions:
```cil
;; Single class, multiple permissions
(allow src_t tgt_t (file (read write open getattr)))
;; Multiple classes in one rule
(allow src_t tgt_t (file (read write)) (dir (search getattr)))
```
### Loading CIL Modules
Compile and load CIL policies directly with `semodule` — no `.pp` compilation step:
```bash
semodule -i myapp.cil
semodule -r myapp # remove
```
See [references/cil-policy.md](references/cil-policy.md) for full CIL syntax details and examples.
## udica: Container Policy Generator
Generate tailored SELinux policies for containers from their runtime inspection data:
```bash
# Inspect running container → generate CIL policy
podman inspect <container_id> | udica my_policy
# Install policy with required template modules
semodule -i my_policy.cil \
/usr/share/udica/templates/{base_container.cil,net_container.cil,home_container.cil}
# Run container with the custom policy
podman run --security-opt label=type:my_policy.process ...
```
udica parses container JSON for capabilities, mount points, and ports, then combines appropriate CIL template blocks. Works with Podman and Docker.
See [references/container-policy.md](references/container-policy.md) for template selection and advanced usage.
## Kernel Policy Extensions
### allowxperm Netlink Message Filtering (kernel >= 6.13)
Extended permissions now support netlink message type filtering. Requires enabling the `netlink_xperm` policycap:
```cil
(policycap netlink_xperm)
```
Grant base `nlmsg` permission, then filter by message type hex value:
```
allow src_t tgt_t : netlink_route_socket nlmsg;
allowxperm src_t tgt_t : netlink_route_socket nlmsg { 0x12 };
```
Supported socket classes:
| Socket Class | Use Case |
|---|---|
| `netlink_route_socket` | Route, link, address management |
| `netlink_tcpdiag_socket` | TCP diagnostic queries |
| `netlink_xfrm_socket` | IPsec/XFRM policy and state |
| `netlink_audit_socket` | Audit subsystem control |
### Default Object Rules (policy version 27+)
Control which context field (source or target) provides user/role/type/range for newly created objects:
```
default_user file target;
default_role file source;
default_type file source;
default_range file target low;
```
The `low`, `high`, or `low_high` qualifier on `default_range` controls which part of the MLS range is used. Applies to `file`, `dir`, `lnk_file`, `chr_file`, `blk_file`, `sock_file`, `fifo_file` and other object classes that undergo labeling transitions.
See [references/kernel-policy-extensions.md](references/kernel-policy-extensions.md) for detailed semantics and range qualifier reference.
## Reference Files
| File | Contents |
|---|---|
| [cil-policy.md](references/cil-policy.md) | CIL syntax, blocks, inheritance, type/role declarations, access rules |
| [container-policy.md](references/container-policy.md) | udica container policy generation, templates, Podman/Docker workflow |
| [kernel-policy-extensions.md](references/kernel-policy-extensions.md) | allowxperm nlmsg rules, default object rules, policycap requirements |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.