LogoLogo
HomeBlogGet a Demo
  • Introduction
  • Install Lunar
  • Learn the basics
  • 📖Docs
    • Key concepts
    • Component JSON
    • Catalog JSON
    • Lunar CLI Reference
  • 📝Configuration
    • lunar-config.yml
      • catalogers
      • catalogers/hooks
      • domains
      • components
      • collectors
      • collectors/hooks
      • policies
    • lunar.yml
  • 🛠️Plugin SDKs
    • Plugins configuration
      • lunar-cataloger.yml
      • lunar-collector.yml
      • lunar-policy.yml
    • Bash SDK
      • Cataloger
      • Collector
    • Python SDK
      • Collector
      • Policy
        • Check
        • Path
        • ComponentData
        • NoDataError
        • Utility Functions
  • ⚙️SQL API
    • Overview
    • Views
      • domains
      • components
      • component_deltas
      • initiatives
      • policies
      • checks
      • prs
      • catalog
Powered by GitBook

©️ Earthly Technologies

On this page
  • Schema
  • Notes
  • Usage examples
  1. SQL API
  2. Views

policies

policies

The policies view provides information about all policies defined in Lunar. Policies define specific checks or rules that are applied to components.

Schema

Column
Type
Description

name

TEXT

The identifier for the policy

description

TEXT

A description of the policy

enforcement

TEXT

The enforcement level of the policy. Can be one of draft, score, block-pr, block-release, block-pr-and-release

initiative_name

TEXT

The identifier of the initiative this policy belongs to

config_version

TEXT

The version of the configuration where this policy is defined

Notes

  • Policies define specific checks that are applied to components

  • Policies can have different enforcement levels that determine how violations are handled

  • Policies are organized into initiatives

Usage examples

List all policies with their enforcement levels:

SELECT name, description, enforcement
FROM policies
ORDER BY enforcement;

Find all blocking policies within a specific initiative:

SELECT *
FROM policies
WHERE initiative_name = 'security-compliance'
  AND enforcement IN ('block-pr', 'block-release', 'block-pr-and-release');

Get a count of policies by enforcement level:

SELECT 
  enforcement,
  COUNT(*) as policy_count
FROM policies
GROUP BY enforcement
ORDER BY policy_count DESC;
PreviousinitiativesNextchecks

Last updated 17 hours ago

⚙️