Skip to content

Implement queries for authentication / authorization related issues #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 82 commits into from
Aug 12, 2024

Conversation

jeongsoolee09
Copy link
Contributor

@jeongsoolee09 jeongsoolee09 commented Apr 12, 2024

What this PR contributes

Queries

This PR contributes three queries:

  1. DefaultUserIsPrivileged.ql
  2. EntityExposedWithoutAuthn.ql
  3. NonProductionStrategyUsed.ql

DefaultUserIsPrivileged.ql

Addresses #107's misused-privilged-user/default-is-privileged PoC.

EntityExposedWithoutAuthn.ql

Addresses #107's entities-with-no-authn PoC.

NonProductionStrategyUsed.ql

Addresses #107's nonprod-authn-strategy PoC.

Libraries

  • Thoroughly debugged CqlClause in CQL.qll.
  • Improved and added more classes to CDS.qll.
    • Better handling of global variable definitions using type tracker.
    • Added classes on cds.user and privileged users.
    • Added classes on transactions.
    • Classes now also capture await expressions as well as their non-await expressions.
  • Added Conditionals.qll to find expressions and statements that act as conditionals.
  • Added more classes to PackageJson.qll.

Tests

  • Added model tests on authz-annotations, conditionalstatements.
  • Added model tests on entityreference where the entity resolving mechanism is tested.

Future Work

@jeongsoolee09 jeongsoolee09 marked this pull request as ready for review July 29, 2024 21:59
@jeongsoolee09 jeongsoolee09 requested a review from mbaluda July 29, 2024 21:59
@mbaluda mbaluda assigned mbaluda and unassigned mbaluda Jul 30, 2024
Copy link
Contributor

@mbaluda mbaluda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of thoughts:

  • Remove dynamically-generated-privileged and dependencies if it's not in scope right now
  • DefaultUserIsPrivileged should be a path-preoblem
  • EntityExposedWithoutAuthn missing description
  • EntityExposedWithoutAuthn do not repeat the primary location link

@jeongsoolee09 jeongsoolee09 requested a review from mbaluda August 9, 2024 18:01
Copy link
Contributor

@mbaluda mbaluda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jeongsoolee09 jeongsoolee09 merged commit 6d548c0 into main Aug 12, 2024
9 checks passed
@jeongsoolee09 jeongsoolee09 deleted the jeongsoolee09/auth-queries branch August 12, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants