schema-version:v1.4iac:# Do not run these rules.ignore-rules:- A- B# Run only these rules. If this field is set, all other rules are ignored.use-rules:- Aglobal-config:# Only analyze the following paths/files.only-paths:- "path/example"- "**/*.file"# Do not analyze the following paths/files.ignore-paths:- "path/example/directory"- "**/config.file"# Do not report findings with these severities.ignore-severities:- low- info# Report only findings with these severities.only-severities:- high- critical# Do not report findings with these rule types.ignore-categories:- "Best Practices"# Report only findings with these rule types.only-categories:- "Encryption"# Do not run rules from these platforms.ignore-platforms:- Dockerfile# Only run rules from these platforms.only-platforms:- Terraform- Kubernetes- CICD# Per-rule configurations.rule-configs:terraform-aws-s3-bucket-without-encryption:ignore-paths:- "test/"severity:lowkubernetes-deployment-without-resource-limits:only-paths:- "k8s/production/"cicd-github-unpinned-actions-full-length-commit-sha:arguments:allow:- libbpf/ci/run-qemu
iac キーは、次のフィールドをサポートしています。
プロパティ
タイプ
説明
ignore-rules
配列
無視するルール ID のリスト。
use-rules
配列
実行するルール ID のリスト。指定した場合、_これらのルールのみ_が実行されます。ignore-rules は use-rules よりも優先され、両方の配列のルールが無視されます。
global-config
オブジェクト
IaC スキャナーのグローバル設定。
rule-configs
オブジェクト
ルールごとの設定。キーはルール ID です。
ルールの構成
実行するルールを変更するには、次のようにします。
特定のルールのみを実行する: use-rules でルールを指定します。
特定のルールを無効にする: ignore-rules でルールを指定します。
schema-version:v1.4iac:ignore-rules:- A- B
schema-version:v1.4iac:use-rules:- A
A や B などのプレースホルダーを Code Security ルール ID に置き換えます。下位互換性のために、レガシールール ID もサポートされています。
schema-version:v1.4iac:rule-configs:terraform-aws-s3-bucket-without-encryption:# Do not apply this rule in test directories.ignore-paths:- "test/"- "**/testdata/"kubernetes-deployment-without-resource-limits:# Apply this rule only in production manifests.only-paths:- "k8s/production/"