Compare commits

..
10 Commits
Author SHA1 Message Date
Prowler BotandCésar Arroba dd9232849f fix(deps): bump anyio to 4.14.2 and accept unfixable CPython CVE-2026-82049 (#12850)
Co-authored-by: César Arroba <19954079+cesararroba@users.noreply.github.com>
2026-09-21 12:57:07 +02:00
Prowler BotandHaitao Zheng bcdcfe095c fix(sdk): report all-users 2sv override failures (#12835)
Co-authored-by: Haitao Zheng <h@tzheng.dev>
2026-09-17 13:27:44 +02:00
Prowler BotandPedro Martín eabf10b109 fix(invitations): expire lapsed invitations on re-invite (#12833)
Co-authored-by: Pedro Martín <pedromarting3@gmail.com>
2026-09-17 12:29:09 +02:00
8ae8ffab4a fix(aws): try the rest of the partition when the bootstrap region is unreachable (#12822)
Co-authored-by: César Arroba <19954079+cesararroba@users.noreply.github.com>
Co-authored-by: pedrooot <pedromarting3@gmail.com>
2026-09-16 10:53:39 +02:00
Prowler BotandCésar Arroba 3e825c6958 chore(trivy): suppress fast-uri CVE-2026-75931 from Teams SPDX manifest (#12825)
Co-authored-by: César Arroba <19954079+cesararroba@users.noreply.github.com>
2026-09-16 10:43:21 +02:00
Prowler BotandPedro Martín 34d5a70405 fix(container): bump PowerShell to 7.5.11 in SDK and API (#12824)
Co-authored-by: Pedro Martín <pedromarting3@gmail.com>
2026-09-16 10:25:01 +02:00
Prowler BotandAlejandro Bailo a944a8317b fix(ui): defer billing onboarding and add AWS button styling (#12807)
Co-authored-by: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com>
2026-09-14 13:24:54 +02:00
Prowler BotandPedro Martín d4b64fc29e fix(container): patch high Debian CVEs in SDK and API (#12805)
Co-authored-by: Pedro Martín <pedromarting3@gmail.com>
2026-09-14 11:25:00 +02:00
Prowler Botandprowler-bot 61bc38585e chore(release): Bump versions to v5.42.1 (#12798)
Co-authored-by: prowler-bot <179230569+prowler-bot@users.noreply.github.com>
2026-09-11 13:22:51 +02:00
Prowler Botandprowler-bot 73ae2eb194 chore(api): Update prowler dependency to v5.42 for release 5.42.0 (#12796)
Co-authored-by: prowler-bot <179230569+prowler-bot@users.noreply.github.com>
2026-09-11 10:47:22 +02:00
318 changed files with 1745 additions and 28309 deletions
+1 -8
View File
@@ -115,13 +115,6 @@ DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION=""
# The name of the S3 bucket where scan output should be stored
DJANGO_OUTPUT_S3_AWS_OUTPUT_BUCKET=""
# The storage address the browser can reach, used only to sign report download URLs
# (e.g. "https://storage.example.com"). Leave empty on AWS S3. Set it when storage is
# only reachable inside the container network, such as MinIO on "http://minio:9000".
# The reverse proxy in front of it must forward the Host header unchanged: SigV4 signs
# Host, so rewriting it to the internal name invalidates the signature.
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL=""
# Django settings
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1,prowler-api
DJANGO_BIND_ADDRESS=0.0.0.0
@@ -165,7 +158,7 @@ SENTRY_RELEASE=local
# REO_DEV_CLIENT_ID=
#### Prowler release version ####
NEXT_PUBLIC_PROWLER_RELEASE_VERSION=v5.43.1
NEXT_PUBLIC_PROWLER_RELEASE_VERSION=v5.42.1
# Social login credentials
SOCIAL_GOOGLE_OAUTH_CALLBACK_URL="${AUTH_URL}/api/auth/callback/google"
-11
View File
@@ -451,17 +451,6 @@ modules:
e2e:
- ui/tests/home/**
- name: ui-registry
match:
- ui/actions/registry/**
- ui/app/**/registry/**
- ui/components/registry/**
- ui/lib/registry/**
- ui/tests/registry/**
tests: []
e2e:
- ui/tests/registry/**
- name: ui-shadcn
match:
- ui/components/shadcn/**
+43 -42
View File
@@ -10,12 +10,12 @@ on:
- master
- "v5.*"
paths:
- ".github/workflows/ui-e2e-tests-v2.yml"
- ".github/test-impact.yml"
- "ui/**"
- "api/**" # API changes can affect UI E2E
- "!ui/CHANGELOG.md"
- "!api/CHANGELOG.md"
- '.github/workflows/ui-e2e-tests-v2.yml'
- '.github/test-impact.yml'
- 'ui/**'
- 'api/**' # API changes can affect UI E2E
- '!ui/CHANGELOG.md'
- '!api/CHANGELOG.md'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -40,11 +40,11 @@ jobs:
(needs.impact-analysis.outputs.has-ui-e2e == 'true' || needs.impact-analysis.outputs.run-all == 'true')
runs-on: ubuntu-latest
env:
AUTH_SECRET: "fallback-ci-secret-for-testing"
AUTH_SECRET: 'fallback-ci-secret-for-testing'
AUTH_TRUST_HOST: true
NEXTAUTH_URL: "http://localhost:3000"
AUTH_URL: "http://localhost:3000"
UI_API_BASE_URL: "http://localhost:8080/api/v1"
NEXTAUTH_URL: 'http://localhost:3000'
AUTH_URL: 'http://localhost:3000'
UI_API_BASE_URL: 'http://localhost:8080/api/v1'
E2E_ADMIN_USER: ${{ secrets.E2E_ADMIN_USER }}
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }}
E2E_AWS_PROVIDER_ACCOUNT_ID: ${{ secrets.E2E_AWS_PROVIDER_ACCOUNT_ID }}
@@ -60,7 +60,7 @@ jobs:
E2E_M365_SECRET_ID: ${{ secrets.E2E_M365_SECRET_ID }}
E2E_M365_TENANT_ID: ${{ secrets.E2E_M365_TENANT_ID }}
E2E_M365_CERTIFICATE_CONTENT: ${{ secrets.E2E_M365_CERTIFICATE_CONTENT }}
E2E_KUBERNETES_CONTEXT: "kind-kind"
E2E_KUBERNETES_CONTEXT: 'kind-kind'
E2E_KUBERNETES_KUBECONFIG_PATH: /home/runner/.kube/config
E2E_GCP_BASE64_SERVICE_ACCOUNT_KEY: ${{ secrets.E2E_GCP_BASE64_SERVICE_ACCOUNT_KEY }}
E2E_GCP_PROJECT_ID: ${{ secrets.E2E_GCP_PROJECT_ID }}
@@ -292,7 +292,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: "ui/.nvmrc"
node-version-file: 'ui/.nvmrc'
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
@@ -337,59 +337,60 @@ jobs:
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm run test:e2e:install
- name: Run standard E2E tests
id: standard-e2e
- name: Run E2E tests
working-directory: ./ui
run: |
if [[ "${RUN_ALL_TESTS}" == "true" ]]; then
echo "Running all standard E2E tests..."
echo "Running ALL E2E tests..."
pnpm run test:e2e
else
echo "Running targeted standard E2E tests: ${E2E_TEST_PATHS}"
echo "Running targeted E2E tests: ${E2E_TEST_PATHS}"
# Convert glob patterns to playwright test paths
# e.g., "ui/tests/providers/**" -> "tests/providers"
TEST_PATHS="${E2E_TEST_PATHS}"
# Remove ui/ prefix and convert ** to empty (playwright handles recursion)
TEST_PATHS=$(echo "$TEST_PATHS" | sed 's|ui/||g' | sed 's|\*\*||g' | tr ' ' '\n' | sort -u)
TEST_PATHS=$(echo "$TEST_PATHS" | grep -vE '^tests/(setups|registry)/' || true)
# Drop auth setup helpers (not runnable test suites)
TEST_PATHS=$(echo "$TEST_PATHS" | grep -v '^tests/setups/')
# Safety net: if bare "tests/" appears (from broad patterns like ui/tests/**),
# expand to specific subdirs to avoid Playwright discovering setup files
if echo "$TEST_PATHS" | grep -qx 'tests/'; then
echo "Expanding bare 'tests/' to specific subdirs (excluding setups)..."
SPECIFIC_DIRS=""
for dir in tests/*/; do
[[ "$dir" == "tests/setups/" || "$dir" == "tests/registry/" ]] && continue
[[ "$dir" == "tests/setups/" ]] && continue
SPECIFIC_DIRS="${SPECIFIC_DIRS}${dir}"$'\n'
done
TEST_PATHS=$(echo "$TEST_PATHS" | grep -vx 'tests/' || true)
# Replace "tests/" with specific dirs, keep other paths
TEST_PATHS=$(echo "$TEST_PATHS" | grep -vx 'tests/')
TEST_PATHS="${TEST_PATHS}"$'\n'"${SPECIFIC_DIRS}"
TEST_PATHS=$(echo "$TEST_PATHS" | grep -v '^$' | sort -u)
fi
if [[ -z "$TEST_PATHS" ]]; then
echo "No runnable E2E test paths after filtering setups"
exit 0
fi
# Filter out directories that don't contain any test files
VALID_PATHS=""
while IFS= read -r path; do
[[ -z "$path" ]] && continue
if find "$path" -name '*.spec.ts' -o -name '*.test.ts' 2>/dev/null | head -1 | grep -q .; then
VALID_PATHS="${VALID_PATHS}${path}"$'\n'
while IFS= read -r p; do
[[ -z "$p" ]] && continue
if find "$p" -name '*.spec.ts' -o -name '*.test.ts' 2>/dev/null | head -1 | grep -q .; then
VALID_PATHS="${VALID_PATHS}${p}"$'\n'
else
echo "Skipping empty test directory: $path"
echo "Skipping empty test directory: $p"
fi
done <<< "$TEST_PATHS"
VALID_PATHS=$(echo "$VALID_PATHS" | grep -v '^$' || true)
if [[ -n "$VALID_PATHS" ]]; then
TEST_PATHS=$(echo "$VALID_PATHS" | tr '\n' ' ')
echo "Resolved standard test paths: $TEST_PATHS"
read -ra test_paths <<< "$TEST_PATHS"
pnpm exec playwright test "${test_paths[@]}"
else
echo "No standard E2E test paths selected."
if [[ -z "$VALID_PATHS" ]]; then
echo "No test files found in any resolved paths — skipping E2E"
exit 0
fi
TEST_PATHS=$(echo "$VALID_PATHS" | tr '\n' ' ')
echo "Resolved test paths: $TEST_PATHS"
read -ra test_paths <<< "$TEST_PATHS"
pnpm exec playwright test "${test_paths[@]}"
fi
- name: Run Registry fixture E2E tests
if: |
!cancelled() &&
(steps.standard-e2e.outcome == 'success' || steps.standard-e2e.outcome == 'failure') &&
(env.RUN_ALL_TESTS == 'true' || contains(format(' {0} ', env.E2E_TEST_PATHS), ' ui/tests/registry/'))
working-directory: ./ui
run: pnpm run test:e2e:registry
- name: Upload test reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: failure()
+5 -5
View File
@@ -126,12 +126,12 @@ Every AWS provider scan will enqueue an Attack Paths ingestion job automatically
| Provider | Checks | Services | [Compliance Frameworks](https://docs.prowler.com/user-guide/compliance/tutorials/compliance) | [Categories](https://docs.prowler.com/user-guide/cli/tutorials/misc#categories) | Support | Interface |
|---|---|---|---|---|---|---|
| AWS | 662 | 86 | 50 | 19 | Official | UI, API, CLI |
| Azure | 191 | 22 | 25 | 16 | Official | UI, API, CLI |
| GCP | 110 | 20 | 22 | 12 | Official | UI, API, CLI |
| Kubernetes | 92 | 7 | 11 | 11 | Official | UI, API, CLI |
| AWS | 639 | 86 | 47 | 19 | Official | UI, API, CLI |
| Azure | 191 | 22 | 21 | 16 | Official | UI, API, CLI |
| GCP | 109 | 20 | 19 | 12 | Official | UI, API, CLI |
| Kubernetes | 92 | 7 | 8 | 11 | Official | UI, API, CLI |
| GitHub | 24 | 3 | 2 | 5 | Official | UI, API, CLI |
| M365 | 144 | 10 | 9 | 10 | Official | UI, API, CLI |
| M365 | 143 | 10 | 6 | 10 | Official | UI, API, CLI |
| OCI | 52 | 14 | 5 | 10 | Official | UI, API, CLI |
| Alibaba Cloud | 63 | 9 | 6 | 9 | Official | UI, API, CLI |
| Cloudflare | 29 | 3 | 2 | 5 | Official | UI, API, CLI |
-16
View File
@@ -4,22 +4,6 @@ All notable changes to the **Prowler API** are documented in this file.
<!-- changelog: release notes start -->
## [1.44.0] (Prowler v5.43.0)
### 🐞 Fixed
- Report download URLs can be signed against a browser-reachable storage host via `DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL`, so downloads complete on deployments where storage is only reachable inside the container network [(#12552)](https://github.com/prowler-cloud/prowler/pull/12552)
- A scan report download no longer fails with a server error when `DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION` is unset, which is common on storage with no meaningful region [(#12552)](https://github.com/prowler-cloud/prowler/pull/12552)
- Lapsed pending invitations are reported as expired and no longer block a new invitation for the same email [(#12831)](https://github.com/prowler-cloud/prowler/pull/12831)
### 🔐 Security
- `libsqlite3-0`, `gzip`, `perl-base` and `libpcre2-8-0` upgraded in the API container image, patching high Debian CVEs [(#12804)](https://github.com/prowler-cloud/prowler/pull/12804)
- PowerShell from 7.5.9 to 7.5.11 in the API container image, bundling .NET runtime 9.0.20 and patching CVE-2026-62901 [(#12811)](https://github.com/prowler-cloud/prowler/pull/12811)
- Bumped `anyio` to 4.14.2 to resolve CVE-2026-63374 [(#12848)](https://github.com/prowler-cloud/prowler/pull/12848)
---
## [1.43.0] (Prowler v5.42.0)
### 🔄 Changed
@@ -0,0 +1 @@
Bumped `anyio` to 4.14.2 to resolve CVE-2026-63374
@@ -0,0 +1 @@
`libsqlite3-0`, `gzip`, `perl-base` and `libpcre2-8-0` upgraded in the API container image, patching high Debian CVEs
@@ -0,0 +1 @@
PowerShell from 7.5.9 to 7.5.11 in the API container image, bundling .NET runtime 9.0.20 and patching CVE-2026-62901
@@ -0,0 +1 @@
Lapsed pending invitations are reported as expired and no longer block a new invitation for the same email
+2 -2
View File
@@ -45,7 +45,7 @@ dependencies = [
"gunicorn==26.0.0",
"uvloop==0.22.1",
"lxml==6.1.0",
"prowler @ git+https://github.com/prowler-cloud/prowler.git@v5.43",
"prowler @ git+https://github.com/prowler-cloud/prowler.git@v5.42",
"psycopg2-binary==2.9.9",
"pytest-celery[redis] (==1.3.0)",
"sentry-sdk[django] (==2.56.0)",
@@ -71,7 +71,7 @@ name = "prowler-api"
package-mode = false
# Needed for the SDK compatibility
requires-python = ">=3.11,<3.13"
version = "1.44.1"
version = "1.43.1"
# Shared ruff baseline (kept in sync with mcp_server/pyproject.toml).
# target-version tracks this project's lowest supported Python.
@@ -1,116 +0,0 @@
import uuid
import api.rls
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0097_attack_paths_scan_db_defaults"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="TenantOnboardingProfile",
fields=[
(
"id",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
("inserted_at", models.DateTimeField(auto_now_add=True)),
(
"declared_cloud_accounts",
models.CharField(
blank=True,
choices=[
("1", "1"),
("2-10", "2-10"),
("11-50", "11-50"),
("51-200", "51-200"),
("200+", "200+"),
],
max_length=16,
null=True,
),
),
(
"declared_role",
models.CharField(
blank=True,
choices=[
("security", "Security"),
("devops_platform", "DevOps / Platform"),
("developer", "Developer"),
("compliance_grc", "Compliance / GRC"),
("other", "Other"),
],
max_length=32,
null=True,
),
),
(
"declared_seniority",
models.CharField(
blank=True,
choices=[
("practitioner", "Practitioner / IC"),
("lead", "Team lead / Manager"),
("director", "Director / Head of"),
("executive", "VP / C-level"),
("founder", "Founder / Owner"),
],
max_length=32,
null=True,
),
),
("skipped", models.BooleanField(default=False)),
(
"submitted_by",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="tenant_onboarding_profiles",
related_query_name="tenant_onboarding_profile",
to=settings.AUTH_USER_MODEL,
),
),
(
"tenant",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="api.tenant"
),
),
],
options={
"db_table": "tenant_onboarding_profiles",
"abstract": False,
},
),
migrations.AddConstraint(
model_name="tenantonboardingprofile",
constraint=models.UniqueConstraint(
fields=("tenant_id",), name="unique_tenant_onboarding_profile"
),
),
migrations.AddConstraint(
model_name="tenantonboardingprofile",
# `statements` written out explicitly: RowLevelSecurityConstraint
# .deconstruct() does not serialize it, so an autogenerated
# migration falls back to ["SELECT"] and leaves the table without
# INSERT/UPDATE/DELETE policies.
constraint=api.rls.RowLevelSecurityConstraint(
"tenant_id",
name="rls_on_tenantonboardingprofile",
statements=["SELECT", "INSERT", "UPDATE", "DELETE"],
),
),
]
@@ -1,15 +0,0 @@
from django.db import migrations
class Migration(migrations.Migration):
# The onboarding profile step was reverted after 0098 had been merged, so
# the table goes away through a new migration rather than by deleting 0098.
dependencies = [
("api", "0098_tenant_onboarding_profile"),
]
operations = [
migrations.DeleteModel(
name="TenantOnboardingProfile",
),
]
+1 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.0.3
info:
title: Prowler API
version: 1.44.1
version: 1.43.1
description: |-
Prowler API specification.
+1 -47
View File
@@ -82,7 +82,7 @@ from django.db import close_old_connections, connection, connections
from django.db.models import Count
from django.db.models.signals import pre_delete
from django.http import JsonResponse
from django.test import RequestFactory, override_settings
from django.test import RequestFactory
from django.test.utils import CaptureQueriesContext
from django.urls import reverse
from django_celery_results.models import TaskResult
@@ -4540,52 +4540,6 @@ class TestScanViewSet:
assert response.status_code == status.HTTP_302_FOUND
assert response["Location"] == presigned_url
@override_settings(
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
DJANGO_OUTPUT_S3_AWS_ACCESS_KEY_ID="access-key",
DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY="secret-key",
DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN="",
DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION="eu-west-1",
)
def test_report_s3_redirects_to_the_public_storage_host(
self, authenticated_client, scans_fixture, monkeypatch
):
"""The object is looked up internally but the redirect the browser follows is public."""
scan = scans_fixture[0]
bucket = "test-bucket"
key = "report.zip"
scan.output_location = f"s3://{bucket}/{key}"
scan.state = StateChoices.COMPLETED
scan.save()
monkeypatch.setattr(
"api.v1.views.env",
type("env", (), {"str": lambda self, *_args, **_kwargs: bucket})(),
)
head_calls = []
class InternalS3Client:
def head_object(self, Bucket, Key):
head_calls.append((Bucket, Key))
return {}
def generate_presigned_url(self, *_args, **_kwargs):
raise AssertionError("the internal client must not sign the redirect")
monkeypatch.setattr("api.v1.views.get_s3_client", lambda: InternalS3Client())
url = reverse("scan-report", kwargs={"pk": scan.id})
response = authenticated_client.get(url)
assert response.status_code == status.HTTP_302_FOUND
assert head_calls == [(bucket, key)]
location = urlparse(response["Location"])
assert location.netloc == "storage.example.com"
assert location.path == f"/{bucket}/{key}"
assert "X-Amz-Signature" in parse_qs(location.query)
def test_report_s3_success_no_local_files(
self, authenticated_client, scans_fixture, monkeypatch
):
+2 -3
View File
@@ -326,7 +326,7 @@ from rest_framework_simplejwt.token_blacklist.models import (
)
from tasks.beat import schedule_provider_scan
from tasks.jobs.attack_paths import db_utils as attack_paths_db_utils
from tasks.jobs.export import get_s3_client, get_s3_presign_client
from tasks.jobs.export import get_s3_client
from tasks.tasks import (
QUEUED_SCAN_TASK_STATE,
backfill_compliance_summaries_task,
@@ -2407,8 +2407,7 @@ class ScanViewSet(ProviderVisibilityMixin, BaseRLSViewSet):
}
if content_type:
params["ResponseContentType"] = content_type
# The browser follows this URL, so it is signed against the public host.
url = (get_s3_presign_client() or client).generate_presigned_url(
url = client.generate_presigned_url(
"get_object",
Params=params,
ExpiresIn=300,
-5
View File
@@ -295,11 +295,6 @@ DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY = env.str(
)
DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN = env.str("DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN", "")
DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION = env.str("DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION", "")
# Browser-reachable storage host used to sign download URLs. Empty means sign against the
# same endpoint the API talks to, which is what Prowler Cloud on S3 does.
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL = env.str(
"DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL", ""
)
# HTTP Security Headers
SECURE_CONTENT_TYPE_NOSNIFF = True
+1 -42
View File
@@ -6,7 +6,6 @@ import boto3
import config.django.base as base
from api.db_utils import rls_transaction
from api.models import Scan
from botocore.config import Config
from botocore.exceptions import ClientError, NoCredentialsError, ParamValidationError
from celery.utils.log import get_task_logger
from django.conf import settings
@@ -223,9 +222,7 @@ def get_s3_client():
aws_access_key_id=settings.DJANGO_OUTPUT_S3_AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY,
aws_session_token=settings.DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN,
# Storage that has no meaningful region, MinIO among it, is usually configured
# without one, and botocore rejects an empty region before any request is made.
region_name=settings.DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION or "us-east-1",
region_name=settings.DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION,
)
s3_client.list_buckets()
except (ClientError, NoCredentialsError, ParamValidationError, ValueError):
@@ -235,44 +232,6 @@ def get_s3_client():
return s3_client
def get_s3_presign_client():
"""Return a client that signs URLs against the public storage host.
None means no public host is configured and the caller should presign with its own
client, which leaves deployments on real S3 with the URL they get today.
"""
public_endpoint = settings.DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL
if not public_endpoint:
return None
# Blank keys are signed as-is (empty credential scope) instead of deferring to the
# provider chain, so static credentials are only passed when they are set.
credentials = {}
if (
settings.DJANGO_OUTPUT_S3_AWS_ACCESS_KEY_ID
and settings.DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY
):
credentials = {
"aws_access_key_id": settings.DJANGO_OUTPUT_S3_AWS_ACCESS_KEY_ID,
"aws_secret_access_key": settings.DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY,
# An empty string is a token as far as botocore is concerned: it appends an
# empty X-Amz-Security-Token that storage counts when it recomputes the signature.
"aws_session_token": settings.DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN or None,
}
return boto3.client(
"s3",
**credentials,
# SigV4 puts the region in the credential scope, and MinIO answers to us-east-1
# unless it was told otherwise, so an empty region would sign an unusable URL.
region_name=settings.DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION or "us-east-1",
endpoint_url=public_endpoint,
# The signature covers the host, so the addressing style has to be pinned rather
# than guessed from the endpoint: MinIO serves path-style.
config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)
def _upload_to_s3(
tenant_id: str, scan_id: str, local_path: str, relative_key: str
) -> str | None:
-120
View File
@@ -4,18 +4,15 @@ import zipfile
from datetime import datetime
from pathlib import Path
from unittest.mock import MagicMock, patch
from urllib.parse import parse_qs, urlparse
import pytest
from botocore.exceptions import ClientError
from django.test import override_settings
from tasks.jobs.export import (
_compress_output_files,
_generate_compliance_output_directory,
_generate_output_directory,
_upload_to_s3,
get_s3_client,
get_s3_presign_client,
)
@@ -50,19 +47,6 @@ class TestOutputs:
assert client is not None
client_mock.list_buckets.assert_called()
@patch("tasks.jobs.export.boto3.client")
@override_settings(
DJANGO_OUTPUT_S3_AWS_ACCESS_KEY_ID="access-key",
DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY="secret-key",
DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN="",
DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION="",
)
def test_get_s3_client_without_a_region_uses_a_default(self, mock_boto_client):
"""botocore rejects an empty region up front, and the download views do not catch it."""
get_s3_client()
assert mock_boto_client.call_args.kwargs["region_name"] == "us-east-1"
@patch("tasks.jobs.export.boto3.client")
@patch("tasks.jobs.export.settings")
def test_get_s3_client_fallback(self, mock_settings, mock_boto_client):
@@ -259,107 +243,3 @@ class TestOutputs:
assert os.path.isdir(os.path.dirname(ens))
assert threatscore.endswith(f"aws-test-check-{expected_timestamp}")
assert ens.endswith(f"aws-test-check-{expected_timestamp}")
PRESIGN_SETTINGS = {
"DJANGO_OUTPUT_S3_AWS_ACCESS_KEY_ID": "access-key",
"DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY": "secret-key",
"DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN": "",
"DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION": "eu-west-1",
}
def _presign(client):
return client.generate_presigned_url(
"get_object",
Params={"Bucket": "output-bucket", "Key": "tenant/scan/report.zip"},
ExpiresIn=300,
)
class TestS3PresignClient:
@override_settings(**PRESIGN_SETTINGS, DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="")
def test_no_public_endpoint_returns_none(self):
assert get_s3_presign_client() is None
@override_settings(
**PRESIGN_SETTINGS,
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
)
def test_url_targets_the_public_host_in_path_style(self):
url = urlparse(_presign(get_s3_presign_client()))
assert url.netloc == "storage.example.com"
assert url.path == "/output-bucket/tenant/scan/report.zip"
@override_settings(
**PRESIGN_SETTINGS,
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
)
def test_signature_covers_the_public_host(self):
query = parse_qs(urlparse(_presign(get_s3_presign_client())).query)
assert query["X-Amz-SignedHeaders"] == ["host"]
assert "/eu-west-1/s3/aws4_request" in query["X-Amz-Credential"][0]
@override_settings(
**PRESIGN_SETTINGS,
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
)
def test_signature_is_bound_to_the_host_it_was_signed_against(self):
"""Rewriting the host afterwards cannot work, which is why the endpoint is a setting."""
public = parse_qs(urlparse(_presign(get_s3_presign_client())).query)
with override_settings(
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="http://minio:9000"
):
internal = parse_qs(urlparse(_presign(get_s3_presign_client())).query)
assert public["X-Amz-Signature"] != internal["X-Amz-Signature"]
@override_settings(
**{**PRESIGN_SETTINGS, "DJANGO_OUTPUT_S3_AWS_DEFAULT_REGION": ""},
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
)
def test_region_falls_back_to_the_minio_default(self):
query = parse_qs(urlparse(_presign(get_s3_presign_client())).query)
assert "/us-east-1/s3/aws4_request" in query["X-Amz-Credential"][0]
@override_settings(
**PRESIGN_SETTINGS,
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
)
def test_unset_session_token_is_left_out_of_the_url(self):
"""An empty token still reaches the URL as a blank param that storage signs over."""
url = _presign(get_s3_presign_client())
query = parse_qs(urlparse(url).query, keep_blank_values=True)
assert "X-Amz-Security-Token" not in query
@override_settings(
**{**PRESIGN_SETTINGS, "DJANGO_OUTPUT_S3_AWS_SESSION_TOKEN": "session-token"},
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
)
def test_session_token_is_forwarded_when_set(self):
query = parse_qs(urlparse(_presign(get_s3_presign_client())).query)
assert query["X-Amz-Security-Token"] == ["session-token"]
@override_settings(
**{
**PRESIGN_SETTINGS,
"DJANGO_OUTPUT_S3_AWS_ACCESS_KEY_ID": "",
"DJANGO_OUTPUT_S3_AWS_SECRET_ACCESS_KEY": "",
},
DJANGO_OUTPUT_S3_AWS_PUBLIC_ENDPOINT_URL="https://storage.example.com",
)
def test_blank_static_credentials_defer_to_the_provider_chain(self, monkeypatch):
"""Empty keys would otherwise be signed as-is, yielding a blank credential scope."""
monkeypatch.setenv("AWS_ACCESS_KEY_ID", "chain-key")
monkeypatch.setenv("AWS_SECRET_ACCESS_KEY", "chain-secret")
monkeypatch.delenv("AWS_SESSION_TOKEN", raising=False)
query = parse_qs(urlparse(_presign(get_s3_presign_client())).query)
assert query["X-Amz-Credential"][0].startswith("chain-key/")
Generated
+4 -16
View File
@@ -3501,17 +3501,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/18/7d/721f162c46e3de604a73674223bf6c6bc6cf7ade25b3751a71288f4dd122/huaweicloudsdkrds-3.1.204-py3-none-any.whl", hash = "sha256:a790b5b3c457a608e5679c101f463b4d037dd9a8a66f6e46144a9e5a4b37780f", size = 1626906, upload-time = "2026-07-09T09:04:06.936Z" },
]
[[package]]
name = "huaweicloudsdksmn"
version = "3.1.204"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "huaweicloudsdkcore" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/e9/5d/c0de47d011f1932c9c0ddf669c238d9fad01653d438d38203703526799d7/huaweicloudsdksmn-3.1.204-py3-none-any.whl", hash = "sha256:b0818ea9293e27458c8fa1d2da021c98006cbf9ce01cf17a0f1df598c4da3a6c", size = 323674, upload-time = "2026-07-09T09:04:24.804Z" },
]
[[package]]
name = "huaweicloudsdkvpc"
version = "3.1.204"
@@ -4846,8 +4835,8 @@ wheels = [
[[package]]
name = "prowler"
version = "5.43.0"
source = { git = "https://github.com/prowler-cloud/prowler.git?rev=v5.43#81d90fc31e24f0496950b650170c4d96f97a02f3" }
version = "5.42.0"
source = { git = "https://github.com/prowler-cloud/prowler.git?rev=v5.42#4727da7ca71a87be629a888184705eb3f2e4324e" }
dependencies = [
{ name = "alibabacloud-actiontrail20200706" },
{ name = "alibabacloud-credentials" },
@@ -4911,7 +4900,6 @@ dependencies = [
{ name = "huaweicloudsdkkms" },
{ name = "huaweicloudsdkobs" },
{ name = "huaweicloudsdkrds" },
{ name = "huaweicloudsdksmn" },
{ name = "huaweicloudsdkvpc" },
{ name = "huaweicloudsdkwaf" },
{ name = "jsonschema" },
@@ -4950,7 +4938,7 @@ dependencies = [
[[package]]
name = "prowler-api"
version = "1.44.1"
version = "1.43.1"
source = { virtual = "." }
dependencies = [
{ name = "cartography" },
@@ -5050,7 +5038,7 @@ requires-dist = [
{ name = "matplotlib", specifier = "==3.10.8" },
{ name = "neo4j", specifier = "==6.1.0" },
{ name = "openai", specifier = "==1.109.1" },
{ name = "prowler", git = "https://github.com/prowler-cloud/prowler.git?rev=v5.43" },
{ name = "prowler", git = "https://github.com/prowler-cloud/prowler.git?rev=v5.42" },
{ name = "psycopg2-binary", specifier = "==2.9.9" },
{ name = "pytest-celery", extras = ["redis"], specifier = "==1.3.0" },
{ name = "reportlab", specifier = "==4.4.10" },
-8
View File
@@ -212,14 +212,6 @@ mainConfig:
# MEDIUM
ecr_repository_vulnerability_minimum_severity: "MEDIUM"
# AWS Inspector2
# aws.inspector2_coverage_recently_scanned
# Maximum days since Inspector2 last scanned an actively covered resource
inspector2_max_days_since_last_scan: 3
# aws.inspector2_active_findings_within_max_age
# Maximum days an Inspector2 finding can stay active since it was first observed
inspector2_active_finding_max_age_days: 192
# AWS Trusted Advisor
# aws.trustedadvisor_premium_support_plan_subscribed
verify_premium_support_plans: True
@@ -0,0 +1,46 @@
import warnings
from dashboard.common_methods import get_section_containers_cis
warnings.filterwarnings("ignore")
def get_table(data):
aux = data[
[
"REQUIREMENTS_ID",
"REQUIREMENTS_DESCRIPTION",
"REQUIREMENTS_ATTRIBUTES_SECTION",
"CHECKID",
"STATUS",
"REGION",
"ACCOUNTID",
"RESOURCEID",
]
].copy()
# Shorten the long FedRAMP KSI descriptions for better display
ksi_short_names = {
"A secure cloud service offering will protect user data, control access, and apply zero trust principles": "Identity and Access Management",
"A secure cloud service offering will use cloud native architecture and design principles to enforce and enhance the Confidentiality, Integrity and Availability of the system": "Cloud Native Architecture",
"A secure cloud service provider will ensure that all system changes are properly documented and configuration baselines are updated accordingly": "Change Management",
"A secure cloud service provider will continuously educate their employees on cybersecurity measures, testing them regularly": "Cybersecurity Education",
"A secure cloud service offering will document, report, and analyze security incidents to ensure regulatory compliance and continuous security improvement": "Incident Reporting",
"A secure cloud service offering will monitor, log, and audit all important events, activity, and changes": "Monitoring, Logging, and Auditing",
"A secure cloud service offering will have intentional, organized, universal guidance for how every information resource, including personnel, is secured": "Policy and Inventory",
"A secure cloud service offering will define, maintain, and test incident response plan(s) and recovery capabilities to ensure minimal service disruption and data loss": "Recovery Planning",
"A secure cloud service offering will follow FedRAMP encryption policies, continuously verify information resource integrity, and restrict access to third-party information resources": "Service Configuration",
"A secure cloud service offering will understand, monitor, and manage supply chain risks from third-party information resources": "Third-Party Information Resources",
}
# Replace long descriptions with short names - use contains for partial matching
if not aux.empty:
for long_desc, short_name in ksi_short_names.items():
mask = aux["REQUIREMENTS_DESCRIPTION"].str.contains(
long_desc, na=False, regex=False
)
aux.loc[mask, "REQUIREMENTS_DESCRIPTION"] = short_name
return get_section_containers_cis(
aux, "REQUIREMENTS_ID", "REQUIREMENTS_ATTRIBUTES_SECTION"
)
@@ -0,0 +1,46 @@
import warnings
from dashboard.common_methods import get_section_containers_cis
warnings.filterwarnings("ignore")
def get_table(data):
aux = data[
[
"REQUIREMENTS_ID",
"REQUIREMENTS_DESCRIPTION",
"REQUIREMENTS_ATTRIBUTES_SECTION",
"CHECKID",
"STATUS",
"REGION",
"ACCOUNTID",
"RESOURCEID",
]
].copy()
# Shorten the long FedRAMP KSI descriptions for better display
ksi_short_names = {
"A secure cloud service offering will protect user data, control access, and apply zero trust principles": "Identity and Access Management",
"A secure cloud service offering will use cloud native architecture and design principles to enforce and enhance the Confidentiality, Integrity and Availability of the system": "Cloud Native Architecture",
"A secure cloud service provider will ensure that all system changes are properly documented and configuration baselines are updated accordingly": "Change Management",
"A secure cloud service provider will continuously educate their employees on cybersecurity measures, testing them regularly": "Cybersecurity Education",
"A secure cloud service offering will document, report, and analyze security incidents to ensure regulatory compliance and continuous security improvement": "Incident Reporting",
"A secure cloud service offering will monitor, log, and audit all important events, activity, and changes": "Monitoring, Logging, and Auditing",
"A secure cloud service offering will have intentional, organized, universal guidance for how every information resource, including personnel, is secured": "Policy and Inventory",
"A secure cloud service offering will define, maintain, and test incident response plan(s) and recovery capabilities to ensure minimal service disruption and data loss": "Recovery Planning",
"A secure cloud service offering will follow FedRAMP encryption policies, continuously verify information resource integrity, and restrict access to third-party information resources": "Service Configuration",
"A secure cloud service offering will understand, monitor, and manage supply chain risks from third-party information resources": "Third-Party Information Resources",
}
# Replace long descriptions with short names - use contains for partial matching
if not aux.empty:
for long_desc, short_name in ksi_short_names.items():
mask = aux["REQUIREMENTS_DESCRIPTION"].str.contains(
long_desc, na=False, regex=False
)
aux.loc[mask, "REQUIREMENTS_DESCRIPTION"] = short_name
return get_section_containers_cis(
aux, "REQUIREMENTS_ID", "REQUIREMENTS_ATTRIBUTES_SECTION"
)
@@ -0,0 +1,46 @@
import warnings
from dashboard.common_methods import get_section_containers_cis
warnings.filterwarnings("ignore")
def get_table(data):
aux = data[
[
"REQUIREMENTS_ID",
"REQUIREMENTS_DESCRIPTION",
"REQUIREMENTS_ATTRIBUTES_SECTION",
"CHECKID",
"STATUS",
"REGION",
"ACCOUNTID",
"RESOURCEID",
]
].copy()
# Shorten the long FedRAMP KSI descriptions for better display
ksi_short_names = {
"A secure cloud service offering will protect user data, control access, and apply zero trust principles": "Identity and Access Management",
"A secure cloud service offering will use cloud native architecture and design principles to enforce and enhance the Confidentiality, Integrity and Availability of the system": "Cloud Native Architecture",
"A secure cloud service provider will ensure that all system changes are properly documented and configuration baselines are updated accordingly": "Change Management",
"A secure cloud service provider will continuously educate their employees on cybersecurity measures, testing them regularly": "Cybersecurity Education",
"A secure cloud service offering will document, report, and analyze security incidents to ensure regulatory compliance and continuous security improvement": "Incident Reporting",
"A secure cloud service offering will monitor, log, and audit all important events, activity, and changes": "Monitoring, Logging, and Auditing",
"A secure cloud service offering will have intentional, organized, universal guidance for how every information resource, including personnel, is secured": "Policy and Inventory",
"A secure cloud service offering will define, maintain, and test incident response plan(s) and recovery capabilities to ensure minimal service disruption and data loss": "Recovery Planning",
"A secure cloud service offering will follow FedRAMP encryption policies, continuously verify information resource integrity, and restrict access to third-party information resources": "Service Configuration",
"A secure cloud service offering will understand, monitor, and manage supply chain risks from third-party information resources": "Third-Party Information Resources",
}
# Replace long descriptions with short names - use contains for partial matching
if not aux.empty:
for long_desc, short_name in ksi_short_names.items():
mask = aux["REQUIREMENTS_DESCRIPTION"].str.contains(
long_desc, na=False, regex=False
)
aux.loc[mask, "REQUIREMENTS_DESCRIPTION"] = short_name
return get_section_containers_cis(
aux, "REQUIREMENTS_ID", "REQUIREMENTS_ATTRIBUTES_SECTION"
)
-56
View File
@@ -4,62 +4,6 @@ description: "New features and improvements in each Prowler release"
rss: true
---
<Update label="v5.42.0" description="September 11, 2026">
### ☁️ AWS — ISO Partitions
Prowler now resolves regions and services for the AWS ISO partitions (`aws-iso`, `aws-iso-b`, `aws-iso-e` and `aws-iso-f`) the same way it does for the commercial, China, European Sovereign Cloud and GovCloud partitions. The region matrix is filled from the endpoint metadata bundled with botocore, which needs no credentials or network access, so it covers partitions that are air-gapped from the internet. Scanning them no longer requires a hand-edited `aws_regions_by_service.json`: ISO regions such as `us-isob-east-1` are accepted by `--region` and `--excluded-region`.
Deployments that declare `PROWLER_AWS_PARTITION` also keep their bootstrap STS calls in the configured region when it belongs to that partition. An install in `us-gov-west-1` that reaches AWS only through its own VPC endpoints is no longer sent to `us-gov-east-1`, where the connection check and the scan used to time out.
Read more in the [AWS Regions and Partitions documentation](https://docs.prowler.com/user-guide/providers/aws/regions-and-partitions).
### ⏱️ AWS — Configurable Timeouts for Restricted Networks
Scans from networks with restricted egress (VPC endpoints for only some services, GovCloud or private deployments) could take hours: Boto3 waits 60 seconds to connect by default and retries connection errors, so every service without a reachable endpoint cost up to four 60-second attempts in every region. Prowler now lowers the default connect timeout to 10 seconds, keeps the read timeout at 60 seconds, and exposes both through `--aws-connect-timeout` and `--aws-read-timeout`, or through the `PROWLER_AWS_BOTO3_CONNECT_TIMEOUT` and `PROWLER_AWS_BOTO3_READ_TIMEOUT` environment variables for deployments without a CLI. `--aws-retries-max-attempts 0` now disables retries instead of silently falling back to three, leaving a single attempt per call.
Read more in the [Boto3 configuration documentation](https://docs.prowler.com/user-guide/providers/aws/boto3-configuration).
### 🐳 Image Provider — Reusable Vulnerability Database
The Image provider now honors `TRIVY_CACHE_DIR`. When the variable names a directory, Trivy keeps its vulnerability database there and Prowler leaves the directory in place after the scan, so the database is downloaded once instead of on every scan. Hosts without internet access can now scan images by pointing `TRIVY_CACHE_DIR` at a pre-populated database and setting `TRIVY_SKIP_DB_UPDATE=true`. Without the variable, the temporary cache is created and removed as before.
Read more in the [Image provider documentation](https://docs.prowler.com/user-guide/providers/image/getting-started-image#vulnerability-database-cache).
### 🎫 Jira Integration — Faster Connection Test
Testing a Jira integration no longer reports a false failure on accounts with many projects. The connection test fetched the issue types of every project one request at a time, which could outlast the wait in the UI even when the check was about to succeed. Issue types are now fetched concurrently, a project whose issue types the integration user cannot see is no longer logged as an error, and the Integrations page keeps following the connection test instead of giving up after about a minute.
Read more in the [Jira integration documentation](https://docs.prowler.com/user-guide/tutorials/prowler-app-jira-integration).
### 📚 Compliance — Catalog Integrity Fixes
A new integrity test runs over every compliance framework, asserting unique requirement IDs, no check listed twice within a requirement, and that every referenced check exists for its provider. The fixes it drove span 42 frameworks across AWS, Azure, GCP, GitHub, Kubernetes and Microsoft 365:
- **Duplicate requirement IDs:** identical copies are removed, and distinct requirements that shared an ID get their own, such as `1.10` in CIS AWS 5.0 and `rc_rp_1` for RC.RP-1 in NIST CSF 1.1. In Prowler ThreatScore for Azure, SQL auditing retention moves from `3.2.1` to `3.2.4`, and requirement `1.2.1` of Prowler ThreatScore for GCP now points to `iam_sa_no_user_managed_keys`.
- **Stale check references:** checks that no longer exist are replaced with their current name when there is a direct equivalent, or removed so the requirement reports as manual. Most of these were in the FedRAMP 20x KSI frameworks.
Renamed requirement IDs appear as new requirements for scans run after the upgrade.
The compliance overview task that runs after every scan is also faster: ThreatScore mappings are read once from the compliance template instead of from every finding, and rows are inserted with time-ordered `uuid7` IDs grouped by framework and requirement.
Read more in the [Compliance documentation](https://docs.prowler.com/user-guide/compliance/tutorials/compliance).
### 🔍 Checks
`rolesanywhere_profile_restricts_session_permissions`, `iam_role_service_trust_restricts_source_to_account` and `codebuild_project_uses_allowed_github_organizations` no longer crash with `TypeError` when the scanning role is denied `iam:ListRoles`, which dropped every finding of those checks for the account. Without the role inventory, an enabled IAM Roles Anywhere profile without session scoping reports `MANUAL`, and CodeBuild projects whose service role cannot be resolved are skipped.
Explore all AWS checks at [Prowler Hub](https://hub.prowler.com/check?provider=aws).
### 🔐 Security Updates
- `next` upgraded to 16.3.3 in the UI, patching unauthenticated remote code execution through AVIF image optimization ([GHSA-2xp9-vwfh-vxw4](https://github.com/advisories/GHSA-2xp9-vwfh-vxw4)) and on Windows-hosted servers ([GHSA-p293-qw3h-jr36](https://github.com/advisories/GHSA-p293-qw3h-jr36)).
- `sharp` upgraded to 0.35.4 in the UI, patching libheif image-decoding vulnerabilities ([GHSA-rgj7-g3m4-5g8c](https://github.com/advisories/GHSA-rgj7-g3m4-5g8c)).
- `nanoid`, `js-yaml` and `postcss`, plus eleven transitive UI dependencies, upgraded to patched versions, resolving 40 npm audit advisories (21 high, 15 moderate, 4 low).
- `libuuid` upgraded to 2.41.6-r1 in the MCP Server image, patching CVE-2026-53612, CVE-2026-53613, CVE-2026-53614, CVE-2026-76642, CVE-2026-78408 and CVE-2026-78410.
See the [full release notes on GitHub](https://github.com/prowler-cloud/prowler/releases/tag/5.42.0) for the complete list of changes.
</Update>
<Update label="v5.41.0" description="September 2, 2026">
### 📥 Scans — Import Findings from the Browser
@@ -154,8 +154,6 @@ Only fields with a numeric range, a fixed value set, or a length cap are listed.
| `max_days_secret_unused` | `7..365` days | |
| `max_days_secret_unrotated` | `1..180` days | NIST IA-5: rotate quarterly; CIS ≤90 |
| `min_kinesis_stream_retention_hours` | `24..8760` h | 1 day .. 1 year |
| `inspector2_max_days_since_last_scan` | `1..90` days | |
| `inspector2_active_finding_max_age_days` | `1..365` days | Default `192` matches the FedRAMP 20x rule that marks vulnerabilities still open after 192 days as accepted |
| `shodan_api_key` | ≤512 chars | |
### Azure
@@ -40,17 +40,6 @@ The former build-time variables map to the new runtime variables as follows:
`UI_CLOUD_ENABLED` is a plain runtime boolean flag that enables Prowler Cloud behavior when set to the exact string `"true"` and defaults to off; unlike the other renamed variables it has no legacy fallback, so `NEXT_PUBLIC_IS_CLOUD_ENV` is no longer read.
`UI_SELF_REGISTRATION_ENABLED` is a runtime opt-out flag that Prowler Local Server reads only when `UI_CLOUD_ENABLED` is `"true"`. It defaults to on and turns off when set to `"false"`, matched case-insensitively so the same value can be shared with a backend setting written `False`. When it is off, the sign-up page only opens with an invitation token, the sign-in page drops its "Sign up" link, and the profile hides "Create organization"; invited users can still complete their registration. Outside a Prowler Cloud deployment the flag is ignored and account creation stays open.
## Registry UI Rollout and Rollback
`UI_REGISTRY_ENABLED` is an optional runtime flag for Prowler Cloud and Private Cloud. Registry is eligible only when both `UI_CLOUD_ENABLED` and `UI_REGISTRY_ENABLED` are the exact string `"true"` and the current user has the backend-authorized `manage_registry` permission. Unset, `"false"`, or malformed values fail closed. The flag defaults to off and is not a replacement for backend authorization. Registry access is independent of billing; Private Cloud can use it with `CLOUD_BILLING_ENABLED=false`.
Roll out Registry only after the Registry backend dependency is deployed, intended roles have `manage_registry`, and acceptance with real credentials has exercised installation, provider account creation, credentials, connection, and scan launch. Deploy the UI with `UI_REGISTRY_ENABLED` unset or `"false"`; set it to `"true"` only in the prepared process environment, then restart or otherwise apply the environment update required by the platform. A Registry key must belong to the configured Registry environment; a production key does not authenticate against a development Registry.
The catalog displays all artifacts, including built-ins and packages containing only checks or compliance frameworks. Only external provider artifacts support Add. After confirmed installation, open Providers and select the option labeled Registry to configure an account. Creating accounts and running scans also require the corresponding provider and scan permissions. Removing an artifact keeps existing provider accounts, but future connections or scans can fail until the artifact is installed again.
To roll back, set `UI_REGISTRY_ENABLED=false` or remove it and apply the environment update. Proxy, page, and action checks deny on their next request. Navigation refreshes from server-authorized access when the page is requested again. Rollback does not delete Registry credentials, tenant artifact records, or provider accounts.
The build-time-only Sentry variables used for source-map upload — `SENTRY_ORG`, `SENTRY_PROJECT`, `SENTRY_AUTH_TOKEN`, and `SENTRY_RELEASE` — keep their names, as they are not part of Prowler Local Server's runtime configuration.
## Enabling Third-Party Integrations
@@ -128,8 +128,8 @@ To update the environment file:
Edit the `.env` file and change version values:
```env
PROWLER_UI_VERSION="5.42.0"
PROWLER_API_VERSION="5.42.0"
PROWLER_UI_VERSION="5.41.0"
PROWLER_API_VERSION="5.41.0"
```
<Note>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

After

Width:  |  Height:  |  Size: 289 KiB

@@ -91,8 +91,6 @@ The following list includes all the AWS checks with configurable variables that
| `iam_user_access_not_stale_to_sagemaker` | `max_unused_sagemaker_access_days` | Integer | `90` |
| `iam_user_accesskey_unused` | `max_unused_access_keys_days` | Integer | `45` |
| `iam_user_console_access_unused` | `max_console_access_days` | Integer | `45` |
| `inspector2_active_findings_within_max_age` | `inspector2_active_finding_max_age_days` | Integer | `192` |
| `inspector2_coverage_recently_scanned` | `inspector2_max_days_since_last_scan` | Integer | `3` |
| `kinesis_stream_data_retention_period` | `min_kinesis_stream_retention_hours` | Integer | `168` |
| `neptune_cluster_backup_enabled` | `minimum_backup_retention_period` | Integer | `7` |
| `opensearch_service_domains_not_publicly_accessible` | `trusted_ips` | List of Strings | `[]` |
@@ -492,14 +490,6 @@ aws:
# MEDIUM
ecr_repository_vulnerability_minimum_severity: "MEDIUM"
# AWS Inspector2
# aws.inspector2_coverage_recently_scanned
# Maximum days since Inspector2 last scanned an actively covered resource
inspector2_max_days_since_last_scan: 3
# aws.inspector2_active_findings_within_max_age
# Maximum days an Inspector2 finding can stay active since it was first observed
inspector2_active_finding_max_age_days: 192
# AWS Trusted Advisor
# aws.trustedadvisor_premium_support_plan_subscribed
verify_premium_support_plans: True
@@ -22,12 +22,9 @@ Prowler requires read-only access to Cloudflare zones and their settings. The fo
| Resource | Permission | Access | Description |
|----------|------------|--------|-------------|
| `Account` | `Account Settings` | `Read` | Required to list accounts and verify user identity |
| `Zone` | `Zone` | `Read` | Required to list zones |
| `Zone` | `Zone Settings` | `Read` | Required to read zone security settings (SSL/TLS mode, TLS versions, HSTS, Always Use HTTPS, WAF, etc.) |
| `Zone` | `DNS` | `Read` | Required to read DNS records (SPF, DMARC, DKIM, CAA) and DNSSEC status |
| `Zone` | `SSL and Certificates` | `Read` | Required to read Universal SSL settings |
| `Zone` | `Bot Management` | `Read` | Required to read Bot Fight Mode |
| `Zone` | `Zone WAF` | `Read` | Required to read WAF custom, rate limiting, and managed rulesets |
| `Zone` | `Zone` | `Read` | Required to list zones, rulesets, bot management, and SSL settings |
| `Zone` | `Zone Settings` | `Read` | Required to read zone security settings (TLS, HSTS, WAF, etc.) |
| `Zone` | `DNS` | `Read` | Required to read DNS records and DNSSEC status |
<Warning>
Ensure the API Token has access to all zones targeted for scanning. Missing permissions may cause some checks to fail or return incomplete results.
@@ -49,8 +46,8 @@ Create a **User API Token**, not an Account API Token. User API Tokens are creat
**Quick Setup:** Use these pre-configured links to open the Cloudflare Dashboard with the required permissions already selected:
- [Create User API Token](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22ssl_and_certificates%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22bot_management%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_waf%22%2C%22type%22%3A%22read%22%7D%5D&accountId=%2A&zoneId=all&name=Prowler%20Security%20Scanner) — creates a **User API Token** (recommended). Opens the **Create Custom Token** form prefilled with the seven required read-only scopes (`Account Settings`, `Zone`, `Zone Settings`, `DNS`, `SSL and Certificates`, `Bot Management`, `Zone WAF`) and the name `Prowler Security Scanner`. Adjust **Account Resources** and **Zone Resources** to match the accounts and zones you want to scan, then click **Create Token**.
- [Create Account-Owned API Token](https://dash.cloudflare.com/?to=/:account/api-tokens&permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22ssl_and_certificates%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22bot_management%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_waf%22%2C%22type%22%3A%22read%22%7D%5D&name=Prowler%20Security%20Scanner) — creates an [account-owned token](https://developers.cloudflare.com/fundamentals/api/how-to/account-owned-token-template/) instead. Use this for automation or CI/CD where the token should not depend on a specific user account remaining active. Requires the **Super Administrator** or **Administrator** role on the account.
- [Create User API Token](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%5D&accountId=%2A&zoneId=all&name=Prowler%20Security%20Scanner) — creates a **User API Token** (recommended). Opens the **Create Custom Token** form prefilled with the four required read-only scopes (`Account Settings`, `Zone`, `Zone Settings`, `DNS`) and the name `Prowler Security Scanner`. Adjust **Account Resources** and **Zone Resources** to match the accounts and zones you want to scan, then click **Create Token**.
- [Create Account-Owned API Token](https://dash.cloudflare.com/?to=/:account/api-tokens&permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%5D&name=Prowler%20Security%20Scanner) — creates an [account-owned token](https://developers.cloudflare.com/fundamentals/api/how-to/account-owned-token-template/) instead. Use this for automation or CI/CD where the token should not depend on a specific user account remaining active. Requires the **Super Administrator** or **Administrator** role on the account.
<Note>
Template URLs only pre-fill the token creation form. Review the permissions, configure resources, and click **Create Token** to complete the process.
@@ -69,9 +66,6 @@ Template URLs only pre-fill the token creation form. Review the permissions, con
- `Zone` — `Zone` — `Read`
- `Zone` — `Zone Settings` — `Read`
- `Zone` — `DNS` — `Read`
- `Zone` — `SSL and Certificates` — `Read`
- `Zone` — `Bot Management` — `Read`
- `Zone` — `Zone WAF` — `Read`
- **Zone Resources:** Select either:
- **Include → All zones** (to scan all zones in the account)
- **Include → Specific zone** (to limit access to specific zones)
@@ -11,16 +11,16 @@ Prowler for Cloudflare scans zones for security misconfigurations, including SSL
Set up authentication for Cloudflare with the [Cloudflare Authentication](/user-guide/providers/cloudflare/authentication) guide before starting either path:
- Create a Cloudflare User API Token (recommended) or locate the Global API Key
- Grant the required read-only permissions (`Account Settings:Read`, `Zone:Read`, `Zone Settings:Read`, `DNS:Read`, `SSL and Certificates:Read`, `Bot Management:Read`, `Zone WAF:Read`)
- Grant the required read-only permissions (`Account Settings:Read`, `Zone:Read`, `Zone Settings:Read`, `DNS:Read`)
- Identify the Cloudflare Account ID to use as the provider identifier
<Note>
**Quick Setup:** Use these pre-configured links to create a token with the required permissions already selected:
- [Create User API Token](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22ssl_and_certificates%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22bot_management%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_waf%22%2C%22type%22%3A%22read%22%7D%5D&accountId=%2A&zoneId=all&name=Prowler%20Security%20Scanner) — creates a User API Token (recommended).
- [Create Account-Owned API Token](https://dash.cloudflare.com/?to=/:account/api-tokens&permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22ssl_and_certificates%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22bot_management%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_waf%22%2C%22type%22%3A%22read%22%7D%5D&name=Prowler%20Security%20Scanner) — creates an [account-owned token](https://developers.cloudflare.com/fundamentals/api/how-to/account-owned-token-template/), better suited for automation and CI/CD.
- [Create User API Token](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%5D&accountId=%2A&zoneId=all&name=Prowler%20Security%20Scanner) — creates a User API Token (recommended).
- [Create Account-Owned API Token](https://dash.cloudflare.com/?to=/:account/api-tokens&permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22zone_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22read%22%7D%5D&name=Prowler%20Security%20Scanner) — creates an [account-owned token](https://developers.cloudflare.com/fundamentals/api/how-to/account-owned-token-template/), better suited for automation and CI/CD.
Both links open the Cloudflare Dashboard with the seven required read-only scopes (`Account Settings`, `Zone`, `Zone Settings`, `DNS`, `SSL and Certificates`, `Bot Management`, `Zone WAF`) and the name `Prowler Security Scanner` prefilled. See [Cloudflare Authentication](/user-guide/providers/cloudflare/authentication#api-token-recommended) for the equivalent manual steps.
Both links open the Cloudflare Dashboard with the four required read-only scopes (`Account Settings`, `Zone`, `Zone Settings`, `DNS`) and the name `Prowler Security Scanner` prefilled. See [Cloudflare Authentication](/user-guide/providers/cloudflare/authentication#api-token-recommended) for the equivalent manual steps.
</Note>
<CardGroup cols={2}>
@@ -241,7 +241,7 @@ steps:
### Cloudflare
Create a Cloudflare API Token with the `Account Settings:Read`, `Zone:Read`, `Zone Settings:Read`, `DNS:Read`, `SSL and Certificates:Read`, `Bot Management:Read`, and `Zone WAF:Read` permissions ([provider auth docs](/user-guide/providers/cloudflare/authentication)). Then:
Create a Cloudflare API Token with `Zone:Read`, `Zone Settings:Read`, and `DNS:Read` permissions ([provider auth docs](/user-guide/providers/cloudflare/authentication)). Then:
```yaml
- uses: prowler-cloud/prowler@5.25
-8
View File
@@ -4,14 +4,6 @@ All notable changes to the **Prowler MCP Server** are documented in this file.
<!-- changelog: release notes start -->
## [0.12.2] (Prowler v5.43.0)
### 🔐 Security
- Bumped `anyio` to 4.14.2 to resolve CVE-2026-63374 [(#12848)](https://github.com/prowler-cloud/prowler/pull/12848)
---
## [0.12.1] (Prowler v5.42.0)
### 🔐 Security
@@ -0,0 +1 @@
Bumped `anyio` to 4.14.2 to resolve CVE-2026-63374
@@ -38,7 +38,6 @@
"glue:GetSecurityConfiguration*",
"glue:SearchTables",
"glue:GetMLTransforms",
"inspector2:BatchGetFindingDetails",
"lambda:GetFunction*",
"lambda:GetLayerVersion",
"logs:FilterLogEvents",
@@ -210,7 +210,6 @@ Resources:
- "glue:GetSecurityConfiguration*"
- "glue:SearchTables"
- "glue:GetMLTransforms"
- "inspector2:BatchGetFindingDetails"
- "lambda:GetFunction*"
- "logs:FilterLogEvents"
- "lightsail:GetRelationalDatabases"
@@ -480,7 +479,6 @@ Resources:
- "glue:GetSecurityConfiguration*"
- "glue:SearchTables"
- "glue:GetMLTransforms"
- "inspector2:BatchGetFindingDetails"
- "lambda:GetFunction*"
- "logs:FilterLogEvents"
- "lightsail:GetRelationalDatabases"
-28
View File
@@ -4,34 +4,6 @@ All notable changes to the **Prowler SDK** are documented in this file.
<!-- changelog: release notes start -->
## [5.43.0] (Prowler v5.43.0)
### 🚀 Added
- `FedRAMP-20x-KSI` universal compliance framework (`fedramp_20x_ksi_2026`) with the 46 Key Security Indicators from the FedRAMP Consolidated Rules 2026 mapped for AWS, Azure, GCP, Kubernetes and M365 [(#11701)](https://github.com/prowler-cloud/prowler/pull/11701)
- `smn_topic_subscriptions` check for Huawei Cloud provider: SMN topics have at least one subscription configured [(#12186)](https://github.com/prowler-cloud/prowler/pull/12186)
- `inspector2_coverage_scan_status_active`, `inspector2_coverage_recently_scanned`, `inspector2_active_findings_no_known_exploited_vulnerabilities`, `inspector2_active_findings_kev_within_due_date`, `inspector2_active_findings_within_max_age`, `elbv2_listener_fips_tls_enabled` and `transfer_server_fips_security_policy_enabled` checks for AWS provider, covering FedRAMP 20x Class C vulnerability detection, CISA KEV remediation and FIPS cryptography rules; the KEV checks require `inspector2:BatchGetFindingDetails`, now in the Prowler additions policy [(#12808)](https://github.com/prowler-cloud/prowler/pull/12808)
- `FedRAMP-20x-FRR-Class-C` universal compliance framework (`fedramp_20x_frr_class_c_2026`) with the 158 provider rules of the FedRAMP 20x Class C ruleset from the FedRAMP Consolidated Rules 2026 for AWS, Azure, GCP, Kubernetes and M365 [(#12808)](https://github.com/prowler-cloud/prowler/pull/12808)
### 🔄 Changed
- FedRAMP 20x Phase One pilot frameworks `fedramp_20x_ksi_low_aws`, `fedramp_20x_ksi_low_azure` and `fedramp_20x_ksi_low_gcp` replaced by `fedramp_20x_ksi_2026` [(#12855)](https://github.com/prowler-cloud/prowler/pull/12855)
### 🐞 Fixed
- `security_2sv_enforced` reports domain-wide 2-Step Verification failures as FAIL even when every failing setting is overridden for a group or organizational unit [(#12700)](https://github.com/prowler-cloud/prowler/pull/12700)
- Bootstrap STS calls now try up to two more regions of the partition declared in `PROWLER_AWS_PARTITION` when the first one cannot be reached, so a deployment that routes to only one region of its partition no longer fails on an endpoint it has no path to. This covers validating credentials, assuming a role and getting an MFA session token [(#12799)](https://github.com/prowler-cloud/prowler/pull/12799)
- `KeyError` in M365 Defender malware, anti-phishing and inbound anti-spam checks when the tenant has Standard or Strict preset security policies [(#12809)](https://github.com/prowler-cloud/prowler/pull/12809)
- Azure Defender security contacts and Key Vault key rotation policies now use the endpoints of the selected cloud (`--azure-region`) instead of the hardcoded `management.azure.com` and `vault.azure.net` hosts, so both work on `AzureUSGovernment` and `AzureChinaCloud` [(#12813)](https://github.com/prowler-cloud/prowler/pull/12813)
### 🔐 Security
- `libsqlite3-0`, `gzip`, `perl-base`, `libssh2-1t64` and `libpcre2-8-0` upgraded in the SDK container image, patching nine high Debian CVEs [(#12804)](https://github.com/prowler-cloud/prowler/pull/12804)
- PowerShell from 7.5.9 to 7.5.11 in the SDK container image, bundling .NET runtime 9.0.20 and patching CVE-2026-62901 [(#12811)](https://github.com/prowler-cloud/prowler/pull/12811)
- Bumped `anyio` to 4.14.2 to resolve CVE-2026-63374 [(#12848)](https://github.com/prowler-cloud/prowler/pull/12848)
---
## [5.42.0] (Prowler v5.42.0)
### 🚀 Added
@@ -0,0 +1 @@
Bootstrap STS calls now try up to two more regions of the partition declared in `PROWLER_AWS_PARTITION` when the first one cannot be reached, so a deployment that routes to only one region of its partition no longer fails on an endpoint it has no path to. This covers validating credentials, assuming a role and getting an MFA session token
@@ -0,0 +1 @@
`security_2sv_enforced` reports domain-wide 2-Step Verification failures as FAIL even when every failing setting is overridden for a group or organizational unit
@@ -0,0 +1 @@
Bumped `anyio` to 4.14.2 to resolve CVE-2026-63374
@@ -0,0 +1 @@
`libsqlite3-0`, `gzip`, `perl-base`, `libssh2-1t64` and `libpcre2-8-0` upgraded in the SDK container image, patching nine high Debian CVEs
@@ -0,0 +1 @@
PowerShell from 7.5.9 to 7.5.11 in the SDK container image, bundling .NET runtime 9.0.20 and patching CVE-2026-62901
@@ -0,0 +1,383 @@
{
"Framework": "FedRAMP-20x-KSI-Low",
"Name": "FedRAMP 20x Key Security Indicators (KSIs) - Low Impact Level v25.05C",
"Version": "25.05C",
"Provider": "AWS",
"Description": "FedRAMP 20x Key Security Indicators (KSIs) Low Impact Level represent core security indicators for cloud service providers, focusing on automation, continuous monitoring, and cloud-native security principles per FedRAMP 20x Phase One pilot requirements for Low impact systems.",
"Requirements": [
{
"Id": "ksi-cmt",
"Name": "KSI-CMT: Change Management",
"Description": "A secure cloud service provider will ensure that all system changes are properly documented and configuration baselines are updated accordingly",
"Attributes": [
{
"ItemId": "ksi-cmt",
"Section": "Change Management",
"Service": "aws"
}
],
"Checks": [
"cloudtrail_multi_region_enabled",
"cloudtrail_log_file_validation_enabled",
"cloudtrail_s3_dataevents_read_enabled",
"cloudtrail_s3_dataevents_write_enabled",
"cloudwatch_changes_to_network_acls_alarm_configured",
"cloudwatch_changes_to_network_gateways_alarm_configured",
"cloudwatch_changes_to_network_route_tables_alarm_configured",
"cloudwatch_changes_to_vpcs_alarm_configured",
"cloudwatch_log_metric_filter_and_alarm_for_aws_config_configuration_changes_enabled",
"cloudwatch_log_metric_filter_and_alarm_for_cloudtrail_configuration_changes_enabled",
"cloudwatch_log_metric_filter_aws_organizations_changes",
"cloudwatch_log_metric_filter_for_s3_bucket_policy_changes",
"cloudwatch_log_metric_filter_policy_changes",
"cloudwatch_log_metric_filter_security_group_changes",
"config_recorder_all_regions_enabled",
"ec2_instance_managed_by_ssm",
"ec2_instance_older_than_specific_days",
"ssm_managed_compliant_patching"
],
"ConfigRequirements": [
{
"Check": "config_recorder_all_regions_enabled",
"ConfigKey": "mute_non_default_regions",
"Operator": "eq",
"Value": false
}
]
},
{
"Id": "ksi-cna",
"Name": "KSI-CNA: Cloud Native Architecture",
"Description": "A secure cloud service offering will use cloud native architecture and design principles to enforce and enhance the Confidentiality, Integrity and Availability of the system",
"Attributes": [
{
"ItemId": "ksi-cna",
"Section": "Cloud Native Architecture",
"Service": "aws"
}
],
"Checks": [
"autoscaling_group_multiple_az",
"autoscaling_group_multiple_instance_types",
"autoscaling_group_capacity_rebalance_enabled",
"dynamodb_tables_pitr_enabled",
"dynamodb_table_deletion_protection_enabled",
"ec2_instance_imdsv2_enabled",
"ec2_networkacl_allow_ingress_any_port",
"ec2_securitygroup_default_restrict_traffic",
"ec2_securitygroup_allow_ingress_from_internet_to_any_port",
"eks_cluster_network_policy_enabled",
"eks_cluster_not_publicly_accessible",
"eks_cluster_private_nodes_enabled",
"eks_cluster_uses_a_supported_version",
"elb_cross_zone_load_balancing_enabled",
"elbv2_is_in_multiple_az",
"elbv2_waf_acl_attached",
"rds_instance_multi_az",
"rds_cluster_multi_az",
"vpc_subnet_no_public_ip_by_default",
"vpc_peering_routing_tables_with_least_privilege",
"ec2_confidential_workload_host_imdsv2_not_enforced"
]
},
{
"Id": "ksi-iam",
"Name": "KSI-IAM: Identity and Access Management",
"Description": "A secure cloud service offering will protect user data, control access, and apply zero trust principles",
"Attributes": [
{
"ItemId": "ksi-iam",
"Section": "Identity and Access Management",
"Service": "aws"
}
],
"Checks": [
"iam_inline_policy_no_wildcard_marketplace_subscribe",
"iam_policy_no_wildcard_marketplace_subscribe",
"iam_administrator_access_with_mfa",
"iam_aws_attached_policy_no_administrative_privileges",
"iam_customer_attached_policy_no_administrative_privileges",
"iam_inline_policy_no_administrative_privileges",
"iam_no_custom_policy_permissive_role_assumption",
"iam_no_root_access_key",
"iam_password_policy_expires_passwords_within_90_days_or_less",
"iam_password_policy_lowercase",
"iam_password_policy_minimum_length_14",
"iam_password_policy_number",
"iam_password_policy_reuse_24",
"iam_password_policy_symbol",
"iam_password_policy_uppercase",
"iam_policy_attached_only_to_group_or_roles",
"iam_policy_no_full_access_to_cloudtrail",
"iam_policy_no_full_access_to_kms",
"iam_root_hardware_mfa_enabled",
"iam_root_mfa_enabled",
"iam_rotate_access_key_90_days",
"iam_role_access_not_stale_to_bedrock",
"iam_user_access_not_stale_to_bedrock",
"iam_user_access_not_stale_to_sagemaker",
"iam_user_accesskey_unused",
"iam_user_console_access_unused",
"iam_user_hardware_mfa_enabled",
"iam_user_mfa_enabled_console_access",
"iam_user_two_active_access_key",
"organizations_scp_check_deny_regions",
"organizations_opt_out_ai_services_policy"
]
},
{
"Id": "ksi-inr",
"Name": "KSI-INR: Incident Response",
"Description": "A secure cloud service offering will respond to incidents according to FedRAMP requirements and cloud service provider policies",
"Attributes": [
{
"ItemId": "ksi-inr",
"Section": "Incident Response",
"Service": "aws"
}
],
"Checks": [
"guardduty_centrally_managed",
"guardduty_ec2_malware_protection_enabled",
"guardduty_eks_audit_log_enabled",
"guardduty_eks_runtime_monitoring_enabled",
"guardduty_is_enabled",
"guardduty_lambda_protection_enabled",
"guardduty_no_high_severity_findings",
"guardduty_rds_protection_enabled",
"guardduty_s3_protection_enabled",
"inspector2_is_enabled",
"inspector2_active_findings_exist",
"securityhub_enabled",
"sns_topics_kms_encryption_at_rest_enabled"
],
"ConfigRequirements": [
{
"Check": "guardduty_is_enabled",
"ConfigKey": "mute_non_default_regions",
"Operator": "eq",
"Value": false
},
{
"Check": "securityhub_enabled",
"ConfigKey": "mute_non_default_regions",
"Operator": "eq",
"Value": false
}
]
},
{
"Id": "ksi-mla",
"Name": "KSI-MLA: Monitoring, Logging, and Auditing",
"Description": "A secure cloud service offering will monitor, log, and audit all important events, activity, and changes",
"Attributes": [
{
"ItemId": "ksi-mla",
"Section": "Monitoring, Logging, and Auditing",
"Service": "aws"
}
],
"Checks": [
"apigateway_restapi_logging_enabled",
"cloudtrail_cloudwatch_logging_enabled",
"cloudtrail_kms_encryption_enabled",
"cloudtrail_log_file_validation_enabled",
"cloudtrail_multi_region_enabled",
"cloudtrail_s3_dataevents_read_enabled",
"cloudtrail_s3_dataevents_write_enabled",
"cloudwatch_log_group_kms_encryption_enabled",
"cloudwatch_log_group_retention_policy_specific_days_enabled",
"ecs_cluster_container_insights_enabled",
"eks_control_plane_logging_all_types_enabled",
"elb_logging_enabled",
"elbv2_logging_enabled",
"inspector2_is_enabled",
"opensearch_service_domains_cloudwatch_logging_enabled",
"rds_instance_enhanced_monitoring_enabled",
"rds_instance_integration_cloudwatch_logs",
"redshift_cluster_audit_logging",
"s3_bucket_server_access_logging_enabled",
"vpc_flow_logs_enabled",
"wafv2_webacl_logging_enabled",
"kms_key_enclave_debug_attestation_detected",
"kms_key_enclave_attestation_unknown_image"
]
},
{
"Id": "ksi-piy",
"Name": "KSI-PIY: Policy and Inventory",
"Description": "A secure cloud service offering will have intentional, organized, universal guidance for how every information resource, including personnel, is secured",
"Attributes": [
{
"ItemId": "ksi-piy",
"Section": "Policy and Inventory",
"Service": "aws"
}
],
"Checks": [
"config_recorder_all_regions_enabled",
"config_recorder_using_aws_service_role",
"ec2_instance_managed_by_ssm",
"organizations_account_part_of_organizations",
"organizations_delegated_administrators",
"organizations_scp_check_deny_regions",
"organizations_tags_policies_enabled_and_attached",
"resourceexplorer2_indexes_found",
"trustedadvisor_premium_support_plan_subscribed"
],
"ConfigRequirements": [
{
"Check": "config_recorder_all_regions_enabled",
"ConfigKey": "mute_non_default_regions",
"Operator": "eq",
"Value": false
}
]
},
{
"Id": "ksi-rpl",
"Name": "KSI-RPL: Recovery Planning",
"Description": "A secure cloud service offering will define, maintain, and test incident response plan(s) and recovery capabilities to ensure minimal service disruption and data loss",
"Attributes": [
{
"ItemId": "ksi-rpl",
"Section": "Recovery Planning",
"Service": "aws"
}
],
"Checks": [
"backup_plans_exist",
"backup_reportplans_exist",
"backup_vaults_exist",
"backup_vaults_encrypted",
"backup_recovery_point_encrypted",
"dlm_ebs_snapshot_lifecycle_policy_exists",
"dynamodb_tables_pitr_enabled",
"dynamodb_table_deletion_protection_enabled",
"efs_have_backup_enabled",
"fsx_file_system_copy_tags_to_backups_enabled",
"rds_instance_backup_enabled",
"rds_instance_deletion_protection",
"rds_cluster_deletion_protection",
"rds_snapshots_encrypted",
"redshift_cluster_automated_snapshot"
]
},
{
"Id": "ksi-svc",
"Name": "KSI-SVC: Service Configuration",
"Description": "A secure cloud service offering will follow FedRAMP encryption policies, continuously verify information resource integrity, and restrict access to third-party information resources",
"Attributes": [
{
"ItemId": "ksi-svc",
"Section": "Service Configuration",
"Service": "aws"
}
],
"Checks": [
"acm_certificates_expiration_check",
"apigateway_restapi_cache_encrypted",
"cloudtrail_kms_encryption_enabled",
"dynamodb_accelerator_cluster_encryption_enabled",
"dynamodb_tables_kms_cmk_encryption_enabled",
"ec2_ebs_volume_encryption",
"ec2_ebs_default_encryption",
"efs_encryption_at_rest_enabled",
"eks_cluster_kms_cmk_encryption_in_secrets_enabled",
"elasticache_redis_cluster_rest_encryption_enabled",
"elasticache_redis_cluster_in_transit_encryption_enabled",
"elbv2_ssl_listeners",
"kinesis_stream_encrypted_at_rest",
"kms_cmk_rotation_enabled",
"kms_cmk_not_deleted_unintentionally",
"kms_key_not_publicly_accessible",
"rds_instance_storage_encrypted",
"rds_cluster_storage_encrypted",
"redshift_cluster_encrypted_at_rest",
"redshift_cluster_in_transit_encryption_enabled",
"s3_bucket_default_encryption",
"s3_bucket_secure_transport_policy",
"sagemaker_notebook_instance_encryption_enabled",
"sns_topics_kms_encryption_at_rest_enabled",
"sqs_queues_server_side_encryption_enabled",
"kms_key_enclave_attestation_not_enforced"
]
},
{
"Id": "ksi-tpr",
"Name": "KSI-TPR: Third-Party Information Resources",
"Description": "A secure cloud service offering will understand, monitor, and manage supply chain risks from third-party information resources",
"Attributes": [
{
"ItemId": "ksi-tpr",
"Section": "Third-Party Information Resources",
"Service": "aws"
}
],
"Checks": [
"ecr_registry_scan_images_on_push_enabled",
"ecr_repositories_lifecycle_policy_enabled",
"ecr_repositories_not_publicly_accessible",
"ecr_repositories_scan_images_on_push_enabled",
"ecr_repositories_scan_vulnerabilities_in_latest_image",
"ecr_repositories_tag_immutability",
"inspector2_active_findings_exist",
"inspector2_is_enabled",
"awslambda_function_using_supported_runtimes",
"ssm_managed_compliant_patching",
"trustedadvisor_premium_support_plan_subscribed",
"guardduty_no_high_severity_findings"
]
},
{
"Id": "ksi-iam-07",
"Name": "KSI-IAM-07: Account Lifecycle Management",
"Description": "Securely manage the lifecycle and privileges of all accounts, roles, and groups",
"Attributes": [
{
"ItemId": "ksi-iam-07",
"Section": "Identity and Access Management",
"Service": "aws"
}
],
"Checks": [
"iam_no_root_access_key",
"iam_policy_attached_only_to_group_or_roles",
"iam_rotate_access_key_90_days",
"iam_role_access_not_stale_to_bedrock",
"iam_user_access_not_stale_to_bedrock",
"iam_user_access_not_stale_to_sagemaker",
"iam_user_accesskey_unused",
"iam_user_console_access_unused",
"organizations_delegated_administrators"
]
},
{
"Id": "ksi-mla-07",
"Name": "KSI-MLA-07: Monitoring and Logging Inventory",
"Description": "Maintain a list of information resources and event types that will be monitored, logged, and audited",
"Attributes": [
{
"ItemId": "ksi-mla-07",
"Section": "Monitoring, Logging, and Auditing",
"Service": "aws"
}
],
"Checks": [
"cloudtrail_multi_region_enabled",
"cloudwatch_log_group_retention_policy_specific_days_enabled",
"config_recorder_all_regions_enabled",
"inspector2_is_enabled",
"resourceexplorer2_indexes_found"
],
"ConfigRequirements": [
{
"Check": "config_recorder_all_regions_enabled",
"ConfigKey": "mute_non_default_regions",
"Operator": "eq",
"Value": false
}
]
}
]
}
@@ -0,0 +1,305 @@
{
"Framework": "FedRAMP-20x-KSI-Low",
"Name": "FedRAMP 20x Key Security Indicators (KSIs) - Low Impact Level v25.05C",
"Version": "25.05C",
"Provider": "Azure",
"Description": "FedRAMP 20x Key Security Indicators (KSIs) Low Impact Level represent core security indicators for cloud service providers, focusing on automation, continuous monitoring, and cloud-native security principles per FedRAMP 20x Phase One pilot requirements for Low impact systems.",
"Requirements": [
{
"Id": "ksi-cmt",
"Name": "KSI-CMT: Change Management",
"Description": "A secure cloud service provider will ensure that all system changes are properly documented and configuration baselines are updated accordingly",
"Attributes": [
{
"ItemId": "ksi-cmt",
"Section": "Change Management",
"Service": "azure"
}
],
"Checks": [
"monitor_alert_create_policy_assignment",
"monitor_alert_create_update_sqlserver_fr",
"monitor_alert_delete_sqlserver_fr",
"monitor_alert_create_update_nsg",
"monitor_alert_create_update_public_ip_address_rule",
"monitor_alert_create_update_security_solution",
"monitor_alert_delete_nsg",
"monitor_alert_delete_policy_assignment",
"monitor_alert_delete_public_ip_address_rule",
"monitor_alert_delete_security_solution",
"monitor_diagnostic_setting_with_appropriate_categories",
"defender_assessments_vm_endpoint_protection_installed"
]
},
{
"Id": "ksi-cna",
"Name": "KSI-CNA: Cloud Native Architecture",
"Description": "A secure cloud service offering will use cloud native architecture and design principles to enforce and enhance the Confidentiality, Integrity and Availability of the system",
"Attributes": [
{
"ItemId": "ksi-cna",
"Section": "Cloud Native Architecture",
"Service": "azure"
}
],
"Checks": [
"aks_clusters_created_with_private_nodes",
"aks_clusters_public_access_disabled",
"aks_network_policy_enabled",
"app_function_vnet_integration_enabled",
"app_function_not_publicly_accessible",
"containerregistry_not_publicly_accessible",
"containerregistry_uses_private_link",
"cosmosdb_account_use_private_endpoints",
"cosmosdb_account_firewall_use_selected_networks",
"databricks_workspace_vnet_injection_enabled",
"keyvault_access_only_through_private_endpoints",
"keyvault_private_endpoints",
"network_bastion_host_exists",
"network_flow_log_captured_sent",
"network_ssh_internet_access_restricted",
"network_rdp_internet_access_restricted",
"network_watcher_enabled",
"storage_default_network_access_rule_is_denied"
]
},
{
"Id": "ksi-iam",
"Name": "KSI-IAM: Identity and Access Management",
"Description": "A secure cloud service offering will protect user data, control access, and apply zero trust principles",
"Attributes": [
{
"ItemId": "ksi-iam",
"Section": "Identity and Access Management",
"Service": "azure"
}
],
"Checks": [
"entra_conditional_access_policy_require_mfa_for_management_api",
"entra_global_admin_in_less_than_five_users",
"entra_non_privileged_user_has_mfa",
"entra_policy_default_users_cannot_create_security_groups",
"entra_policy_ensure_default_user_cannot_create_apps",
"entra_policy_ensure_default_user_cannot_create_tenants",
"entra_policy_guest_invite_only_for_admin_roles",
"entra_policy_guest_users_access_restrictions",
"entra_policy_restricts_user_consent_for_apps",
"entra_policy_user_consent_for_verified_apps",
"entra_privileged_user_has_mfa",
"entra_security_defaults_enabled",
"entra_trusted_named_locations_exists",
"entra_user_with_vm_access_has_mfa",
"entra_users_cannot_create_microsoft_365_groups",
"iam_custom_role_has_permissions_to_administer_resource_locks",
"iam_role_user_access_admin_restricted",
"iam_subscription_roles_owner_custom_not_created",
"keyvault_rbac_enabled",
"app_function_identity_is_configured",
"app_function_identity_without_admin_privileges",
"app_ensure_auth_is_set_up",
"app_register_with_identity"
]
},
{
"Id": "ksi-inr",
"Name": "KSI-INR: Incident Response",
"Description": "A secure cloud service offering will respond to incidents according to FedRAMP requirements and cloud service provider policies",
"Attributes": [
{
"ItemId": "ksi-inr",
"Section": "Incident Response",
"Service": "azure"
}
],
"Checks": [
"defender_attack_path_notifications_properly_configured",
"defender_ensure_notify_alerts_severity_is_high",
"defender_ensure_notify_emails_to_owners",
"defender_additional_email_configured_with_a_security_contact",
"defender_container_images_resolved_vulnerabilities",
"defender_container_images_scan_enabled",
"defender_ensure_defender_for_app_services_is_on",
"defender_ensure_defender_for_arm_is_on",
"defender_ensure_defender_for_azure_sql_databases_is_on",
"defender_ensure_defender_for_containers_is_on",
"defender_ensure_defender_for_cosmosdb_is_on",
"defender_ensure_defender_for_databases_is_on",
"defender_ensure_defender_for_dns_is_on",
"defender_ensure_defender_for_keyvault_is_on",
"defender_ensure_defender_for_os_relational_databases_is_on",
"defender_ensure_defender_for_server_is_on",
"defender_ensure_defender_for_sql_servers_is_on",
"defender_ensure_defender_for_storage_is_on",
"defender_ensure_iot_hub_defender_is_on",
"defender_ensure_wdatp_is_enabled"
]
},
{
"Id": "ksi-mla",
"Name": "KSI-MLA: Monitoring, Logging, and Auditing",
"Description": "A secure cloud service offering will monitor, log, and audit all important events, activity, and changes",
"Attributes": [
{
"ItemId": "ksi-mla",
"Section": "Monitoring, Logging, and Auditing",
"Service": "azure"
}
],
"Checks": [
"app_function_application_insights_enabled",
"app_http_logs_enabled",
"appinsights_ensure_is_configured",
"defender_auto_provisioning_log_analytics_agent_vms_on",
"defender_auto_provisioning_vulnerabilty_assessments_machines_on",
"keyvault_logging_enabled",
"monitor_diagnostic_setting_with_appropriate_categories",
"monitor_diagnostic_settings_exists",
"network_flow_log_captured_sent",
"network_flow_log_more_than_90_days",
"network_watcher_enabled",
"postgresql_flexible_server_log_checkpoints_on",
"postgresql_flexible_server_log_connections_on",
"postgresql_flexible_server_log_disconnections_on",
"sqlserver_auditing_enabled",
"sqlserver_auditing_retention_90_days"
]
},
{
"Id": "ksi-piy",
"Name": "KSI-PIY: Policy and Inventory",
"Description": "A secure cloud service offering will have intentional, organized, universal guidance for how every information resource, including personnel, is secured",
"Attributes": [
{
"ItemId": "ksi-piy",
"Section": "Policy and Inventory",
"Service": "azure"
}
],
"Checks": [
"defender_ensure_defender_for_containers_is_on",
"defender_ensure_defender_for_app_services_is_on",
"defender_ensure_defender_for_azure_sql_databases_is_on",
"defender_ensure_defender_for_keyvault_is_on",
"defender_ensure_defender_for_server_is_on",
"defender_ensure_defender_for_sql_servers_is_on",
"defender_ensure_defender_for_storage_is_on"
]
},
{
"Id": "ksi-rpl",
"Name": "KSI-RPL: Recovery Planning",
"Description": "A secure cloud service offering will define, maintain, and test incident response plan(s) and recovery capabilities to ensure minimal service disruption and data loss",
"Attributes": [
{
"ItemId": "ksi-rpl",
"Section": "Recovery Planning",
"Service": "azure"
}
],
"Checks": [
"mysql_flexible_server_geo_redundant_backup_enabled",
"postgresql_flexible_server_geo_redundant_backup_enabled",
"storage_geo_redundant_enabled",
"storage_infrastructure_encryption_is_enabled",
"storage_ensure_soft_delete_is_enabled",
"vm_backup_enabled",
"vm_sufficient_daily_backup_retention_period"
]
},
{
"Id": "ksi-svc",
"Name": "KSI-SVC: Service Configuration",
"Description": "A secure cloud service offering will follow FedRAMP encryption policies, continuously verify information resource integrity, and restrict access to third-party information resources",
"Attributes": [
{
"ItemId": "ksi-svc",
"Section": "Service Configuration",
"Service": "azure"
}
],
"Checks": [
"app_client_certificates_on",
"app_ensure_http_is_redirected_to_https",
"app_minimum_tls_version_12",
"containerregistry_admin_user_disabled",
"cosmosdb_account_use_aad_and_rbac",
"databricks_workspace_cmk_encryption_enabled",
"keyvault_key_expiration_set_in_non_rbac",
"keyvault_key_rotation_enabled",
"keyvault_non_rbac_secret_expiration_set",
"mysql_flexible_server_ssl_connection_enabled",
"mysql_flexible_server_minimum_tls_version_12",
"postgresql_flexible_server_enforce_ssl_enabled",
"defender_ensure_defender_for_sql_servers_is_on",
"sqlserver_tde_encrypted_with_cmk",
"sqlserver_tde_encryption_enabled",
"sqlserver_recommended_minimal_tls_version",
"storage_secure_transfer_required_is_enabled",
"storage_ensure_encryption_with_customer_managed_keys",
"storage_infrastructure_encryption_is_enabled",
"storage_ensure_minimum_tls_version_12",
"vm_ensure_attached_disks_encrypted_with_cmk"
]
},
{
"Id": "ksi-tpr",
"Name": "KSI-TPR: Third-Party Information Resources",
"Description": "A secure cloud service offering will understand, monitor, and manage supply chain risks from third-party information resources",
"Attributes": [
{
"ItemId": "ksi-tpr",
"Section": "Third-Party Information Resources",
"Service": "azure"
}
],
"Checks": [
"app_ensure_java_version_is_latest",
"app_ensure_php_version_is_latest",
"app_ensure_python_version_is_latest",
"app_function_latest_runtime_version",
"defender_container_images_resolved_vulnerabilities",
"defender_container_images_scan_enabled",
"defender_ensure_system_updates_are_applied",
"defender_assessments_vm_endpoint_protection_installed"
]
},
{
"Id": "ksi-iam-07",
"Name": "KSI-IAM-07: Account Lifecycle Management",
"Description": "Securely manage the lifecycle and privileges of all accounts, roles, and groups",
"Attributes": [
{
"ItemId": "ksi-iam-07",
"Section": "Identity and Access Management",
"Service": "azure"
}
],
"Checks": [
"entra_non_privileged_user_has_mfa",
"entra_privileged_user_has_mfa",
"entra_user_with_recent_sign_in",
"entra_user_with_vm_access_has_mfa",
"iam_custom_role_has_permissions_to_administer_resource_locks",
"iam_role_user_access_admin_restricted",
"app_function_identity_is_configured"
]
},
{
"Id": "ksi-mla-07",
"Name": "KSI-MLA-07: Monitoring and Logging Inventory",
"Description": "Maintain a list of information resources and event types that will be monitored, logged, and audited",
"Attributes": [
{
"ItemId": "ksi-mla-07",
"Section": "Monitoring, Logging, and Auditing",
"Service": "azure"
}
],
"Checks": [
"monitor_diagnostic_setting_with_appropriate_categories",
"monitor_diagnostic_settings_exists",
"network_watcher_enabled"
]
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,294 @@
{
"Framework": "FedRAMP-20x-KSI-Low",
"Name": "FedRAMP 20x Key Security Indicators (KSIs) - Low Impact Level v25.05C",
"Version": "25.05C",
"Provider": "GCP",
"Description": "FedRAMP 20x Key Security Indicators (KSIs) Low Impact Level represent core security indicators for cloud service providers, focusing on automation, continuous monitoring, and cloud-native security principles per FedRAMP 20x Phase One pilot requirements for Low impact systems.",
"Requirements": [
{
"Id": "ksi-cmt",
"Name": "KSI-CMT: Change Management",
"Description": "A secure cloud service provider will ensure that all system changes are properly documented and configuration baselines are updated accordingly",
"Attributes": [
{
"ItemId": "ksi-cmt",
"Section": "Change Management",
"Service": "gcp"
}
],
"Checks": [
"iam_audit_logs_enabled",
"iam_cloud_asset_inventory_enabled",
"logging_log_metric_filter_and_alert_for_audit_configuration_changes_enabled",
"logging_log_metric_filter_and_alert_for_bucket_permission_changes_enabled",
"logging_log_metric_filter_and_alert_for_custom_role_changes_enabled",
"logging_log_metric_filter_and_alert_for_project_ownership_changes_enabled",
"logging_log_metric_filter_and_alert_for_sql_instance_configuration_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_firewall_rule_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_network_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_network_route_changes_enabled",
"compute_instance_serial_ports_in_use",
"compute_project_os_login_enabled"
]
},
{
"Id": "ksi-cna",
"Name": "KSI-CNA: Cloud Native Architecture",
"Description": "A secure cloud service offering will use cloud native architecture and design principles to enforce and enhance the Confidentiality, Integrity and Availability of the system",
"Attributes": [
{
"ItemId": "ksi-cna",
"Section": "Cloud Native Architecture",
"Service": "gcp"
}
],
"Checks": [
"cloudsql_instance_private_ip_assignment",
"cloudsql_instance_public_access",
"cloudsql_instance_public_ip",
"cloudstorage_bucket_uniform_bucket_level_access",
"compute_firewall_rdp_access_from_the_internet_allowed",
"compute_firewall_ssh_access_from_the_internet_allowed",
"compute_instance_block_project_wide_ssh_keys_disabled",
"compute_instance_confidential_computing_enabled",
"compute_instance_ip_forwarding_is_enabled",
"compute_instance_public_ip",
"compute_instance_shielded_vm_enabled",
"compute_loadbalancer_logging_enabled",
"compute_network_default_in_use",
"compute_network_dns_logging_enabled",
"compute_network_not_legacy",
"compute_subnet_flow_logs_enabled",
"gke_cluster_no_default_service_account"
]
},
{
"Id": "ksi-iam",
"Name": "KSI-IAM: Identity and Access Management",
"Description": "A secure cloud service offering will protect user data, control access, and apply zero trust principles",
"Attributes": [
{
"ItemId": "ksi-iam",
"Section": "Identity and Access Management",
"Service": "gcp"
}
],
"Checks": [
"apikeys_api_restrictions_configured",
"apikeys_key_exists",
"apikeys_key_rotated_in_90_days",
"compute_instance_default_service_account_in_use",
"compute_instance_default_service_account_in_use_with_full_api_access",
"iam_no_service_roles_at_project_level",
"iam_role_kms_enforce_separation_of_duties",
"iam_role_sa_enforce_separation_of_duties",
"iam_sa_no_administrative_privileges",
"iam_sa_no_user_managed_keys",
"iam_sa_user_managed_key_rotate_90_days",
"iam_sa_user_managed_key_unused",
"iam_service_account_unused"
]
},
{
"Id": "ksi-inr",
"Name": "KSI-INR: Incident Response",
"Description": "A secure cloud service offering will respond to incidents according to FedRAMP requirements and cloud service provider policies",
"Attributes": [
{
"ItemId": "ksi-inr",
"Section": "Incident Response",
"Service": "gcp"
}
],
"Checks": [
"iam_organization_essential_contacts_configured",
"iam_account_access_approval_enabled",
"logging_log_metric_filter_and_alert_for_audit_configuration_changes_enabled",
"logging_log_metric_filter_and_alert_for_bucket_permission_changes_enabled",
"logging_log_metric_filter_and_alert_for_custom_role_changes_enabled",
"logging_log_metric_filter_and_alert_for_project_ownership_changes_enabled",
"logging_log_metric_filter_and_alert_for_sql_instance_configuration_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_firewall_rule_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_network_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_network_route_changes_enabled"
]
},
{
"Id": "ksi-mla",
"Name": "KSI-MLA: Monitoring, Logging, and Auditing",
"Description": "A secure cloud service offering will monitor, log, and audit all important events, activity, and changes",
"Attributes": [
{
"ItemId": "ksi-mla",
"Section": "Monitoring, Logging, and Auditing",
"Service": "gcp"
}
],
"Checks": [
"cloudsql_instance_postgres_enable_pgaudit_flag",
"cloudsql_instance_postgres_log_connections_flag",
"cloudsql_instance_postgres_log_disconnections_flag",
"cloudsql_instance_postgres_log_error_verbosity_flag",
"cloudsql_instance_postgres_log_min_duration_statement_flag",
"cloudsql_instance_postgres_log_min_error_statement_flag",
"cloudsql_instance_postgres_log_min_messages_flag",
"cloudsql_instance_postgres_log_statement_flag",
"cloudsql_instance_sqlserver_trace_flag",
"cloudstorage_bucket_log_retention_policy_lock",
"compute_loadbalancer_logging_enabled",
"compute_network_dns_logging_enabled",
"compute_subnet_flow_logs_enabled",
"iam_audit_logs_enabled",
"logging_log_metric_filter_and_alert_for_audit_configuration_changes_enabled",
"logging_log_metric_filter_and_alert_for_bucket_permission_changes_enabled",
"logging_log_metric_filter_and_alert_for_custom_role_changes_enabled",
"logging_log_metric_filter_and_alert_for_project_ownership_changes_enabled",
"logging_log_metric_filter_and_alert_for_sql_instance_configuration_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_firewall_rule_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_network_changes_enabled",
"logging_log_metric_filter_and_alert_for_vpc_network_route_changes_enabled",
"logging_sink_created"
]
},
{
"Id": "ksi-piy",
"Name": "KSI-PIY: Policy and Inventory",
"Description": "A secure cloud service offering will have intentional, organized, universal guidance for how every information resource, including personnel, is secured",
"Attributes": [
{
"ItemId": "ksi-piy",
"Section": "Policy and Inventory",
"Service": "gcp"
}
],
"Checks": [
"iam_cloud_asset_inventory_enabled",
"iam_organization_essential_contacts_configured",
"iam_audit_logs_enabled",
"compute_project_os_login_enabled",
"compute_instance_serial_ports_in_use",
"compute_instance_block_project_wide_ssh_keys_disabled",
"logging_sink_created"
]
},
{
"Id": "ksi-rpl",
"Name": "KSI-RPL: Recovery Planning",
"Description": "A secure cloud service offering will define, maintain, and test incident response plan(s) and recovery capabilities to ensure minimal service disruption and data loss",
"Attributes": [
{
"ItemId": "ksi-rpl",
"Section": "Recovery Planning",
"Service": "gcp"
}
],
"Checks": [
"cloudsql_instance_automated_backups",
"cloudstorage_bucket_log_retention_policy_lock",
"cloudstorage_bucket_versioning_enabled",
"cloudstorage_bucket_lifecycle_management_enabled"
]
},
{
"Id": "ksi-svc",
"Name": "KSI-SVC: Service Configuration",
"Description": "A secure cloud service offering will follow FedRAMP encryption policies, continuously verify information resource integrity, and restrict access to third-party information resources",
"Attributes": [
{
"ItemId": "ksi-svc",
"Section": "Service Configuration",
"Service": "gcp"
}
],
"Checks": [
"bigquery_dataset_cmk_encryption",
"bigquery_table_cmk_encryption",
"cloudsql_instance_mysql_local_infile_flag",
"cloudsql_instance_mysql_skip_show_database_flag",
"cloudsql_instance_postgres_enable_pgaudit_flag",
"cloudsql_instance_postgres_log_connections_flag",
"cloudsql_instance_postgres_log_disconnections_flag",
"cloudsql_instance_postgres_log_error_verbosity_flag",
"cloudsql_instance_postgres_log_min_duration_statement_flag",
"cloudsql_instance_postgres_log_min_error_statement_flag",
"cloudsql_instance_postgres_log_min_messages_flag",
"cloudsql_instance_postgres_log_statement_flag",
"cloudsql_instance_sqlserver_contained_database_authentication_flag",
"cloudsql_instance_sqlserver_cross_db_ownership_chaining_flag",
"cloudsql_instance_sqlserver_external_scripts_enabled_flag",
"cloudsql_instance_sqlserver_remote_access_flag",
"cloudsql_instance_sqlserver_trace_flag",
"cloudsql_instance_sqlserver_user_connections_flag",
"cloudsql_instance_sqlserver_user_options_flag",
"cloudsql_instance_ssl_connections",
"compute_instance_encryption_with_csek_enabled",
"compute_instance_shielded_vm_enabled",
"dataproc_encrypted_with_cmks_disabled",
"dns_dnssec_disabled",
"dns_rsasha1_in_use_to_key_sign_in_dnssec",
"dns_rsasha1_in_use_to_zone_sign_in_dnssec",
"kms_key_not_publicly_accessible",
"kms_key_rotation_enabled"
]
},
{
"Id": "ksi-tpr",
"Name": "KSI-TPR: Third-Party Information Resources",
"Description": "A secure cloud service offering will understand, monitor, and manage supply chain risks from third-party information resources",
"Attributes": [
{
"ItemId": "ksi-tpr",
"Section": "Third-Party Information Resources",
"Service": "gcp"
}
],
"Checks": [
"artifacts_container_analysis_enabled",
"gcr_container_scanning_enabled",
"compute_public_address_shodan",
"cloudsql_instance_automated_backups",
"iam_sa_user_managed_key_rotate_90_days",
"iam_service_account_unused",
"gemini_api_disabled"
]
},
{
"Id": "ksi-iam-07",
"Name": "KSI-IAM-07: Account Lifecycle Management",
"Description": "Securely manage the lifecycle and privileges of all accounts, roles, and groups",
"Attributes": [
{
"ItemId": "ksi-iam-07",
"Section": "Identity and Access Management",
"Service": "gcp"
}
],
"Checks": [
"apikeys_key_rotated_in_90_days",
"iam_sa_user_managed_key_rotate_90_days",
"iam_sa_user_managed_key_unused",
"iam_service_account_unused",
"compute_instance_default_service_account_in_use"
]
},
{
"Id": "ksi-mla-07",
"Name": "KSI-MLA-07: Monitoring and Logging Inventory",
"Description": "Maintain a list of information resources and event types that will be monitored, logged, and audited",
"Attributes": [
{
"ItemId": "ksi-mla-07",
"Section": "Monitoring, Logging, and Auditing",
"Service": "gcp"
}
],
"Checks": [
"iam_audit_logs_enabled",
"iam_cloud_asset_inventory_enabled",
"logging_sink_created",
"compute_subnet_flow_logs_enabled",
"compute_network_dns_logging_enabled"
]
}
]
}
+1 -1
View File
@@ -52,7 +52,7 @@ class _MutableTimestamp:
timestamp = _MutableTimestamp(datetime.today())
timestamp_utc = _MutableTimestamp(datetime.now(timezone.utc))
prowler_version = "5.43.1"
prowler_version = "5.42.1"
html_logo_url = "https://github.com/prowler-cloud/prowler/"
square_logo_img = "https://raw.githubusercontent.com/prowler-cloud/prowler/dc7d2d5aeb92fdf12e8604f42ef6472cd3e8e889/docs/img/prowler-logo-black.png"
aws_logo = "https://user-images.githubusercontent.com/38561120/235953920-3e3fba08-0795-41dc-b480-9bea57db9f2e.png"
-8
View File
@@ -190,14 +190,6 @@ aws:
# MEDIUM
ecr_repository_vulnerability_minimum_severity: "MEDIUM"
# AWS Inspector2
# aws.inspector2_coverage_recently_scanned
# Maximum days since Inspector2 last scanned an actively covered resource
inspector2_max_days_since_last_scan: 3
# aws.inspector2_active_findings_within_max_age
# Maximum days an Inspector2 finding can stay active since it was first observed
inspector2_active_finding_max_age_days: 192
# AWS Trusted Advisor
# aws.trustedadvisor_premium_support_plan_subscribed
verify_premium_support_plans: True
-14
View File
@@ -333,20 +333,6 @@ class AWSProviderConfig(ProviderConfigBase):
description="Highest severity tolerated for ECR images.",
)
# --- Inspector2 -------------------------------------------------------
inspector2_max_days_since_last_scan: Optional[int] = Field(
default=None,
ge=1,
le=90,
description="Days since Inspector2 last scanned a covered resource. Range: 1..90.",
)
inspector2_active_finding_max_age_days: Optional[int] = Field(
default=None,
ge=1,
le=365,
description="Days an Inspector2 finding can stay active since first observed. Range: 1..365.",
)
# --- Trusted Advisor --------------------------------------------------
verify_premium_support_plans: Optional[bool] = None
+54 -157
View File
@@ -122,21 +122,6 @@
"aws-us-gov": []
}
},
"account-access": {
"regions": {
"aws": [
"ap-southeast-1",
"us-west-1"
],
"aws-cn": [],
"aws-eusc": [],
"aws-iso": [],
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": []
}
},
"acm": {
"regions": {
"aws": [
@@ -257,24 +242,6 @@
]
}
},
"agent-registry": {
"regions": {
"aws": [
"ap-northeast-1",
"ap-southeast-2",
"eu-west-1",
"us-east-1",
"us-west-2"
],
"aws-cn": [],
"aws-eusc": [],
"aws-iso": [],
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": []
}
},
"ahl": {
"regions": {
"aws": [
@@ -299,20 +266,14 @@
"aiops": {
"regions": {
"aws": [
"ap-east-1",
"ap-northeast-1",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-5",
"ap-southeast-7",
"eu-central-1",
"eu-north-1",
"eu-south-2",
"eu-west-1",
"us-east-1",
"us-east-2",
"us-west-2"
"eu-south-2"
],
"aws-cn": [],
"aws-eusc": [],
@@ -1012,15 +973,12 @@
"aws": [
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-5",
"ca-central-1",
"ca-west-1",
"eu-central-1",
"eu-central-2",
"eu-south-1",
"eu-south-2",
"eu-west-1",
@@ -1587,11 +1545,37 @@
]
}
},
"awstransform": {
"regions": {
"aws": [
"ap-northeast-1",
"ap-northeast-2",
"ap-south-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-west-2",
"sa-east-1",
"us-east-1"
],
"aws-cn": [],
"aws-eusc": [],
"aws-iso": [],
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": []
}
},
"b2bi": {
"regions": {
"aws": [
"ap-south-2",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-west-1",
"eu-west-3",
"us-east-1",
"us-east-2",
"us-west-2"
@@ -1905,7 +1889,6 @@
"ap-northeast-1",
"ap-northeast-2",
"ap-south-1",
"ap-south-2",
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-5",
@@ -1921,7 +1904,6 @@
"sa-east-1",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2"
],
"aws-cn": [],
@@ -4220,33 +4202,16 @@
"dax": {
"regions": {
"aws": [
"af-south-1",
"ap-east-1",
"ap-east-2",
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-south-2",
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-3",
"ap-southeast-4",
"ap-southeast-5",
"ap-southeast-6",
"ap-southeast-7",
"ca-central-1",
"ca-west-1",
"eu-central-1",
"eu-central-2",
"eu-north-1",
"eu-south-1",
"eu-south-2",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"il-central-1",
"mx-central-1",
"sa-east-1",
"us-east-1",
"us-east-2",
@@ -6041,10 +6006,8 @@
"evs": {
"regions": {
"aws": [
"ap-east-2",
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-south-2",
"ap-southeast-1",
@@ -6056,11 +6019,9 @@
"eu-central-2",
"eu-north-1",
"eu-south-1",
"eu-south-2",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"il-central-1",
"mx-central-1",
"sa-east-1",
"us-east-1",
@@ -9257,12 +9218,9 @@
"aws": [
"af-south-1",
"ap-east-1",
"ap-east-2",
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-south-2",
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-5",
@@ -9270,17 +9228,12 @@
"ca-central-1",
"ca-west-1",
"eu-central-1",
"eu-central-2",
"eu-north-1",
"eu-south-1",
"eu-south-2",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"il-central-1",
"me-central-1",
"me-south-1",
"mx-central-1",
"sa-east-1",
"us-east-1",
"us-east-2",
@@ -10012,9 +9965,7 @@
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": [
"us-gov-west-1"
]
"aws-us-gov": []
}
},
"neptune": {
@@ -10476,9 +10427,7 @@
"us-west-2"
],
"aws-cn": [],
"aws-eusc": [
"eusc-de-east-1"
],
"aws-eusc": [],
"aws-iso": [],
"aws-iso-b": [],
"aws-iso-e": [],
@@ -10953,10 +10902,7 @@
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": [
"us-gov-east-1",
"us-gov-west-1"
]
"aws-us-gov": []
}
},
"pca-connector-scep": {
@@ -11018,8 +10964,6 @@
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-3",
"ap-southeast-4",
"ap-southeast-6",
"eu-central-1",
"eu-north-1",
"eu-south-1",
@@ -13470,21 +13414,6 @@
"aws-us-gov": []
}
},
"securityagent": {
"regions": {
"aws": [
"us-east-1",
"us-west-2"
],
"aws-cn": [],
"aws-eusc": [],
"aws-iso": [],
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": []
}
},
"securityhub": {
"regions": {
"aws": [
@@ -13948,7 +13877,6 @@
"ap-southeast-3",
"ap-southeast-4",
"ap-southeast-5",
"ap-southeast-6",
"ap-southeast-7",
"ca-central-1",
"ca-west-1",
@@ -14911,18 +14839,6 @@
"aws-us-gov": []
}
},
"supportauthz": {
"regions": {
"aws": [],
"aws-cn": [],
"aws-eusc": [],
"aws-iso": [],
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": []
}
},
"sustainability": {
"regions": {
"aws": [
@@ -15146,10 +15062,8 @@
"aws": [
"ap-northeast-1",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"eu-central-1",
"eu-north-1",
"eu-west-1",
"us-east-1",
"us-east-2",
@@ -15169,28 +15083,20 @@
"timestream-influxdb": {
"regions": {
"aws": [
"af-south-1",
"ap-east-1",
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-south-2",
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-3",
"ap-southeast-4",
"ap-southeast-7",
"ca-central-1",
"eu-central-1",
"eu-central-2",
"eu-north-1",
"eu-south-1",
"eu-south-2",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"il-central-1",
"me-central-1",
"mx-central-1",
"sa-east-1",
@@ -15256,6 +15162,29 @@
]
}
},
"tnb": {
"regions": {
"aws": [
"ap-northeast-2",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-north-1",
"eu-south-2",
"eu-west-3",
"sa-east-1",
"us-east-1",
"us-west-2"
],
"aws-cn": [],
"aws-eusc": [],
"aws-iso": [],
"aws-iso-b": [],
"aws-iso-e": [],
"aws-iso-f": [],
"aws-us-gov": []
}
},
"transcribe": {
"regions": {
"aws": [
@@ -15508,38 +15437,7 @@
"uxc": {
"regions": {
"aws": [
"af-south-1",
"ap-east-1",
"ap-east-2",
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-south-2",
"ap-southeast-1",
"ap-southeast-2",
"ap-southeast-3",
"ap-southeast-4",
"ap-southeast-5",
"ap-southeast-6",
"ap-southeast-7",
"ca-central-1",
"ca-west-1",
"eu-central-1",
"eu-central-2",
"eu-north-1",
"eu-south-1",
"eu-south-2",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"il-central-1",
"mx-central-1",
"sa-east-1",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2"
"us-east-1"
],
"aws-cn": [],
"aws-eusc": [],
@@ -16225,7 +16123,6 @@
"aws": [
"ap-east-1",
"ap-northeast-2",
"ap-southeast-1",
"ap-southeast-5",
"eu-south-2",
"me-central-1",
@@ -1,43 +0,0 @@
{
"Provider": "aws",
"CheckID": "elbv2_listener_fips_tls_enabled",
"CheckTitle": "ELBv2 HTTPS/TLS listeners use a FIPS TLS security policy",
"CheckType": [
"Software and Configuration Checks/AWS Security Best Practices"
],
"ServiceName": "elbv2",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "low",
"ResourceType": "AwsElbv2LoadBalancer",
"ResourceGroup": "network",
"Description": "**ELBv2 HTTPS and TLS listeners** are assessed for use of a **FIPS** TLS security policy (`ELBSecurityPolicy-*-FIPS-*`). FIPS policies terminate TLS with the AWS-LC FIPS validated cryptographic module.",
"Risk": "Listeners without a FIPS policy terminate TLS with cryptographic modules that are not FIPS 140 validated, which does not meet requirements to protect federal or regulated data with **NIST CMVP validated cryptography**.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://docs.aws.amazon.com/elasticloadbalancing/latest/application/describe-ssl-policies.html",
"https://docs.aws.amazon.com/elasticloadbalancing/latest/network/describe-ssl-policies.html",
"https://aws.amazon.com/compliance/fips/"
],
"Remediation": {
"Code": {
"CLI": "aws elbv2 modify-listener --listener-arn <listener_arn> --ssl-policy ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04",
"NativeIaC": "```yaml\nResources:\n <example_resource_name>:\n Type: AWS::ElasticLoadBalancingV2::Listener\n Properties:\n LoadBalancerArn: <example_resource_arn>\n Protocol: HTTPS\n Port: 443\n DefaultActions:\n - Type: forward\n TargetGroupArn: <example_resource_arn>\n Certificates:\n - CertificateArn: <example_certificate_arn>\n SslPolicy: ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04 # FIX: uses a FIPS TLS policy\n```",
"Other": "1. In the AWS Console, go to EC2 > Load Balancers\n2. Select the load balancer and open the Listeners tab\n3. Select each HTTPS/TLS listener and choose Edit\n4. Set Security policy to a FIPS policy such as ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04\n5. Save changes",
"Terraform": "```hcl\nresource \"aws_lb_listener\" \"<example_resource_name>\" {\n load_balancer_arn = \"<example_resource_arn>\"\n port = 443\n protocol = \"HTTPS\"\n ssl_policy = \"ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04\" # FIX: FIPS TLS policy\n certificate_arn = \"<example_certificate_arn>\"\n\n default_action {\n type = \"forward\"\n target_group_arn = \"<example_resource_arn>\"\n }\n}\n```"
},
"Recommendation": {
"Text": "Use a **FIPS** TLS security policy, such as `ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04`, on every HTTPS and TLS listener that carries federal or regulated data.",
"Url": "https://hub.prowler.com/check/elbv2_listener_fips_tls_enabled"
}
},
"Categories": [
"encryption"
],
"DependsOn": [],
"RelatedTo": [
"elbv2_insecure_ssl_ciphers",
"elbv2_listener_pqc_tls_enabled"
],
"Notes": ""
}
@@ -1,35 +0,0 @@
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.elbv2.elbv2_client import elbv2_client
class elbv2_listener_fips_tls_enabled(Check):
"""Ensure every ELBv2 HTTPS or TLS listener uses a FIPS TLS security policy."""
def execute(self) -> list[Check_Report_AWS]:
"""Report whether each load balancer terminates HTTPS/TLS with a FIPS policy."""
findings = []
for lb in elbv2_client.loadbalancersv2.values():
if lb.listener_discovery_failed:
continue
report = Check_Report_AWS(metadata=self.metadata(), resource=lb)
tls_listeners = {
listener_arn: listener
for listener_arn, listener in lb.listeners.items()
if listener.protocol in ("HTTPS", "TLS")
}
non_fips_listeners = [
f"{listener.protocol}:{listener.port} ({listener_arn}) uses {listener.ssl_policy or '<none>'}"
for listener_arn, listener in tls_listeners.items()
if "FIPS" not in (listener.ssl_policy or "").split("-")
]
if not tls_listeners:
report.status = "PASS"
report.status_extended = f"ELBv2 {lb.name} has no HTTPS/TLS listeners."
elif non_fips_listeners:
report.status = "FAIL"
report.status_extended = f"ELBv2 {lb.name} has HTTPS/TLS listeners without a FIPS TLS security policy: {', '.join(non_fips_listeners)}."
else:
report.status = "PASS"
report.status_extended = f"ELBv2 {lb.name} has all HTTPS/TLS listeners using a FIPS TLS security policy."
findings.append(report)
return findings
@@ -1,42 +0,0 @@
{
"Provider": "aws",
"CheckID": "inspector2_active_findings_kev_within_due_date",
"CheckTitle": "Inspector2 has no active findings for CISA Known Exploited Vulnerabilities past their remediation due date",
"CheckType": [
"Software and Configuration Checks/Vulnerabilities/CVE",
"Software and Configuration Checks/AWS Security Best Practices"
],
"ServiceName": "inspector2",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "critical",
"ResourceType": "Other",
"ResourceGroup": "security",
"Description": "**Amazon Inspector** active findings for **CISA Known Exploited Vulnerabilities** are compared with the remediation due date (`dateDue`) that CISA assigns to each entry of the KEV catalog. Findings that are still active after that date are reported.\n\nThe result is reported per Region where Inspector is enabled.",
"Risk": "CISA due dates reflect **active exploitation**. Missing them keeps exploited vulnerabilities open beyond the window CISA sets for federal agencies and shows that vulnerability response is not keeping pace with real threats.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
"https://docs.aws.amazon.com/inspector/v2/APIReference/API_BatchGetFindingDetails.html"
],
"Remediation": {
"Code": {
"CLI": "",
"NativeIaC": "",
"Other": "1. In the AWS Console, open Amazon Inspector > Findings\n2. Filter by Vulnerability ID for each overdue CVE reported by this check\n3. Patch or upgrade the affected packages, rebuild container images or update Lambda runtimes\n4. If a fix is not available, apply the mitigations listed in the CISA catalog entry\n5. Confirm the findings move to Closed",
"Terraform": ""
},
"Recommendation": {
"Text": "Track every KEV finding against its **CISA due date** and remediate before it passes. When no fix exists yet, apply the vendor or CISA mitigations and document the residual risk.",
"Url": "https://hub.prowler.com/check/inspector2_active_findings_kev_within_due_date"
}
},
"Categories": [
"vulnerabilities"
],
"DependsOn": [],
"RelatedTo": [
"inspector2_active_findings_no_known_exploited_vulnerabilities"
],
"Notes": ""
}
@@ -1,66 +0,0 @@
from datetime import datetime, timezone
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.inspector2.inspector2_client import (
inspector2_client,
)
from prowler.providers.aws.services.inspector2.lib.vulnerabilities import (
summarize_vulnerabilities,
)
class inspector2_active_findings_kev_within_due_date(Check):
"""Ensure active Inspector2 findings for CISA KEVs are not past their CISA due date."""
def execute(self) -> list[Check_Report_AWS]:
"""Report, per Region, whether any CISA KEV finding is past its remediation due date."""
findings = []
now = datetime.now(timezone.utc)
known_exploited = inspector2_client.known_exploited_vulnerabilities
lookup_failed = inspector2_client.vulnerability_lookup_failed
for inspector in inspector2_client.inspectors:
if inspector.status != "ENABLED":
continue
report = Check_Report_AWS(metadata=self.metadata(), resource=inspector)
if inspector.findings is None:
report.status = "MANUAL"
report.status_extended = (
f"Inspector2 findings could not be retrieved in region {inspector.region}; "
"verify the inspector2:ListFindings permission."
)
findings.append(report)
continue
vulnerability_ids = {
finding.vulnerability_id
for finding in inspector.findings
if finding.vulnerability_id
}
overdue = sorted(
f"{vulnerability_id} (due {known_exploited[vulnerability_id].date_due.date().isoformat()})"
for vulnerability_id in known_exploited.keys() & vulnerability_ids
if known_exploited[vulnerability_id].date_due
and known_exploited[vulnerability_id].date_due < now
)
unverified_ids = sorted(vulnerability_ids & lookup_failed)
if overdue:
report.status = "FAIL"
report.status_extended = (
f"Inspector2 has active findings in region {inspector.region} for CISA "
"Known Exploited Vulnerabilities past their remediation due date: "
f"{summarize_vulnerabilities(overdue)}."
)
elif unverified_ids:
report.status = "MANUAL"
report.status_extended = (
"Inspector2 could not verify the CISA Known Exploited Vulnerabilities status of "
f"{summarize_vulnerabilities(unverified_ids)} in region {inspector.region}; "
"verify the inspector2:BatchGetFindingDetails permission."
)
else:
report.status = "PASS"
report.status_extended = (
f"Inspector2 has no active findings in region {inspector.region} for CISA "
"Known Exploited Vulnerabilities past their remediation due date."
)
findings.append(report)
return findings
@@ -1,43 +0,0 @@
{
"Provider": "aws",
"CheckID": "inspector2_active_findings_no_known_exploited_vulnerabilities",
"CheckTitle": "Inspector2 has no active findings for CISA Known Exploited Vulnerabilities",
"CheckType": [
"Software and Configuration Checks/Vulnerabilities/CVE",
"Software and Configuration Checks/AWS Security Best Practices"
],
"ServiceName": "inspector2",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "high",
"ResourceType": "Other",
"ResourceGroup": "security",
"Description": "**Amazon Inspector** active findings are cross-referenced with the **CISA Known Exploited Vulnerabilities (KEV)** catalog, using the CISA data that Inspector returns in the finding details (`BatchGetFindingDetails`) of each CVE.\n\nThe result is reported per Region where Inspector is enabled.",
"Risk": "KEV entries are vulnerabilities **confirmed as exploited in the wild**. Workloads carrying them are prime targets for initial access and ransomware, enabling remote code execution, data exfiltration and lateral movement.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
"https://docs.aws.amazon.com/inspector/v2/APIReference/API_BatchGetFindingDetails.html"
],
"Remediation": {
"Code": {
"CLI": "",
"NativeIaC": "",
"Other": "1. In the AWS Console, open Amazon Inspector > Findings\n2. Filter by Vulnerability ID for each CVE reported by this check\n3. Patch or upgrade the affected packages, rebuild container images or update Lambda runtimes\n4. Confirm the findings move to Closed",
"Terraform": ""
},
"Recommendation": {
"Text": "Remediate KEV findings before any other vulnerability: patch or upgrade the affected packages, rebuild and redeploy container images, and stop deploying new resources that carry **known exploited vulnerabilities**.",
"Url": "https://hub.prowler.com/check/inspector2_active_findings_no_known_exploited_vulnerabilities"
}
},
"Categories": [
"vulnerabilities"
],
"DependsOn": [],
"RelatedTo": [
"inspector2_active_findings_exist",
"inspector2_active_findings_kev_within_due_date"
],
"Notes": ""
}
@@ -1,57 +0,0 @@
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.inspector2.inspector2_client import (
inspector2_client,
)
from prowler.providers.aws.services.inspector2.lib.vulnerabilities import (
summarize_vulnerabilities,
)
class inspector2_active_findings_no_known_exploited_vulnerabilities(Check):
"""Ensure no active Inspector2 finding is a CISA Known Exploited Vulnerability."""
def execute(self) -> list[Check_Report_AWS]:
"""Report, per Region, whether any active finding is a CISA Known Exploited Vulnerability."""
findings = []
known_exploited = inspector2_client.known_exploited_vulnerabilities
lookup_failed = inspector2_client.vulnerability_lookup_failed
for inspector in inspector2_client.inspectors:
if inspector.status != "ENABLED":
continue
report = Check_Report_AWS(metadata=self.metadata(), resource=inspector)
if inspector.findings is None:
report.status = "MANUAL"
report.status_extended = (
f"Inspector2 findings could not be retrieved in region {inspector.region}; "
"verify the inspector2:ListFindings permission."
)
findings.append(report)
continue
vulnerability_ids = {
finding.vulnerability_id
for finding in inspector.findings
if finding.vulnerability_id
}
kev_ids = sorted(known_exploited.keys() & vulnerability_ids)
unverified_ids = sorted(vulnerability_ids & lookup_failed)
if kev_ids:
report.status = "FAIL"
report.status_extended = (
f"Inspector2 has active findings in region {inspector.region} for CISA "
f"Known Exploited Vulnerabilities: {summarize_vulnerabilities(kev_ids)}."
)
elif unverified_ids:
report.status = "MANUAL"
report.status_extended = (
"Inspector2 could not verify the CISA Known Exploited Vulnerabilities status of "
f"{summarize_vulnerabilities(unverified_ids)} in region {inspector.region}; "
"verify the inspector2:BatchGetFindingDetails permission."
)
else:
report.status = "PASS"
report.status_extended = (
f"Inspector2 has no active findings in region {inspector.region} for CISA "
"Known Exploited Vulnerabilities."
)
findings.append(report)
return findings
@@ -1,43 +0,0 @@
{
"Provider": "aws",
"CheckID": "inspector2_active_findings_within_max_age",
"CheckTitle": "Inspector2 has no active findings older than the configured maximum age",
"CheckType": [
"Software and Configuration Checks/Vulnerabilities/CVE",
"Software and Configuration Checks/Patch Management",
"Software and Configuration Checks/AWS Security Best Practices"
],
"ServiceName": "inspector2",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "medium",
"ResourceType": "Other",
"ResourceGroup": "security",
"Description": "**Amazon Inspector** active findings are evaluated against the configurable `inspector2_active_finding_max_age_days` threshold (192 days by default), using the time since each finding was first observed (`firstObservedAt`). Suppressed and closed findings are not active and are not evaluated.\n\nThe result is reported per Region where Inspector is enabled.",
"Risk": "Findings left open for months show that **vulnerability response** is not keeping up. Long-lived vulnerabilities give attackers time to discover and exploit them, and a backlog that is neither fixed nor formally accepted hides real risk from decision makers.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://docs.aws.amazon.com/inspector/latest/user/findings-understanding.html",
"https://docs.aws.amazon.com/inspector/latest/user/findings-managing-supression-rules.html"
],
"Remediation": {
"Code": {
"CLI": "",
"NativeIaC": "",
"Other": "1. In the Amazon Inspector console, open Findings and filter by Finding status = Active\n2. Remediate the findings first observed longest ago\n3. For vulnerabilities you formally accept, choose Suppression rules in the navigation pane and create a rule so they stop counting as active",
"Terraform": ""
},
"Recommendation": {
"Text": "Remediate findings within your vulnerability response timeframes. Vulnerabilities you decide not to fix should be formally **accepted** and suppressed with a documented justification instead of staying active indefinitely.",
"Url": "https://hub.prowler.com/check/inspector2_active_findings_within_max_age"
}
},
"Categories": [
"vulnerabilities"
],
"DependsOn": [],
"RelatedTo": [
"inspector2_active_findings_exist"
],
"Notes": ""
}
@@ -1,51 +0,0 @@
from datetime import datetime, timedelta, timezone
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.inspector2.inspector2_client import (
inspector2_client,
)
class inspector2_active_findings_within_max_age(Check):
"""Ensure no Inspector2 finding stays active longer than the configured days."""
def execute(self) -> list[Check_Report_AWS]:
"""Report, per Region, whether any active finding is older than the allowed days."""
findings = []
max_age_days = inspector2_client.audit_config.get(
"inspector2_active_finding_max_age_days", 192
)
max_age = timedelta(days=max_age_days)
now = datetime.now(timezone.utc)
for inspector in inspector2_client.inspectors:
if inspector.status != "ENABLED":
continue
report = Check_Report_AWS(metadata=self.metadata(), resource=inspector)
if inspector.findings is None:
report.status = "MANUAL"
report.status_extended = (
f"Inspector2 findings could not be retrieved in region {inspector.region}; "
"verify the inspector2:ListFindings permission."
)
findings.append(report)
continue
stale_ages = [
now - finding.first_observed_at
for finding in inspector.findings
if finding.first_observed_at
and now - finding.first_observed_at > max_age
]
if stale_ages:
report.status = "FAIL"
report.status_extended = (
f"Inspector2 has {len(stale_ages)} active findings in region {inspector.region} "
f"first observed more than {max_age_days} days ago, the oldest {max(stale_ages).days} days ago."
)
else:
report.status = "PASS"
report.status_extended = (
f"Inspector2 has no active findings in region {inspector.region} "
f"first observed more than {max_age_days} days ago."
)
findings.append(report)
return findings
@@ -1,43 +0,0 @@
{
"Provider": "aws",
"CheckID": "inspector2_coverage_recently_scanned",
"CheckTitle": "Inspector2 covered resource was scanned within the configured number of days",
"CheckType": [
"Software and Configuration Checks/Vulnerabilities/CVE",
"Software and Configuration Checks/AWS Security Best Practices"
],
"ServiceName": "inspector2",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "medium",
"ResourceType": "Other",
"ResourceGroup": "security",
"Description": "**Amazon Inspector** coverage is evaluated for every actively monitored resource. The time since the resource was last scanned (`lastScannedAt`) is compared with the configurable `inspector2_max_days_since_last_scan` threshold (3 days by default).\n\nResources still pending their first scan are not evaluated.",
"Risk": "Stale scans leave **newly published CVEs** and configuration **drift** undetected. A resource that has not been rescanned for weeks can keep running exploitable packages long after a fix is available.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://docs.aws.amazon.com/inspector/latest/user/assessing-coverage.html",
"https://docs.aws.amazon.com/inspector/latest/user/scanning-ecr.html"
],
"Remediation": {
"Code": {
"CLI": "",
"NativeIaC": "",
"Other": "1. In the Amazon Inspector console, choose Account management and review the Last scanned at value in the Instances, Container images and Lambda functions tabs\n2. For EC2 instances, confirm the SSM Agent is healthy or, under General settings > EC2 scanning settings, set the scan mode to hybrid\n3. For ECR images, increase the Amazon ECR re-scan duration in the Amazon Inspector settings\n4. Confirm the resources are rescanned",
"Terraform": ""
},
"Recommendation": {
"Text": "Keep continuous scanning healthy: use **hybrid** EC2 scanning so instances without a working SSM agent are still scanned, set a long ECR **rescan duration** for images in use, and investigate every resource whose last scan is older than the allowed window.",
"Url": "https://hub.prowler.com/check/inspector2_coverage_recently_scanned"
}
},
"Categories": [
"vulnerabilities"
],
"DependsOn": [],
"RelatedTo": [
"inspector2_is_enabled",
"inspector2_coverage_scan_status_active"
],
"Notes": ""
}
@@ -1,57 +0,0 @@
from datetime import datetime, timedelta, timezone
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.inspector2.inspector2_client import (
inspector2_client,
)
PENDING_SCAN_REASONS = {
"PENDING_INITIAL_SCAN",
"PENDING_REVIVAL_SCAN",
"SCAN_IN_PROGRESS",
}
class inspector2_coverage_recently_scanned(Check):
"""Ensure Inspector2 scanned every actively covered resource within the configured days."""
def execute(self) -> list[Check_Report_AWS]:
"""Report whether each actively covered resource was scanned within the allowed days."""
findings = []
max_days = inspector2_client.audit_config.get(
"inspector2_max_days_since_last_scan", 3
)
max_elapsed = timedelta(days=max_days)
now = datetime.now(timezone.utc)
for inspector in inspector2_client.inspectors:
if inspector.status != "ENABLED":
continue
if inspector.coverage is None:
report = Check_Report_AWS(metadata=self.metadata(), resource=inspector)
report.status = "MANUAL"
report.status_extended = (
f"Inspector2 coverage could not be retrieved in region {inspector.region}; "
"verify the inspector2:ListCoverage permission."
)
findings.append(report)
continue
for resource in inspector.coverage:
if resource.scan_status_code != "ACTIVE":
continue
if (
resource.last_scanned_at is None
and resource.scan_status_reason in PENDING_SCAN_REASONS
):
continue
report = Check_Report_AWS(metadata=self.metadata(), resource=resource)
if resource.last_scanned_at is None:
report.status = "FAIL"
report.status_extended = f"{resource.resource_type} {resource.id} has no recorded Inspector2 scan."
elif now - resource.last_scanned_at > max_elapsed:
report.status = "FAIL"
report.status_extended = f"{resource.resource_type} {resource.id} was last scanned by Inspector2 more than {max_days} days ago."
else:
report.status = "PASS"
report.status_extended = f"{resource.resource_type} {resource.id} was last scanned by Inspector2 within the last {max_days} days."
findings.append(report)
return findings
@@ -1,42 +0,0 @@
{
"Provider": "aws",
"CheckID": "inspector2_coverage_scan_status_active",
"CheckTitle": "Inspector2 covered resource is actively scanned",
"CheckType": [
"Software and Configuration Checks/Vulnerabilities/CVE",
"Software and Configuration Checks/AWS Security Best Practices"
],
"ServiceName": "inspector2",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "medium",
"ResourceType": "Other",
"ResourceGroup": "security",
"Description": "**Amazon Inspector** coverage is evaluated for every resource it tracks (EC2 instances, ECR images and repositories, Lambda functions). A resource whose scan status is `INACTIVE`, for example because of `UNMANAGED_EC2_INSTANCE`, `NO_INVENTORY`, `UNSUPPORTED_OS` or `ACCESS_DENIED`, is not being scanned for vulnerabilities.\n\nStopped, terminated, tag-excluded and aged-out resources are not evaluated.",
"Risk": "Resources that Inspector cannot scan silently fall out of **vulnerability detection**. New CVEs affecting those workloads are never reported, so exploitable software can stay deployed while the account still appears covered.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://docs.aws.amazon.com/inspector/latest/user/assessing-coverage.html",
"https://docs.aws.amazon.com/inspector/latest/user/scanning-ec2.html"
],
"Remediation": {
"Code": {
"CLI": "",
"NativeIaC": "",
"Other": "1. In the Amazon Inspector console, choose Account management\n2. Open the Instances, Container images or Lambda functions tab and review the resources that are not actively scanned\n3. Fix the reported cause: register EC2 instances with Systems Manager or set the EC2 scan mode to hybrid, use supported operating systems and runtimes, and grant access to the required encryption keys\n4. Confirm the resource is actively scanned",
"Terraform": ""
},
"Recommendation": {
"Text": "Resolve the reason reported in each inactive resource's scan status so Inspector can scan every in-scope workload. Register EC2 instances with **Systems Manager** or enable **hybrid scanning**, keep operating systems and runtimes supported, and treat scanning gaps as vulnerabilities to track.",
"Url": "https://hub.prowler.com/check/inspector2_coverage_scan_status_active"
}
},
"Categories": [
"vulnerabilities"
],
"DependsOn": [],
"RelatedTo": [
"inspector2_is_enabled"
],
"Notes": ""
}
@@ -1,46 +0,0 @@
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.inspector2.inspector2_client import (
inspector2_client,
)
NOT_APPLICABLE_SCAN_REASONS = {
"EC2_INSTANCE_STOPPED",
"EXCLUDED_BY_TAG",
"NO_RESOURCES_FOUND",
"PENDING_DISABLE",
"RESOURCE_TERMINATED",
"SCAN_ELIGIBILITY_EXPIRED",
}
class inspector2_coverage_scan_status_active(Check):
"""Ensure Inspector2 is actively scanning every covered resource."""
def execute(self) -> list[Check_Report_AWS]:
"""Report whether Inspector2 is actively scanning each covered resource."""
findings = []
for inspector in inspector2_client.inspectors:
if inspector.status != "ENABLED":
continue
if inspector.coverage is None:
report = Check_Report_AWS(metadata=self.metadata(), resource=inspector)
report.status = "MANUAL"
report.status_extended = (
f"Inspector2 coverage could not be retrieved in region {inspector.region}; "
"verify the inspector2:ListCoverage permission."
)
findings.append(report)
continue
for resource in inspector.coverage:
if resource.scan_status_reason in NOT_APPLICABLE_SCAN_REASONS:
continue
report = Check_Report_AWS(metadata=self.metadata(), resource=resource)
if resource.scan_status_code == "ACTIVE":
report.status = "PASS"
report.status_extended = f"Inspector2 is actively scanning {resource.resource_type} {resource.id}."
else:
report.status = "FAIL"
reason = resource.scan_status_reason or "no reason reported"
report.status_extended = f"Inspector2 is not scanning {resource.resource_type} {resource.id}: {reason}."
findings.append(report)
return findings
@@ -1,33 +1,16 @@
from datetime import datetime
from typing import Optional
from pydantic.v1 import BaseModel
from prowler.lib.logger import logger
from prowler.lib.scan_filters.scan_filters import is_resource_filtered
from prowler.providers.aws.lib.service.service import AWSService
FINDING_DETAILS_BATCH_SIZE = 10
class Inspector2(AWSService):
def __init__(self, provider):
# Call AWSService's __init__
super().__init__(__class__.__name__, provider)
self.inspectors = []
self.known_exploited_vulnerabilities = {}
self.vulnerability_lookup_failed = set()
self.__threading_call__(self._batch_get_account_status)
self.__threading_call__(self._list_active_findings, self.inspectors)
enabled_inspectors = [
inspector for inspector in self.inspectors if inspector.status == "ENABLED"
]
self.__threading_call__(self._list_findings, enabled_inspectors)
self.__threading_call__(self._list_coverage, enabled_inspectors)
self.__threading_call__(
self._batch_get_finding_details,
self._get_finding_detail_batches(enabled_inspectors),
)
def _batch_get_account_status(self, regional_client):
# We use this function to check if inspector2 is enabled
@@ -76,188 +59,6 @@ class Inspector2(AWSService):
f"{regional_client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
def _list_findings(self, inspector):
"""Store the active findings of the audited account for an enabled Region."""
logger.info("Inspector2 - Listing active findings details...")
try:
paginator = self.regional_clients[inspector.region].get_paginator(
"list_findings"
)
findings = []
for page in paginator.paginate(
filterCriteria={
"awsAccountId": [
{"comparison": "EQUALS", "value": self.audited_account},
],
"findingStatus": [{"comparison": "EQUALS", "value": "ACTIVE"}],
},
PaginationConfig={"PageSize": 100},
):
for finding in page.get("findings", []):
findings.append(
Finding(
arn=finding.get("findingArn", ""),
type=finding.get("type", ""),
severity=finding.get("severity", ""),
first_observed_at=finding.get("firstObservedAt"),
vulnerability_id=finding.get(
"packageVulnerabilityDetails", {}
).get("vulnerabilityId"),
resource_ids=[
resource["id"]
for resource in finding.get("resources", [])
if resource.get("id")
],
)
)
inspector.findings = findings
except Exception as error:
logger.error(
f"{inspector.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
def _list_coverage(self, inspector):
"""Store the resources Inspector2 covers in an enabled Region, respecting audit resources."""
logger.info("Inspector2 - Listing coverage...")
try:
paginator = self.regional_clients[inspector.region].get_paginator(
"list_coverage"
)
coverage = []
for page in paginator.paginate(
filterCriteria={
"accountId": [
{"comparison": "EQUALS", "value": self.audited_account},
],
},
PaginationConfig={"PageSize": 200},
):
for covered_resource in page.get("coveredResources", []):
resource_id = covered_resource.get("resourceId", "")
resource_type = covered_resource.get("resourceType", "")
scan_status = covered_resource.get("scanStatus", {})
arn = self._get_covered_resource_arn(
resource_type, resource_id, inspector.region
)
if self.audit_resources and not is_resource_filtered(
arn, self.audit_resources
):
continue
coverage.append(
CoveredResource(
id=resource_id,
arn=arn,
region=inspector.region,
resource_type=resource_type,
scan_type=covered_resource.get("scanType", ""),
scan_status_code=scan_status.get("statusCode", ""),
scan_status_reason=scan_status.get("reason", ""),
last_scanned_at=covered_resource.get("lastScannedAt"),
)
)
inspector.coverage = coverage
except Exception as error:
logger.error(
f"{inspector.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
def _get_covered_resource_arn(self, resource_type, resource_id, region):
"""Return the ARN of a covered resource, building it for EC2 instance IDs."""
if resource_type == "AWS_EC2_INSTANCE" and not resource_id.startswith("arn:"):
return f"arn:{self.audited_partition}:ec2:{region}:{self.audited_account}:instance/{resource_id}"
return resource_id
@staticmethod
def _get_finding_detail_batches(inspectors):
"""Group one active finding per CVE into finding details batches per Region."""
representatives = {}
for inspector in inspectors:
for finding in inspector.findings or []:
if finding.vulnerability_id and finding.vulnerability_id.startswith(
"CVE-"
):
representatives.setdefault(
finding.vulnerability_id, (inspector.region, finding.arn)
)
findings_by_region = {}
for vulnerability_id, (region, finding_arn) in representatives.items():
findings_by_region.setdefault(region, []).append(
(finding_arn, vulnerability_id)
)
return [
(region, findings[index : index + FINDING_DETAILS_BATCH_SIZE])
for region, findings in findings_by_region.items()
for index in range(0, len(findings), FINDING_DETAILS_BATCH_SIZE)
]
def _batch_get_finding_details(self, batch):
"""Record the CISA KEV data of the CVEs in a batch, flagging failed lookups."""
region, findings = batch
vulnerability_ids = dict(findings)
logger.info("Inspector2 - Getting finding details...")
try:
response = self.regional_clients[region].batch_get_finding_details(
findingArns=list(vulnerability_ids)
)
for detail in response.get("findingDetails", []):
vulnerability_id = vulnerability_ids.get(detail.get("findingArn"))
cisa_data = detail.get("cisaData")
if vulnerability_id and cisa_data:
self.known_exploited_vulnerabilities[vulnerability_id] = (
KnownExploitedVulnerability(
id=vulnerability_id,
date_added=cisa_data.get("dateAdded"),
date_due=cisa_data.get("dateDue"),
)
)
for detail_error in response.get("errors", []):
# Inspector has no intelligence for the CVE, so it cannot be a KEV
if detail_error.get("errorCode") == "FINDING_DETAILS_NOT_FOUND":
continue
vulnerability_id = vulnerability_ids.get(detail_error.get("findingArn"))
if vulnerability_id:
self.vulnerability_lookup_failed.add(vulnerability_id)
logger.error(
f"{region} -- {detail_error.get('errorCode')} getting finding details for {vulnerability_id}: {detail_error.get('errorMessage')}"
)
except Exception as error:
self.vulnerability_lookup_failed.update(vulnerability_ids.values())
logger.error(
f"{region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
class Finding(BaseModel):
"""Active Inspector2 finding."""
arn: str
type: str
severity: str
first_observed_at: Optional[datetime]
vulnerability_id: Optional[str]
resource_ids: list[str] = []
class CoveredResource(BaseModel):
"""Resource tracked by Inspector2 coverage."""
id: str
arn: str
region: str
resource_type: str
scan_type: str
scan_status_code: str
scan_status_reason: str
last_scanned_at: Optional[datetime]
class KnownExploitedVulnerability(BaseModel):
"""CISA Known Exploited Vulnerability data of a CVE."""
id: str
date_added: Optional[datetime]
date_due: Optional[datetime]
class Inspector(BaseModel):
id: str
@@ -269,5 +70,3 @@ class Inspector(BaseModel):
lambda_status: str
lambda_code_status: str
active_findings: bool = None
findings: Optional[list[Finding]] = None
coverage: Optional[list[CoveredResource]] = None
@@ -1,8 +0,0 @@
MAX_LISTED_VULNERABILITIES = 10
def summarize_vulnerabilities(vulnerabilities: list[str]) -> str:
"""Join vulnerability identifiers, truncating long lists."""
listed = ", ".join(vulnerabilities[:MAX_LISTED_VULNERABILITIES])
remaining = len(vulnerabilities) - MAX_LISTED_VULNERABILITIES
return f"{listed} and {remaining} more" if remaining > 0 else listed
@@ -1,42 +0,0 @@
{
"Provider": "aws",
"CheckID": "transfer_server_fips_security_policy_enabled",
"CheckTitle": "AWS Transfer Family server uses a FIPS security policy",
"CheckType": [
"Software and Configuration Checks/AWS Security Best Practices"
],
"ServiceName": "transfer",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "low",
"ResourceType": "AwsTransferServer",
"ResourceGroup": "network",
"Description": "**AWS Transfer Family servers** (SFTP, FTPS, AS2) are assessed for use of a **FIPS** security policy (`TransferSecurityPolicy-FIPS-*`, flagged `Fips: true` by AWS), which limits file-transfer sessions to the FIPS-enabled set of SSH and TLS algorithms.",
"Risk": "Servers without a FIPS security policy can negotiate algorithms outside the FIPS-enabled set, which does not meet requirements to protect federal or regulated files and credentials with **NIST CMVP validated cryptography**.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://docs.aws.amazon.com/transfer/latest/userguide/security-policies.html",
"https://aws.amazon.com/compliance/fips/"
],
"Remediation": {
"Code": {
"CLI": "aws transfer update-server --server-id <server_id> --security-policy-name TransferSecurityPolicy-FIPS-2025-03",
"NativeIaC": "```yaml\nResources:\n <example_resource_name>:\n Type: AWS::Transfer::Server\n Properties:\n Protocols:\n - SFTP\n SecurityPolicyName: TransferSecurityPolicy-FIPS-2025-03 # FIX: FIPS security policy\n```",
"Other": "1. In the AWS Console, go to AWS Transfer Family > Servers\n2. Select the server and choose Edit on the Additional details panel\n3. Set Cryptographic algorithm options (Security policy) to a FIPS policy such as TransferSecurityPolicy-FIPS-2025-03\n4. Save the changes",
"Terraform": "```hcl\nresource \"aws_transfer_server\" \"<example_resource_name>\" {\n protocols = [\"SFTP\"]\n security_policy_name = \"TransferSecurityPolicy-FIPS-2025-03\" # FIX: FIPS security policy\n}\n```"
},
"Recommendation": {
"Text": "Use a **FIPS** security policy, such as `TransferSecurityPolicy-FIPS-2025-03`, on every Transfer Family server that exchanges federal or regulated data.",
"Url": "https://hub.prowler.com/check/transfer_server_fips_security_policy_enabled"
}
},
"Categories": [
"encryption"
],
"DependsOn": [],
"RelatedTo": [
"transfer_server_in_transit_encryption_enabled",
"transfer_server_pqc_ssh_kex_enabled"
],
"Notes": ""
}
@@ -1,38 +0,0 @@
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.transfer.transfer_client import transfer_client
class transfer_server_fips_security_policy_enabled(Check):
"""Ensure every AWS Transfer Family server uses a FIPS security policy."""
def execute(self) -> list[Check_Report_AWS]:
"""Report whether each Transfer Family server uses a FIPS security policy."""
findings = []
unretrieved_servers = []
for server in transfer_client.servers.values():
policy = server.security_policy_name
if not policy:
unretrieved_servers.append(server.id)
continue
report = Check_Report_AWS(metadata=self.metadata(), resource=server)
if "FIPS" in policy.split("-"):
report.status = "PASS"
report.status_extended = (
f"Transfer Server {server.id} uses FIPS security policy {policy}."
)
else:
report.status = "FAIL"
report.status_extended = f"Transfer Server {server.id} uses security policy {policy}, which is not a FIPS security policy."
findings.append(report)
if unretrieved_servers:
report = Check_Report_AWS(metadata=self.metadata(), resource={})
report.resource_id = transfer_client.audited_account
report.resource_arn = transfer_client.audited_account_arn
report.region = transfer_client.region
report.status = "MANUAL"
report.status_extended = (
"Transfer Server security policies could not be retrieved for "
f"{', '.join(unretrieved_servers)}; verify the transfer:DescribeServer permission."
)
findings.append(report)
return findings
@@ -27,7 +27,6 @@ class AzureService:
)
self.subscriptions = provider.identity.subscriptions
self.region_config = provider.region_config
self.resource_groups = provider.resource_groups
self.locations = provider.locations
self.audit_config = provider.audit_config
+2 -2
View File
@@ -18,8 +18,8 @@ class AzureIdentityInfo(BaseModel):
class AzureRegionConfig(BaseModel):
name: str = ""
authority: Optional[str] = None
base_url: str = "https://management.azure.com"
credential_scopes: list = ["https://management.azure.com/.default"]
base_url: str = ""
credential_scopes: list = []
graph_host: str = "https://graph.microsoft.com"
graph_scope: str = "https://graph.microsoft.com/.default"
logs_endpoint: str = "https://api.loganalytics.io"
@@ -12,16 +12,7 @@ from prowler.providers.azure.lib.service.service import AzureService
class Defender(AzureService):
"""Microsoft Defender for Cloud service: pricings, settings, assessments,
security contacts, IoT solutions and JIT policies per subscription."""
def __init__(self, provider: AzureProvider):
"""Collect the Defender configuration of every audited subscription.
Args:
provider: Azure provider supplying the session, subscriptions and
the region config whose endpoints are used for every call.
"""
super().__init__(SecurityCenter, provider)
self.pricings = self._get_pricings()
@@ -30,7 +21,7 @@ class Defender(AzureService):
self.settings = self._get_settings()
self.security_contact_configurations = self._get_security_contacts(
token=provider.session.get_token(
*self.region_config.credential_scopes
"https://management.azure.com/.default"
).token
)
self.iot_security_solutions = self._get_iot_security_solutions()
@@ -177,7 +168,7 @@ class Defender(AzureService):
security_contacts = {}
for subscription_id, display_name in self.subscriptions.items():
try:
url = f"{self.region_config.base_url}/subscriptions/{subscription_id}/providers/Microsoft.Security/securityContacts?api-version=2023-12-01-preview"
url = f"https://management.azure.com/subscriptions/{subscription_id}/providers/Microsoft.Security/securityContacts?api-version=2023-12-01-preview"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
@@ -83,7 +83,6 @@ class KeyVault(AzureService):
subscription,
resource_group,
keyvault_name,
getattr(keyvault_properties, "vault_uri", ""),
provider,
)
secrets_future = executor.submit(
@@ -151,22 +150,7 @@ class KeyVault(AzureService):
)
return None
def _get_keys(
self, subscription, resource_group, keyvault_name, vault_uri, provider
):
"""Get the keys of a Key Vault, enriched with their rotation policies.
Args:
subscription: Subscription ID the vault belongs to.
resource_group: Resource group name of the vault.
keyvault_name: Vault name, used for the management API and logs.
vault_uri: Data-plane URI of the vault as returned by ARM, valid in
any Azure cloud. When empty, rotation policies are skipped.
provider: Azure provider whose session authenticates the KeyClient.
Returns:
A list of Key objects; rotation_policy is set when it could be read.
"""
def _get_keys(self, subscription, resource_group, keyvault_name, provider):
logger.info(f"KeyVault - Getting keys for {keyvault_name}...")
keys = []
keys_dict = {}
@@ -195,15 +179,10 @@ class KeyVault(AzureService):
f"Subscription ID: {subscription} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
if not vault_uri:
logger.warning(
f"KeyVault {keyvault_name} in {subscription} -- has no vault URI, skipping key rotation policies"
)
return keys
try:
key_client = KeyClient(
vault_url=vault_uri,
vault_url=f"https://{keyvault_name}.vault.azure.net/",
# TODO: review the following line
credential=provider.session,
)
properties = list(key_client.list_properties_of_keys())
-13
View File
@@ -384,19 +384,6 @@ class HuaweiCloudSession:
.build()
)
elif service == "smn":
from huaweicloudsdksmn.v2 import SmnClient
from huaweicloudsdksmn.v2.region.smn_region import SmnRegion
client_region = region or self._region
return (
SmnClient.new_builder()
.with_credentials(self._get_basic_credentials(client_region))
.with_http_config(self._http_config())
.with_region(_aligned_region(SmnRegion, client_region))
.build()
)
else:
raise HuaweiCloudServiceError(
message=f"Huawei Cloud service '{service}' is not supported"
@@ -1,4 +0,0 @@
from prowler.providers.huaweicloud.services.smn.smn_service import SMN
from prowler.providers.common.provider import Provider
smn_client = SMN(Provider.get_global_provider())
@@ -1,116 +0,0 @@
from typing import List
from pydantic.v1 import BaseModel
from prowler.lib.logger import logger
from prowler.providers.huaweicloud.lib.service.service import HuaweiCloudService
SMN_PAGE_SIZE = 100
class SMN(HuaweiCloudService):
"""
SMN (Simple Message Notification) service class for Huawei Cloud.
This class provides methods to interact with Huawei Cloud SMN service
to retrieve notification topics and their subscription counts.
"""
def __init__(self, provider):
super().__init__(__class__.__name__, provider)
self.topics: List[SMNTopic] = []
self._list_topics()
def _list_topics(self):
"""List all SMN topics across regions and get their subscription counts."""
if not self.regional_clients:
return
for region, client in self.regional_clients.items():
logger.info(f"SMN - Listing Topics in {region}...")
try:
from huaweicloudsdksmn.v2 import (
ListSubscriptionsByTopicRequest,
ListTopicsRequest,
)
offset = 0
while True:
request = ListTopicsRequest(offset=offset, limit=SMN_PAGE_SIZE)
response = self._call_with_retries(client.list_topics, request)
topics = getattr(response, "topics", None) or []
for topic in topics:
topic_urn = getattr(topic, "topic_urn", "") or ""
topic_id = getattr(topic, "topic_id", "") or ""
name = getattr(topic, "name", "") or ""
display_name = getattr(topic, "display_name", "") or ""
push_policy = getattr(topic, "push_policy", None)
try:
confirmed_subscription_count = 0
subscription_offset = 0
while True:
sub_request = ListSubscriptionsByTopicRequest(
topic_urn=topic_urn,
offset=subscription_offset,
limit=SMN_PAGE_SIZE,
)
sub_response = self._call_with_retries(
client.list_subscriptions_by_topic, sub_request
)
subscriptions = (
getattr(sub_response, "subscriptions", None) or []
)
confirmed_subscription_count += sum(
getattr(subscription, "status", None) == 1
for subscription in subscriptions
)
subscription_count = (
getattr(sub_response, "subscription_count", 0) or 0
)
subscription_offset += SMN_PAGE_SIZE
if subscription_offset >= subscription_count:
break
except Exception as sub_error:
logger.error(
f"{region} -- {sub_error.__class__.__name__}"
f"[{sub_error.__traceback__.tb_lineno}]: {sub_error}"
)
continue
self.topics.append(
SMNTopic(
topic_urn=topic_urn,
topic_id=topic_id,
name=name,
display_name=display_name,
push_policy=push_policy,
confirmed_subscription_count=confirmed_subscription_count,
region=region,
)
)
offset += SMN_PAGE_SIZE
topic_count = getattr(response, "topic_count", 0) or 0
if offset >= topic_count:
break
except Exception as error:
logger.error(
f"{region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
class SMNTopic(BaseModel):
"""SMN topic model."""
topic_urn: str
topic_id: str = ""
name: str = ""
display_name: str = ""
push_policy: int = None
confirmed_subscription_count: int = 0
region: str = ""
@@ -1,37 +0,0 @@
{
"Provider": "huaweicloud",
"CheckID": "smn_topic_subscriptions",
"CheckTitle": "SMN topics have at least one confirmed subscription",
"CheckType": [],
"ServiceName": "smn",
"SubServiceName": "",
"ResourceIdTemplate": "",
"Severity": "low",
"ResourceType": "HUAWEICLOUD::SMN::Topic",
"ResourceGroup": "messaging",
"Description": "Ensure that SMN notification topics have at least one confirmed subscription so alerts can be delivered to recipients.",
"Risk": "Topics without confirmed subscriptions cannot deliver notifications, meaning critical alerts may go unnoticed by operations and security teams.",
"RelatedUrl": "",
"AdditionalURLs": [
"https://support.huaweicloud.com/intl/en-us/api-smn/ListSubscriptionsByTopic.html",
"https://support.huaweicloud.com/intl/en-us/api-smn/AddSubscription.html"
],
"Remediation": {
"Code": {
"CLI": "hcloud SMN AddSubscription --topic_urn=<topic_urn> --protocol=<protocol> --endpoint=<endpoint>",
"NativeIaC": "",
"Other": "1. Log on to the Huawei Cloud console.\n2. Navigate to Simple Message Notification (SMN).\n3. Select the topic without subscriptions.\n4. Click Add Subscription.\n5. Configure the subscription protocol and endpoint.\n6. Confirm the subscription.",
"Terraform": ""
},
"Recommendation": {
"Text": "Add and confirm at least one subscription for each SMN topic so notifications can be delivered.",
"Url": "https://hub.prowler.com/check/smn_topic_subscriptions"
}
},
"Categories": [
"logging"
],
"DependsOn": [],
"RelatedTo": [],
"Notes": "Only confirmed subscriptions (status 1) satisfy this check. Unconfirmed or canceled subscriptions cannot provide notification coverage."
}
@@ -1,36 +0,0 @@
from prowler.lib.check.models import Check, CheckReportHuaweiCloud
from prowler.providers.huaweicloud.services.smn.smn_client import smn_client
class smn_topic_subscriptions(Check):
"""Check if SMN topics have at least one subscription configured."""
def execute(self) -> list[CheckReportHuaweiCloud]:
findings = []
for topic in smn_client.topics:
report = CheckReportHuaweiCloud(
metadata=self.metadata(),
resource=topic,
)
report.region = topic.region
report.resource_id = topic.topic_id
report.resource_name = topic.name
report.resource_arn = topic.topic_urn
if topic.confirmed_subscription_count > 0:
report.status = "PASS"
report.status_extended = (
f"SMN topic '{topic.name}' ({topic.topic_id}) has "
f"{topic.confirmed_subscription_count} confirmed subscription(s)."
)
else:
report.status = "FAIL"
report.status_extended = (
f"SMN topic '{topic.name}' ({topic.topic_id}) has no confirmed "
"subscriptions. Notifications will not be delivered."
)
findings.append(report)
return findings
@@ -55,12 +55,6 @@ class defender_antiphishing_policy_configured(Check):
policy_name,
policy,
) in defender_client.antiphishing_policies.items():
# Preset security policies are scoped by protection policy rules, not filter rules
if (
not policy.default
and policy.name not in defender_client.antiphishing_rules
):
continue
report = CheckReportM365(
metadata=self.metadata(),
resource=policy,
@@ -51,12 +51,6 @@ class defender_antispam_policy_inbound_no_allowed_domains(Check):
default_policy_well_configured = False
for policy in defender_client.inbound_spam_policies:
# Preset security policies are scoped by protection policy rules, not filter rules
if (
not policy.default
and policy.identity not in defender_client.inbound_spam_rules
):
continue
report = CheckReportM365(
metadata=self.metadata(),
resource=policy,
@@ -51,12 +51,6 @@ class defender_malware_policy_common_attachments_filter_enabled(Check):
default_policy_well_configured = False
for policy in defender_client.malware_policies:
# Preset security policies are scoped by protection policy rules, not filter rules
if (
not policy.is_default
and policy.identity not in defender_client.malware_rules
):
continue
report = CheckReportM365(
metadata=self.metadata(),
resource=policy,
@@ -114,12 +114,6 @@ class defender_malware_policy_comprehensive_attachments_filter_applied(Check):
default_policy_well_configured = False
for policy in defender_client.malware_policies:
# Preset security policies are scoped by protection policy rules, not filter rules
if (
not policy.is_default
and policy.identity not in defender_client.malware_rules
):
continue
report = CheckReportM365(
metadata=self.metadata(),
resource=policy,
@@ -51,12 +51,6 @@ class defender_malware_policy_notifications_internal_users_malware_enabled(Check
default_policy_well_configured = False
for policy in defender_client.malware_policies:
# Preset security policies are scoped by protection policy rules, not filter rules
if (
not policy.is_default
and policy.identity not in defender_client.malware_rules
):
continue
report = CheckReportM365(
metadata=self.metadata(),
resource=policy,
+1 -3
View File
@@ -133,7 +133,6 @@ dependencies = [
"huaweicloudsdkkms==3.1.204",
"huaweicloudsdkobs==3.1.204",
"huaweicloudsdkrds==3.1.204",
"huaweicloudsdksmn==3.1.204",
"huaweicloudsdkvpc==3.1.204",
"huaweicloudsdkwaf==3.1.204",
"zstandard==0.25.0"
@@ -144,7 +143,7 @@ maintainers = [{name = "Prowler Engineering", email = "engineering@prowler.com"}
name = "prowler"
readme = "README.md"
requires-python = ">=3.10,<3.14"
version = "5.43.1"
version = "5.42.1"
[project.scripts]
prowler = "prowler.__main__:prowler"
@@ -272,7 +271,6 @@ constraint-dependencies = [
"huaweicloudsdkkms==3.1.204",
"huaweicloudsdkobs==3.1.204",
"huaweicloudsdkrds==3.1.204",
"huaweicloudsdksmn==3.1.204",
"huaweicloudsdkvpc==3.1.204",
"huaweicloudsdkwaf==3.1.204",
"hyperframe==6.1.0",
-2
View File
@@ -138,8 +138,6 @@ config_aws = {
"organizations_enabled_regions": [],
"organizations_trusted_delegated_administrators": [],
"ecr_repository_vulnerability_minimum_severity": "MEDIUM",
"inspector2_max_days_since_last_scan": 3,
"inspector2_active_finding_max_age_days": 192,
"verify_premium_support_plans": True,
"threat_detection_privilege_escalation_threshold": 0.2,
"threat_detection_privilege_escalation_minutes": 1440,
-8
View File
@@ -139,14 +139,6 @@ aws:
# MEDIUM
ecr_repository_vulnerability_minimum_severity: "MEDIUM"
# AWS Inspector2
# aws.inspector2_coverage_recently_scanned
# Maximum days since Inspector2 last scanned an actively covered resource
inspector2_max_days_since_last_scan: 3
# aws.inspector2_active_findings_within_max_age
# Maximum days an Inspector2 finding can stay active since it was first observed
inspector2_active_finding_max_age_days: 192
# AWS Trusted Advisor
# aws.trustedadvisor_premium_support_plan_subscribed
verify_premium_support_plans: True
@@ -1,156 +0,0 @@
from unittest import mock
from boto3 import client, resource
from moto import mock_aws
from tests.providers.aws.utils import (
AWS_REGION_EU_WEST_1,
AWS_REGION_US_EAST_1,
set_mocked_aws_provider,
)
CHECK_MODULE = "prowler.providers.aws.services.elbv2.elbv2_listener_fips_tls_enabled.elbv2_listener_fips_tls_enabled"
FIPS_POLICY = "ELBSecurityPolicy-TLS13-1-2-FIPS-2023-04"
NON_FIPS_POLICY = "ELBSecurityPolicy-TLS13-1-2-2021-06"
def create_application_load_balancer():
conn = client("elbv2", region_name=AWS_REGION_EU_WEST_1)
ec2 = resource("ec2", region_name=AWS_REGION_EU_WEST_1)
security_group = ec2.create_security_group(
GroupName="a-security-group", Description="First One"
)
vpc = ec2.create_vpc(CidrBlock="172.28.7.0/24", InstanceTenancy="default")
subnet1 = ec2.create_subnet(
VpcId=vpc.id,
CidrBlock="172.28.7.192/26",
AvailabilityZone=f"{AWS_REGION_EU_WEST_1}a",
)
subnet2 = ec2.create_subnet(
VpcId=vpc.id,
CidrBlock="172.28.7.0/26",
AvailabilityZone=f"{AWS_REGION_EU_WEST_1}b",
)
lb = conn.create_load_balancer(
Name="my-lb",
Subnets=[subnet1.id, subnet2.id],
SecurityGroups=[security_group.id],
Scheme="internal",
Type="application",
)["LoadBalancers"][0]
target_group_arn = conn.create_target_group(
Name="a-target", Protocol="HTTP", Port=8080, VpcId=vpc.id
)["TargetGroups"][0]["TargetGroupArn"]
return conn, lb, target_group_arn
def create_listener(conn, lb, target_group_arn, protocol, port, ssl_policy=None):
listener_args = {
"LoadBalancerArn": lb["LoadBalancerArn"],
"Protocol": protocol,
"Port": port,
"DefaultActions": [{"Type": "forward", "TargetGroupArn": target_group_arn}],
}
if ssl_policy:
listener_args["SslPolicy"] = ssl_policy
return conn.create_listener(**listener_args)["Listeners"][0]
def execute_check(service=None):
from prowler.providers.aws.services.elbv2.elbv2_service import ELBv2
aws_provider = set_mocked_aws_provider(
[AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1],
create_default_organization=False,
)
with (
mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=aws_provider,
),
mock.patch(f"{CHECK_MODULE}.elbv2_client", new=service or ELBv2(aws_provider)),
):
from prowler.providers.aws.services.elbv2.elbv2_listener_fips_tls_enabled.elbv2_listener_fips_tls_enabled import (
elbv2_listener_fips_tls_enabled,
)
return elbv2_listener_fips_tls_enabled().execute()
class Test_elbv2_listener_fips_tls_enabled:
@mock_aws
def test_no_load_balancers(self):
assert execute_check() == []
@mock_aws
def test_http_listener_only(self):
conn, lb, target_group_arn = create_application_load_balancer()
create_listener(conn, lb, target_group_arn, "HTTP", 80)
result = execute_check()
assert len(result) == 1
assert result[0].status == "PASS"
assert result[0].status_extended == "ELBv2 my-lb has no HTTPS/TLS listeners."
@mock_aws
def test_fips_policy(self):
conn, lb, target_group_arn = create_application_load_balancer()
create_listener(conn, lb, target_group_arn, "HTTPS", 443, FIPS_POLICY)
result = execute_check()
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== "ELBv2 my-lb has all HTTPS/TLS listeners using a FIPS TLS security policy."
)
assert result[0].resource_id == "my-lb"
assert result[0].resource_arn == lb["LoadBalancerArn"]
assert result[0].region == AWS_REGION_EU_WEST_1
@mock_aws
def test_non_fips_policy(self):
conn, lb, target_group_arn = create_application_load_balancer()
listener = create_listener(
conn, lb, target_group_arn, "HTTPS", 443, NON_FIPS_POLICY
)
result = execute_check()
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"ELBv2 my-lb has HTTPS/TLS listeners without a FIPS TLS security policy: HTTPS:443 ({listener['ListenerArn']}) uses {NON_FIPS_POLICY}."
)
@mock_aws
def test_mixed_listeners(self):
conn, lb, target_group_arn = create_application_load_balancer()
create_listener(conn, lb, target_group_arn, "HTTPS", 443, FIPS_POLICY)
create_listener(conn, lb, target_group_arn, "HTTPS", 8443, NON_FIPS_POLICY)
result = execute_check()
assert len(result) == 1
assert result[0].status == "FAIL"
assert NON_FIPS_POLICY in result[0].status_extended
assert FIPS_POLICY not in result[0].status_extended
@mock_aws
def test_listener_discovery_failed(self):
from prowler.providers.aws.services.elbv2.elbv2_service import ELBv2
conn, lb, target_group_arn = create_application_load_balancer()
create_listener(conn, lb, target_group_arn, "HTTPS", 443, NON_FIPS_POLICY)
service = ELBv2(
set_mocked_aws_provider(
[AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1],
create_default_organization=False,
)
)
service.loadbalancersv2[lb["LoadBalancerArn"]].listener_discovery_failed = True
assert execute_check(service) == []
@@ -1,136 +0,0 @@
from datetime import datetime, timedelta, timezone
from unittest import mock
from prowler.providers.aws.services.inspector2.inspector2_service import (
Finding,
Inspector,
KnownExploitedVulnerability,
)
from tests.providers.aws.utils import (
AWS_ACCOUNT_NUMBER,
AWS_REGION_EU_WEST_1,
set_mocked_aws_provider,
)
INSPECTOR_ARN = (
f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:inspector2"
)
FINDING_ARN = f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:finding/0e436649379db5f327e3cf5bb4421d76"
KEV_ID = "CVE-2024-3400"
CHECK_MODULE = "prowler.providers.aws.services.inspector2.inspector2_active_findings_kev_within_due_date.inspector2_active_findings_kev_within_due_date"
def build_inspector(findings=None, status="ENABLED"):
return Inspector(
id="Inspector2",
arn=INSPECTOR_ARN,
region=AWS_REGION_EU_WEST_1,
status=status,
ec2_status="ENABLED",
ecr_status="ENABLED",
lambda_status="ENABLED",
lambda_code_status="ENABLED",
findings=findings,
)
def build_finding(vulnerability_id=KEV_ID):
return Finding(
arn=FINDING_ARN,
type="PACKAGE_VULNERABILITY",
severity="CRITICAL",
first_observed_at=datetime.now(timezone.utc),
vulnerability_id=vulnerability_id,
resource_ids=["i-0123456789abcdef0"],
)
def build_kev(date_due):
return KnownExploitedVulnerability(
id=KEV_ID,
date_added=datetime(2024, 4, 12, tzinfo=timezone.utc),
date_due=date_due,
)
def execute_check(inspectors, known_exploited=None, lookup_failed=None):
inspector2_client = mock.MagicMock()
inspector2_client.inspectors = inspectors
inspector2_client.known_exploited_vulnerabilities = known_exploited or {}
inspector2_client.vulnerability_lookup_failed = lookup_failed or set()
with (
mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_aws_provider([AWS_REGION_EU_WEST_1]),
),
mock.patch(f"{CHECK_MODULE}.inspector2_client", new=inspector2_client),
):
from prowler.providers.aws.services.inspector2.inspector2_active_findings_kev_within_due_date.inspector2_active_findings_kev_within_due_date import (
inspector2_active_findings_kev_within_due_date,
)
return inspector2_active_findings_kev_within_due_date().execute()
class Test_inspector2_active_findings_kev_within_due_date:
def test_no_resources(self):
assert execute_check([]) == []
def test_inspector_disabled(self):
assert execute_check([build_inspector(findings=[], status="DISABLED")]) == []
def test_kev_past_due_date(self):
result = execute_check(
[build_inspector(findings=[build_finding()])],
known_exploited={
KEV_ID: build_kev(datetime(2024, 4, 19, tzinfo=timezone.utc))
},
)
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Inspector2 has active findings in region {AWS_REGION_EU_WEST_1} for CISA Known Exploited Vulnerabilities past their remediation due date: {KEV_ID} (due 2024-04-19)."
)
assert result[0].resource_id == "Inspector2"
assert result[0].resource_arn == INSPECTOR_ARN
assert result[0].region == AWS_REGION_EU_WEST_1
def test_kev_within_due_date(self):
result = execute_check(
[build_inspector(findings=[build_finding()])],
known_exploited={
KEV_ID: build_kev(datetime.now(timezone.utc) + timedelta(days=7))
},
)
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Inspector2 has no active findings in region {AWS_REGION_EU_WEST_1} for CISA Known Exploited Vulnerabilities past their remediation due date."
)
def test_no_kev_findings(self):
result = execute_check(
[build_inspector(findings=[build_finding("CVE-2022-40897")])]
)
assert len(result) == 1
assert result[0].status == "PASS"
def test_kev_status_not_verified(self):
result = execute_check(
[build_inspector(findings=[build_finding()])],
lookup_failed={KEV_ID},
)
assert len(result) == 1
assert result[0].status == "MANUAL"
def test_findings_not_retrieved(self):
result = execute_check([build_inspector(findings=None)])
assert len(result) == 1
assert result[0].status == "MANUAL"
@@ -1,149 +0,0 @@
from datetime import datetime, timezone
from unittest import mock
from prowler.providers.aws.services.inspector2.inspector2_service import (
Finding,
Inspector,
KnownExploitedVulnerability,
)
from tests.providers.aws.utils import (
AWS_ACCOUNT_NUMBER,
AWS_REGION_EU_WEST_1,
set_mocked_aws_provider,
)
INSPECTOR_ARN = (
f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:inspector2"
)
FINDING_ARN = f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:finding/0e436649379db5f327e3cf5bb4421d76"
KEV_ID = "CVE-2024-3400"
CHECK_MODULE = "prowler.providers.aws.services.inspector2.inspector2_active_findings_no_known_exploited_vulnerabilities.inspector2_active_findings_no_known_exploited_vulnerabilities"
def build_inspector(findings=None, status="ENABLED"):
return Inspector(
id="Inspector2",
arn=INSPECTOR_ARN,
region=AWS_REGION_EU_WEST_1,
status=status,
ec2_status="ENABLED",
ecr_status="ENABLED",
lambda_status="ENABLED",
lambda_code_status="ENABLED",
findings=findings,
)
def build_finding(vulnerability_id):
return Finding(
arn=FINDING_ARN,
type="PACKAGE_VULNERABILITY",
severity="CRITICAL",
first_observed_at=datetime.now(timezone.utc),
vulnerability_id=vulnerability_id,
resource_ids=["i-0123456789abcdef0"],
)
def build_kev(vulnerability_id):
return KnownExploitedVulnerability(
id=vulnerability_id,
date_added=datetime(2024, 4, 12, tzinfo=timezone.utc),
date_due=datetime(2024, 4, 19, tzinfo=timezone.utc),
)
def execute_check(inspectors, known_exploited=None, lookup_failed=None):
inspector2_client = mock.MagicMock()
inspector2_client.inspectors = inspectors
inspector2_client.known_exploited_vulnerabilities = known_exploited or {}
inspector2_client.vulnerability_lookup_failed = lookup_failed or set()
with (
mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_aws_provider([AWS_REGION_EU_WEST_1]),
),
mock.patch(f"{CHECK_MODULE}.inspector2_client", new=inspector2_client),
):
from prowler.providers.aws.services.inspector2.inspector2_active_findings_no_known_exploited_vulnerabilities.inspector2_active_findings_no_known_exploited_vulnerabilities import (
inspector2_active_findings_no_known_exploited_vulnerabilities,
)
return inspector2_active_findings_no_known_exploited_vulnerabilities().execute()
class Test_inspector2_active_findings_no_known_exploited_vulnerabilities:
def test_no_resources(self):
assert execute_check([]) == []
def test_inspector_disabled(self):
assert execute_check([build_inspector(findings=[], status="DISABLED")]) == []
def test_no_kev_findings(self):
result = execute_check(
[build_inspector(findings=[build_finding("CVE-2022-40897")])]
)
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Inspector2 has no active findings in region {AWS_REGION_EU_WEST_1} for CISA Known Exploited Vulnerabilities."
)
assert result[0].resource_id == "Inspector2"
assert result[0].resource_arn == INSPECTOR_ARN
assert result[0].region == AWS_REGION_EU_WEST_1
def test_kev_finding(self):
result = execute_check(
[
build_inspector(
findings=[build_finding(KEV_ID), build_finding("CVE-2022-40897")]
)
],
known_exploited={KEV_ID: build_kev(KEV_ID)},
)
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Inspector2 has active findings in region {AWS_REGION_EU_WEST_1} for CISA Known Exploited Vulnerabilities: {KEV_ID}."
)
def test_many_kev_findings_are_truncated(self):
vulnerability_ids = [f"CVE-2024-{number:04d}" for number in range(1, 13)]
result = execute_check(
[
build_inspector(
findings=[build_finding(vid) for vid in vulnerability_ids]
)
],
known_exploited={vid: build_kev(vid) for vid in vulnerability_ids},
)
assert result[0].status == "FAIL"
assert result[0].status_extended.endswith("CVE-2024-0010 and 2 more.")
def test_kev_status_not_verified(self):
result = execute_check(
[build_inspector(findings=[build_finding(KEV_ID)])],
lookup_failed={KEV_ID},
)
assert len(result) == 1
assert result[0].status == "MANUAL"
assert (
result[0].status_extended
== f"Inspector2 could not verify the CISA Known Exploited Vulnerabilities status of {KEV_ID} in region {AWS_REGION_EU_WEST_1}; verify the inspector2:BatchGetFindingDetails permission."
)
def test_findings_not_retrieved(self):
result = execute_check([build_inspector(findings=None)])
assert len(result) == 1
assert result[0].status == "MANUAL"
assert (
result[0].status_extended
== f"Inspector2 findings could not be retrieved in region {AWS_REGION_EU_WEST_1}; verify the inspector2:ListFindings permission."
)
@@ -1,140 +0,0 @@
from datetime import datetime, timedelta, timezone
from unittest import mock
from prowler.providers.aws.services.inspector2.inspector2_service import (
Finding,
Inspector,
)
from tests.providers.aws.utils import (
AWS_ACCOUNT_NUMBER,
AWS_REGION_EU_WEST_1,
set_mocked_aws_provider,
)
INSPECTOR_ARN = (
f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:inspector2"
)
FINDING_ARN = f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:finding/0e436649379db5f327e3cf5bb4421d76"
CHECK_MODULE = "prowler.providers.aws.services.inspector2.inspector2_active_findings_within_max_age.inspector2_active_findings_within_max_age"
def build_inspector(findings=None, status="ENABLED"):
return Inspector(
id="Inspector2",
arn=INSPECTOR_ARN,
region=AWS_REGION_EU_WEST_1,
status=status,
ec2_status="ENABLED",
ecr_status="ENABLED",
lambda_status="ENABLED",
lambda_code_status="ENABLED",
findings=findings,
)
def build_finding(age_days):
first_observed_at = (
datetime.now(timezone.utc) - timedelta(days=age_days, hours=1)
if age_days is not None
else None
)
return Finding(
arn=FINDING_ARN,
type="PACKAGE_VULNERABILITY",
severity="HIGH",
first_observed_at=first_observed_at,
vulnerability_id="CVE-2022-40897",
resource_ids=["i-0123456789abcdef0"],
)
def execute_check(inspectors, audit_config=None):
inspector2_client = mock.MagicMock()
inspector2_client.inspectors = inspectors
inspector2_client.audit_config = audit_config or {}
with (
mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_aws_provider([AWS_REGION_EU_WEST_1]),
),
mock.patch(f"{CHECK_MODULE}.inspector2_client", new=inspector2_client),
):
from prowler.providers.aws.services.inspector2.inspector2_active_findings_within_max_age.inspector2_active_findings_within_max_age import (
inspector2_active_findings_within_max_age,
)
return inspector2_active_findings_within_max_age().execute()
class Test_inspector2_active_findings_within_max_age:
def test_no_resources(self):
assert execute_check([]) == []
def test_inspector_disabled(self):
assert execute_check([build_inspector(findings=[], status="DISABLED")]) == []
def test_no_active_findings(self):
result = execute_check([build_inspector(findings=[])])
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Inspector2 has no active findings in region {AWS_REGION_EU_WEST_1} first observed more than 192 days ago."
)
assert result[0].resource_id == "Inspector2"
assert result[0].resource_arn == INSPECTOR_ARN
assert result[0].region == AWS_REGION_EU_WEST_1
def test_recent_findings(self):
result = execute_check([build_inspector(findings=[build_finding(30)])])
assert len(result) == 1
assert result[0].status == "PASS"
def test_stale_findings(self):
result = execute_check(
[
build_inspector(
findings=[
build_finding(30),
build_finding(200),
build_finding(400),
]
)
]
)
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Inspector2 has 2 active findings in region {AWS_REGION_EU_WEST_1} first observed more than 192 days ago, the oldest 400 days ago."
)
def test_finding_just_over_max_age(self):
result = execute_check([build_inspector(findings=[build_finding(192)])])
assert len(result) == 1
assert result[0].status == "FAIL"
def test_custom_max_age(self):
result = execute_check(
[build_inspector(findings=[build_finding(30)])],
audit_config={"inspector2_active_finding_max_age_days": 14},
)
assert len(result) == 1
assert result[0].status == "FAIL"
def test_finding_without_first_observed_date_is_ignored(self):
result = execute_check([build_inspector(findings=[build_finding(None)])])
assert len(result) == 1
assert result[0].status == "PASS"
def test_findings_not_retrieved(self):
result = execute_check([build_inspector(findings=None)])
assert len(result) == 1
assert result[0].status == "MANUAL"
@@ -1,170 +0,0 @@
from datetime import datetime, timedelta, timezone
from unittest import mock
from prowler.providers.aws.services.inspector2.inspector2_service import (
CoveredResource,
Inspector,
)
from tests.providers.aws.utils import (
AWS_ACCOUNT_NUMBER,
AWS_REGION_EU_WEST_1,
set_mocked_aws_provider,
)
INSPECTOR_ARN = (
f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:inspector2"
)
INSTANCE_ID = "i-0123456789abcdef0"
INSTANCE_ARN = (
f"arn:aws:ec2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:instance/{INSTANCE_ID}"
)
CHECK_MODULE = "prowler.providers.aws.services.inspector2.inspector2_coverage_recently_scanned.inspector2_coverage_recently_scanned"
def build_inspector(coverage=None, status="ENABLED"):
return Inspector(
id="Inspector2",
arn=INSPECTOR_ARN,
region=AWS_REGION_EU_WEST_1,
status=status,
ec2_status="ENABLED",
ecr_status="ENABLED",
lambda_status="ENABLED",
lambda_code_status="ENABLED",
coverage=coverage,
)
def build_instance(
days_since_scan=None, scan_status_code="ACTIVE", scan_status_reason="SUCCESSFUL"
):
last_scanned_at = (
datetime.now(timezone.utc) - timedelta(days=days_since_scan, hours=1)
if days_since_scan is not None
else None
)
return CoveredResource(
id=INSTANCE_ID,
arn=INSTANCE_ARN,
region=AWS_REGION_EU_WEST_1,
resource_type="AWS_EC2_INSTANCE",
scan_type="PACKAGE",
scan_status_code=scan_status_code,
scan_status_reason=scan_status_reason,
last_scanned_at=last_scanned_at,
)
def execute_check(inspectors, audit_config=None):
inspector2_client = mock.MagicMock()
inspector2_client.inspectors = inspectors
inspector2_client.audit_config = audit_config or {}
with (
mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_aws_provider([AWS_REGION_EU_WEST_1]),
),
mock.patch(f"{CHECK_MODULE}.inspector2_client", new=inspector2_client),
):
from prowler.providers.aws.services.inspector2.inspector2_coverage_recently_scanned.inspector2_coverage_recently_scanned import (
inspector2_coverage_recently_scanned,
)
return inspector2_coverage_recently_scanned().execute()
class Test_inspector2_coverage_recently_scanned:
def test_no_resources(self):
assert execute_check([]) == []
def test_inspector_disabled(self):
assert execute_check([build_inspector(status="DISABLED", coverage=[])]) == []
def test_recently_scanned_resource(self):
result = execute_check([build_inspector(coverage=[build_instance(1)])])
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"AWS_EC2_INSTANCE {INSTANCE_ID} was last scanned by Inspector2 within the last 3 days."
)
assert result[0].resource_id == INSTANCE_ID
assert result[0].resource_arn == INSTANCE_ARN
assert result[0].region == AWS_REGION_EU_WEST_1
def test_stale_resource(self):
result = execute_check([build_inspector(coverage=[build_instance(10)])])
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"AWS_EC2_INSTANCE {INSTANCE_ID} was last scanned by Inspector2 more than 3 days ago."
)
def test_resource_scanned_just_over_max_days(self):
result = execute_check([build_inspector(coverage=[build_instance(3)])])
assert len(result) == 1
assert result[0].status == "FAIL"
def test_custom_max_days(self):
result = execute_check(
[build_inspector(coverage=[build_instance(10)])],
audit_config={"inspector2_max_days_since_last_scan": 14},
)
assert len(result) == 1
assert result[0].status == "PASS"
def test_resource_without_recorded_scan(self):
result = execute_check([build_inspector(coverage=[build_instance(None)])])
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"AWS_EC2_INSTANCE {INSTANCE_ID} has no recorded Inspector2 scan."
)
def test_pending_initial_scan_is_skipped(self):
assert (
execute_check(
[
build_inspector(
coverage=[
build_instance(
None, scan_status_reason="PENDING_INITIAL_SCAN"
)
]
)
]
)
== []
)
def test_inactive_resource_is_skipped(self):
assert (
execute_check(
[
build_inspector(
coverage=[
build_instance(
10,
scan_status_code="INACTIVE",
scan_status_reason="NO_INVENTORY",
)
]
)
]
)
== []
)
def test_coverage_not_retrieved(self):
result = execute_check([build_inspector(coverage=None)])
assert len(result) == 1
assert result[0].status == "MANUAL"
assert result[0].resource_arn == INSPECTOR_ARN
@@ -1,132 +0,0 @@
from datetime import datetime, timezone
from unittest import mock
from prowler.providers.aws.services.inspector2.inspector2_service import (
CoveredResource,
Inspector,
)
from tests.providers.aws.utils import (
AWS_ACCOUNT_NUMBER,
AWS_REGION_EU_WEST_1,
set_mocked_aws_provider,
)
INSPECTOR_ARN = (
f"arn:aws:inspector2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:inspector2"
)
INSTANCE_ID = "i-0123456789abcdef0"
INSTANCE_ARN = (
f"arn:aws:ec2:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:instance/{INSTANCE_ID}"
)
CHECK_MODULE = "prowler.providers.aws.services.inspector2.inspector2_coverage_scan_status_active.inspector2_coverage_scan_status_active"
def build_inspector(status="ENABLED", coverage=None):
return Inspector(
id="Inspector2",
arn=INSPECTOR_ARN,
region=AWS_REGION_EU_WEST_1,
status=status,
ec2_status="ENABLED",
ecr_status="ENABLED",
lambda_status="ENABLED",
lambda_code_status="ENABLED",
coverage=coverage,
)
def build_instance(scan_status_code, scan_status_reason):
return CoveredResource(
id=INSTANCE_ID,
arn=INSTANCE_ARN,
region=AWS_REGION_EU_WEST_1,
resource_type="AWS_EC2_INSTANCE",
scan_type="PACKAGE",
scan_status_code=scan_status_code,
scan_status_reason=scan_status_reason,
last_scanned_at=datetime.now(timezone.utc),
)
def execute_check(inspectors):
inspector2_client = mock.MagicMock()
inspector2_client.inspectors = inspectors
inspector2_client.audit_config = {}
with (
mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_aws_provider([AWS_REGION_EU_WEST_1]),
),
mock.patch(f"{CHECK_MODULE}.inspector2_client", new=inspector2_client),
):
from prowler.providers.aws.services.inspector2.inspector2_coverage_scan_status_active.inspector2_coverage_scan_status_active import (
inspector2_coverage_scan_status_active,
)
return inspector2_coverage_scan_status_active().execute()
class Test_inspector2_coverage_scan_status_active:
def test_no_resources(self):
assert execute_check([]) == []
def test_inspector_disabled(self):
assert execute_check([build_inspector(status="DISABLED", coverage=[])]) == []
def test_no_covered_resources(self):
assert execute_check([build_inspector(coverage=[])]) == []
def test_active_resource(self):
result = execute_check(
[build_inspector(coverage=[build_instance("ACTIVE", "SUCCESSFUL")])]
)
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Inspector2 is actively scanning AWS_EC2_INSTANCE {INSTANCE_ID}."
)
assert result[0].resource_id == INSTANCE_ID
assert result[0].resource_arn == INSTANCE_ARN
assert result[0].region == AWS_REGION_EU_WEST_1
def test_inactive_resource(self):
result = execute_check(
[
build_inspector(
coverage=[build_instance("INACTIVE", "UNMANAGED_EC2_INSTANCE")]
)
]
)
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Inspector2 is not scanning AWS_EC2_INSTANCE {INSTANCE_ID}: UNMANAGED_EC2_INSTANCE."
)
assert result[0].resource_id == INSTANCE_ID
def test_not_applicable_resource_is_skipped(self):
assert (
execute_check(
[
build_inspector(
coverage=[build_instance("INACTIVE", "EC2_INSTANCE_STOPPED")]
)
]
)
== []
)
def test_coverage_not_retrieved(self):
result = execute_check([build_inspector(coverage=None)])
assert len(result) == 1
assert result[0].status == "MANUAL"
assert (
result[0].status_extended
== f"Inspector2 coverage could not be retrieved in region {AWS_REGION_EU_WEST_1}; verify the inspector2:ListCoverage permission."
)
assert result[0].resource_arn == INSPECTOR_ARN

Some files were not shown because too many files have changed in this diff Show More