Skip to content
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

Adding Next 10 cases for javascript DL. #91

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AksChaudhari
Copy link
Contributor

Added non compliant and compliant samples for javascript detectors.

Copy link
Contributor

@saurabh-amazon saurabh-amazon left a comment

Choose a reason for hiding this comment

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

Reviewed all changes. Changes look fine. Approved.

Comment on lines 1 to 17
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0

// {fact rule=javascript-jwt-exposed-credential@v1.0 defects=0}
const jwt = require('jsonwebtoken');

const payload = {
userId: '123456',
username: 'john_doe',
role: 'admin'
};

const secretKey = process.env.JWT_SECRET;

const token = jwt.sign(payload, secretKey, { expiresIn: '1h' });

console.log('Generated JWT:', token);
Copy link
Contributor

Choose a reason for hiding this comment

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

miss compliant comment and example look like Noncompliant

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.

3 participants