---
title: Scan Artifact
slug: homologacao-atmosphere/scan-artifact
description: Learn how to perform YARA rule scanning on artifacts with this comprehensive document. Discover how to use the script, including compiling YARA rules from external sources and scanning artifacts using rules in string format. Get detailed examples and unde
createdAt: 2022-08-01T17:42:24.000Z
---

## Resumo

- Executa o scan de regras YARA em um artefato.

## Parâmetros

| **Parâmetro** | **Requerido** | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**           |
| ------------- | ------------- | -------- | ---------------------------- | ------------------------- |
| artifact      | Sim           | string   |                              | Artefato a ser escaneado. |

Utiliza parâmetros do módulo [](https://docs.simonops.com/homologacao-atmosphere/shell)[YARA](/yara).

## Exemplos

```yaml
# Compilar uma regra YARA de fontes externas
- name: Pegar regra de um repositório
  uri:
    url: https://raw.githubusercontent.com/godaddy/yara-rules/master/example.yara
    method: GET
    return_content: yes
  register: yara_rules
- name: Executar scan
  yara_scan_artifact:
    artifact: "abcdefgjiklmnoprhellostuvwx0123456789ABCDEFyz"
    rules:
      GithubRuleset: "{{ yara_rules.content }}"
  register: result

- name: Escanear artefato a partir de uma regra em string
  yara_scan_artifact:
    artifact: "abcdefgjiklmnoprhellostuvwx0123456789ABCDEFyz"
    rules:
        hexExample: |
          /* This will match any file containing "hello" anywhere. */
          rule AsciiExample {
            strings:$ascii_string = "hello"
            condition:$ascii_string
          }
    register: result
```

## Valores retornados

| **Chave**        | **Tipo** | **Retornado quando** | **Descrição**     |
| ---------------- | -------- | -------------------- | ----------------- |
| scan\_detection  | string   | Sempre               | Saída da execução |

