> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endorlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# rule-set

> Use the rule-set command to import SAST rules into Endor Labs.

The `endorctl rule-set` command manages SAST rules in your Endor Labs namespace.

## Usage

```bash theme={null}
endorctl rule-set [subcommand] [flags]
```

## rule-set import

The `endorctl rule-set import` command imports SAST rules from a local `.tar` or `.gz` archive into your Endor Labs namespace. Endor Labs imports every `.yaml` and `.yml` file in the archive and tags each rule with the version you specify.

```bash theme={null}
endorctl rule-set import \
  --namespace <namespace> \
  --file-path <path-to-archive> \
  --rule-version <version>
```

### Options


&#x20; \- Flag: \`-n\`, \`--namespace\`
&#x20; Environment\_Variable: \`ENDOR\_NAMESPACE\`
&#x20; Type: string
&#x20; Description: Namespace to import the rules into. Required.

&#x20; \- Flag: \`--file-path\`
&#x20; Environment\_Variable: \`ENDOR\_RULE\_SET\_FILE\_PATH\`
&#x20; Type: string
&#x20; Description: Path to the \`.tar\` or \`.gz\` archive containing the rule YAML files. Required.

&#x20; \- Flag: \`--rule-version\`
&#x20; Environment\_Variable: \`ENDOR\_RULE\_SET\_VERSION\`
&#x20; Type: string
&#x20; Description: Semantic version to apply to all rules in the archive, for example \`v1.0.0\`. The import fails if any rule at this version already exists. Required.

&#x20; \- Flag: \`--dry-run\`
&#x20; Environment\_Variable: \`ENDOR\_RULE\_SET\_DRY\_RUN\`
&#x20; Type: boolean
&#x20; Description: Parse and validate the rule set without persisting any rules to the namespace.
&#x20;&#x20;

### How to use rule-set command

* Validate a rule archive before importing it.

  ```bash theme={null}
  endorctl rule-set import \
    --namespace my-org \
    --file-path ./my-rules.tar.gz \
    --rule-version v1.2.0 \
    --dry-run
  ```

* Import rules into a namespace.

  ```bash theme={null}
  endorctl rule-set import \
    --namespace my-org \
    --file-path ./my-rules.tar.gz \
    --rule-version v1.2.0
  ```

```
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.