Skip to content

[BUG] (pdk-nag) AthenaWorkgroupEncryptedQueryResults and CodeBuildProjectPrivilegedModeDisabled no longer exist in cdk-nag #883

@v41e

Description

@v41e

Describe the bug

In cdk-nag v2.33.0 AthenaWorkgroupEncryptedQueryResults and CodeBuildProjectPrivilegedModeDisabled were removed

So using latest version of pdk and cdk-nag and by running following command:

pdk && pdk upgrade && pdk upgrade-deps

I got this error:

...
👾 default | ts-node --project tsconfig.dev.json .projenrc.ts
/.../node_modules/.pnpm/@aws+pdk@0.25.7_@aws-cdk+aws-cognito-identitypool-alpha@2.167.0-alpha.0_aws-cdk-lib@2.167.0_c_k2jrqqhs4n5ovprdipk3teqyhe/node_modules/@aws/pdk/pdk-nag/packs/aws-prototyping-rules.ts:42
    rule: rules.athena.AthenaWorkgroupEncryptedQueryResults,
                       ^
TypeError: Cannot read properties of undefined (reading 'AthenaWorkgroupEncryptedQueryResults')
...

Expected Behavior

Current Behavior

Reproduction Steps

Just make a new project with pdk-nag and cdk-nag and have an entrypoint like following:

main.ts

import { PDKNag } from '@aws/pdk/pdk-nag'
import { AwsSolutionsChecks } from 'cdk-nag'

;(async () => {
  const app = PDKNag.app({
    failOnError: true,
    failOnWarning: true,
    nagPacks: [new AwsSolutionsChecks({ verbose: true, reports: true })],
  })

  ...

  app.synth()
})().catch((error) => {
  console.error(error)
  process.exit(1)
})

Possible Solution

Remove

  {
    info: "The Athena workgroup does not encrypt query results.",
    explanation:
      "Encrypting query results stored in S3 helps secure data to meet compliance requirements for data-at-rest encryption.",
    level: NagMessageLevel.WARN,
    rule: rules.athena.AthenaWorkgroupEncryptedQueryResults,
  },
  {
    info: "The CodeBuild project has privileged mode enabled.",
    explanation:
      "Privileged grants elevated rights to the system, which introduces additional risk. Privileged mode should only be set to true only if the build project is used to build Docker images. Otherwise, a build that attempts to interact with the Docker daemon fails.",
    level: NagMessageLevel.WARN,
    rule: rules.codebuild.CodeBuildProjectPrivilegedModeDisabled,
  },
  • similar traces in test files

Additional Information/Context

No response

PDK version used

v0.25.7

What languages are you seeing this issue on?

Typescript

Environment details (OS name and version, etc.)

macOS 15.0.1, apple m1 pro, node 20.18.0, pnpm 8.15.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions