intelligence_src_6dc544294b7f21f98a
- Source-provided label
- Publisher RSS metadata
- Evidence class
- mentioned in report
- Confidence
- Not reported
- Observed
- Dec 02, 2026 06:20 UTC
- Retrieved
- Dec 02, 2026 06:23 UTC
In an earlier post (Japanese) I set up a self-hosted GitLab with a Runner. This time I used it to stop risky Terraform settings before apply. The tool is Checkov. It statically analyzes Terraform, CloudFormation, Kubernetes YAML and more, and tells you things like "this S3 bucket isn't encrypted" or "SSH is open to the world". Two things I want to get across: Running it in CI and blocking the MR saves a lot of review back-and-forth You won't fix everything, so when you skip a check, keep the reason in the code All screenshots are real checkov runs on my Linux box. Account IDs and bucket names are dummies. Environment Item Version OS Ubuntu 24.04 Checkov 3.4.14 GitLab self-hosted + GitLab Runner pip install checkov Checkov reads the Terraform code directly — no terraform init, no AWS credentials. The flow Step 1: Write some deliberately risky Terraform The kind of code you write when "it just needs to work": # before/main.tf provider "aws" { region = "ap-northeast-1" } resource "aws_s3_bucket" "logs" { bucket = "example-app-logs-111122223333" } resource "aws_security_group" "web" { name = "web-sg" vpc_id = var.vpc_id ingress { description = "ssh" from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } egress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] } } resource "aws_instance" "web" { ami = var.ami_id instance_type = "t3.micro" subnet_id = var.subnet_id vpc_security_group_ids = [aws_security_group.web.id] } variable "vpc_id" {} variable "subnet_id" {} variable "ami_id" {} Step 2: Run Checkov checkov -d before --framework terraform --compact --quiet 15 failed checks, exit code 1 — in CI the pipeline stops here. The orange ones are the ones I'd call "must fix": ID Finding Fix CKV_AWS_24 SSH (22) open to 0.0.0.0/0 remove the ingress; use Session Manager CKV_AWS_79 IMDSv1 enabled http_tokens = "required" CKV_AWS_8 unencrypted EBS root_block_device.encrypted = true CKV2_AWS_6 no S3 public access block aws_s3_bucket_public_access_block CKV_AWS_145 S3 not encrypted with KMS SSE-KMS + key rotation I also fixed open egress, the missing IAM role, versioning and lifecycle rules. Step 3: Decide what to fix and what to skip Fixing every finding isn't realistic, so I used this rule: Skips go inside the resource as comments: resource "aws_s3_bucket" "logs" { #checkov:skip=CKV_AWS_144:Log bucket - cross-region replication not required #checkov:skip=CKV2_AWS_62:No consumer for event notifications #checkov:skip=CKV_AWS_18:This bucket IS the access-log destination bucket = "example-app-logs-111122223333" } Gotcha: the KMS key policy gets flagged While fixing things, the KMS key policy (data "aws_iam_policy_document") triggered: CKV_AWS_111 (write access without constraints) CKV_AWS_356 (Resource: "*") CKV_AWS_109 (permissions management without constraints) But inside a key policy, Resource: "*" means "this key", which is not what it means in an IAM policy. I skipped these with a reason: data "aws_iam_policy_document" "kms_logs" { # In a key policy, Resource "*" means "this key", so IAM-policy checks do not apply #checkov:skip=CKV_AWS_111:In a key policy "*" means this key only #checkov:skip=CKV_AWS_356:In a key policy "*" means this key only #checkov:skip=CKV_AWS_109:In a key policy "*" means this key only statement { ... } } Granting kms:* to the account root matches AWS's default key policy. It means "let IAM policies control access to this key", so the real restriction has to happen on the IAM side — written with least privilege, as in my previous post (Policy Sentry + Parliament). The fixed main.tf (full) provider "aws" { region = "ap-northeast-1" } # ------
6f83c27ce5ea68f78de3927637135b760c84d8b5d41bcaa8eeb4bdb414e3d1d9Network indicators are visibly defanged. This page does not make them clickable or send them to another service.
No validated file hashes or network indicators are stored for this record.
This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.
Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.
1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.
Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.