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

CodeQL Fixes #74

Merged
merged 5 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node

Check failure on line 1 in .github/workflows/node.js.yml

View workflow job for this annotation

GitHub Actions / security-check

CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
Expand All @@ -10,6 +10,28 @@
branches: [ "main" ]

jobs:
security-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkov GitHub Action
uses: bridgecrewio/checkov-action@v12
with:
# This will add both a CLI output to the console and create a results.sarif file
output_format: cli,sarif
output_file_path: console,results.sarif

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2

# Results are generated only on a success or failure
# this is required since GitHub by default won't run the next step
# when the previous one has failed. Security checks that do not pass will 'fail'.
# An alternative is to add `continue-on-error: true` to the previous step
# Or 'soft_fail: true' to checkov.
if: success() || failure()
with:
sarif_file: results.sarif
build:

runs-on: ubuntu-latest
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created

Check failure on line 1 in .github/workflows/npm-publish.yml

View workflow job for this annotation

GitHub Actions / security-check

CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: spectral-aws-apigateway-ruleset
Expand Down Expand Up @@ -56,23 +56,3 @@
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

# Removing publishing to GH for now, given that I've got a package already on npm
# publish-gpr:
# needs: build
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 16.x
# registry-url: https://npm.pkg.github.com/
# scope: '@andylockran'
# - run: npm i
# - run: npm run build
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
9 changes: 8 additions & 1 deletion examples/petstore_aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
type: string
additionalProperties: true
Pets:
type: array

Check failure on line 154 in examples/petstore_aws.yaml

View workflow job for this annotation

GitHub Actions / security-check

CKV_OPENAPI_21: "Ensure that arrays have a maximum number of items"
items:
$ref: '#/components/schemas/Pet'
Error:
Expand Down Expand Up @@ -193,4 +193,11 @@
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
$ref: '#/components/schemas/Error'
securitySchemes:
encryptedScheme:
type: oauth2

security:
- oauth2: []

6 changes: 3 additions & 3 deletions functions/draft4.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ var require_codegen = __commonJS({
var Else = class extends BlockNode {
};
Else.kind = "else";
var If = class extends BlockNode {
var If = class _If extends BlockNode {
constructor(condition, nodes) {
super(nodes);
this.condition = condition;
Expand All @@ -570,10 +570,10 @@ var require_codegen = __commonJS({
}
if (e) {
if (cond === false)
return e instanceof If ? e : e.nodes;
return e instanceof _If ? e : e.nodes;
if (this.nodes.length)
return this;
return new If(not(cond), e instanceof If ? [e] : e.nodes);
return new _If(not(cond), e instanceof _If ? [e] : e.nodes);
}
if (cond === false || !this.nodes.length)
return void 0;
Expand Down
Loading
Loading