security-selinux-expert

Diagnose SELinux denials and craft compliant allow rules for Android 15 sepolicy.

40|7|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/jonaschen/Android-Software --skill security-selinux-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-selinux-expert
Source: https://github.com/jonaschen/Android-Software/tree/main/skills/L2-security-selinux-expert
Command: npx skills add https://github.com/jonaschen/Android-Software --skill security-selinux-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires audit2allow, bash, grep, and includes scripts (resource) and references (resource) components.

What problem does it solve?

SELinux denial logs, neverallow violations, and mislabeled paths can halt Android builds and block new services, and this skill keeps you inside the verified sepolicy trees and guardrails so you can resolve each denial without regressing Android 15 security posture.

Core Features & Use Cases

  • Precision Path Scope: The L1 router and frontmatter-defined scope keep edits within system/sepolicy public/private, vendor, device, and property/service contexts so you never stray into unintended directories.
  • Resolution Workflow: Capture avc: denied logs, draft minimal allow rules with the audit2allow_safe guidance, check for existing types, validate against neverallow rules, label new files, and rerun sepolicy or CTS tests before declaring success.
  • Guardrails & Use Case: Mandatory forbidden actions, handoff rules for new daemons or HAL services, and the references/selinux_policy_guide.md ensure that onboarding vendor daemons or resolving binder/property denials stays Treble-compliant and coordinated with other subsystem experts.

Quick Start

Request the security-selinux-expert to analyze your latest avc: denied log, propose minimal allow rules with proper file_context labels, and confirm neverallow compliance before rerunning the SELinux tests.

Frequently Asked Questions about security-selinux-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix SELinux avc denied errors in Android 15?

Resolve SELinux avc denied errors in Android 15 by capturing denial logs, drafting minimal allow rules based on audit2allow_safe guidance, validating against neverallow rules, and applying correct file_context labels before rerunning sepolicy tests.

What is the best way to add allow rules for new vendor daemons without violating neverallow policies?

Add allow rules for vendor daemons without violating neverallow policies by scoping edits to vendor or device sepolicy directories, using audit2allow_safe for checks, and validating compliance against existing neverallow constraints before building.

Can I use audit2allow to generate SELinux policy for property contexts and binder paths?

Use audit2allow to generate initial SELinux policy for property contexts and binder paths, but validate the generated rules against neverallow constraints and manually ensure proper file_context labeling.

Why does my Android build fail with SELinux neverallow violations when onboarding new HAL services?

Android builds fail with SELinux neverallow violations when onboarding new HAL services if allow rules are placed in incorrect system or vendor sepolicy directories, bypassing required Treble-compliant guardrails and coordination.

How do I label new files in Android sepolicy to resolve property access failures?

Label new files in Android sepolicy to resolve property access failures by defining file_context labels within the appropriate system or vendor sepolicy scope, ensuring new service types align with existing property and service contexts.

Do I need to rerun CTS tests after modifying Android 15 sepolicy rules?

Rerun CTS tests after modifying Android 15 sepolicy rules to verify that newly added allow rules and file_context labels do not regress the overall security posture or trigger new denials.