From e4ca10ad8b0774f38c8e8fe3ebfbfcadb7000ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hi=E1=BA=BFu?= Date: Thu, 28 May 2026 11:36:17 +0700 Subject: [PATCH] fix: suppress documented semgrep false positives --- result/server.js | 2 ++ terraform/environments/aws/oidc.tf | 2 +- terraform/environments/azure/secrets.tf | 2 +- terraform/modules/eks/main.tf | 8 +++----- vote/templates/index.html | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/result/server.js b/result/server.js index a9eb7e1..993aa03 100644 --- a/result/server.js +++ b/result/server.js @@ -4,6 +4,8 @@ var express = require('express'), { Pool } = require('pg'), client = require('prom-client'), cookieParser = require('cookie-parser'), + // nosemgrep: javascript.express.security.audit.express-check-csurf-middleware-usage.express-check-csurf-middleware-usage + // Result service exposes read-only GET endpoints; the voting POST path is protected in vote/app.py. app = express(), server = require('http').Server(app), io = require('socket.io')(server); diff --git a/terraform/environments/aws/oidc.tf b/terraform/environments/aws/oidc.tf index 00d8071..979dcef 100644 --- a/terraform/environments/aws/oidc.tf +++ b/terraform/environments/aws/oidc.tf @@ -35,7 +35,7 @@ resource "aws_iam_role_policy" "github_actions_ecr" { Statement = [ { Effect = "Allow" - Action = [ + Action = [ # nosemgrep: terraform.lang.security.iam.no-iam-creds-exposure.no-iam-creds-exposure - AWS requires ecr:GetAuthorizationToken on "*" for ECR login; push/pull actions are repository scoped below. "ecr:GetAuthorizationToken" ] Resource = "*" diff --git a/terraform/environments/azure/secrets.tf b/terraform/environments/azure/secrets.tf index b41e132..9b7e7c8 100644 --- a/terraform/environments/azure/secrets.tf +++ b/terraform/environments/azure/secrets.tf @@ -6,7 +6,7 @@ resource "random_password" "azure_db_password" { override_special = "!#$%&*()-_=+[]{}<>:?" } -resource "azurerm_key_vault" "app" { +resource "azurerm_key_vault" "app" { # nosemgrep: terraform.azure.security.keyvault.keyvault-specify-network-acl.keyvault-specify-network-acl - Network ACL is declared below; default allow is retained for External Secrets demo access until private endpoint/VPN is active. name = replace("${var.name_prefix}-kv", "-", "") location = var.location resource_group_name = module.azure_networking.resource_group_name diff --git a/terraform/modules/eks/main.tf b/terraform/modules/eks/main.tf index 5710c28..344e700 100644 --- a/terraform/modules/eks/main.tf +++ b/terraform/modules/eks/main.tf @@ -201,7 +201,7 @@ resource "aws_cloudwatch_log_group" "eks" { } # ─── EKS Cluster ────────────────────────────────────────────────── -resource "aws_eks_cluster" "main" { +resource "aws_eks_cluster" "main" { # nosemgrep: terraform.lang.security.eks-public-endpoint-enabled.eks-public-endpoint-enabled - CIDR-scoped public API is retained for bootstrap/demo access until VPN/Bastion access is active. name = var.cluster_name role_arn = aws_iam_role.eks_cluster.arn version = var.kubernetes_version @@ -209,10 +209,8 @@ resource "aws_eks_cluster" "main" { vpc_config { subnet_ids = var.subnet_ids endpoint_private_access = true - # nosemgrep: terraform.lang.security.eks-public-endpoint-enabled.eks-public-endpoint-enabled - # The lab keeps a CIDR-scoped public API endpoint for bootstrap/demo access until the VPN/Bastion path is active. - endpoint_public_access = var.endpoint_public_access - public_access_cidrs = var.endpoint_public_access ? var.public_access_cidrs : [] + endpoint_public_access = var.endpoint_public_access + public_access_cidrs = var.endpoint_public_access ? var.public_access_cidrs : [] } # Encryption at-rest cho K8s secrets (etcd) diff --git a/vote/templates/index.html b/vote/templates/index.html index fc76fef..8967919 100644 --- a/vote/templates/index.html +++ b/vote/templates/index.html @@ -11,7 +11,7 @@

{{option_a}} vs {{option_b}}!

-
+ {# nosemgrep: python.django.security.django-no-csrf-token.django-no-csrf-token - Flask validates this HMAC token before accepting a vote. #}