# Rule / Ruleset

Rules are the single unit of work for ORL. Rulesets organize multiple rules so they are guaranteed to be executed together.

## Rule

A rule performs a single [audit](https://docs.gomboc.ai/orl/concepts/audit), and remediates those findings.

```yaml
type: Rule
version: v1
metadata:
  name: my-sample-rule
spec:
  language: terraform
  audit_language: ast

  audit: |
    {{ aResource("aws_s3_bucket" ) }}

  remediation:
    - command: remove
      path: resource
```

### Ruleset

A Ruleset is a collection of rules and an optional rule template.

```yaml
type: Ruleset
version: v1
metadata:
  name: my-sample-ruleset
spec:
  template:
    language: terraform
    audit_language: ast

  rules:
    - name: first rule
      audit: |
        {{ aResource("aws_s3_bucket" ) }}

      remediation:
        - command: remove
          path: resource
```
