Skip to content

Commit

Permalink
SARIF Example (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvassallo committed Mar 25, 2024
1 parent b014d90 commit 8537ff1
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
28 changes: 27 additions & 1 deletion ATTRIBUTION
Original file line number Diff line number Diff line change
Expand Up @@ -1970,4 +1970,30 @@ mikepenz/action-junit-report
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

--

github/codeql-action/upload-sarif

MIT License

Copyright (c) 2020 GitHub

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,22 @@ Guard is great for CI checks with the Junit output format, making the process of
### GitHub Actions
#### Junit
![GitHub Actions](images/github.png)
[Get the template here!](https://github.com/aws-cloudformation/cloudformation-guard/tree/main/guard-examples/ci/.github/junit-test-and-validate.yml)
[Get the template here!](https://github.com/aws-cloudformation/cloudformation-guard/tree/main/guard-examples/ci/.github/workflows/junit-test-and-validate.yml)
#### SARIF
![GitHub Actions](images/sarif-gh.png)
[Get the template here!](https://github.com/aws-cloudformation/cloudformation-guard/tree/main/guard-examples/ci/.github/workflows/sarif-validate.yml)
### CircleCI
#### Junit
![CircleCI](images/circleci.png)
[Get the template here!](https://github.com/aws-cloudformation/cloudformation-guard/tree/main/guard-examples/ci/.circleci/config.yml)
Expand Down
25 changes: 25 additions & 0 deletions guard-examples/ci/.github/workflows/sarif-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# NOTE: You must enable code scanning and analysis on your repository
name: "cfn-guard SARIF analysis"

on:
push:
schedule:
- cron: '45 15 * * 4'

jobs:
sarif:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/aws-cloudformation/cloudformation-guard:latest
permissions:
security-events: write
actions: read
contents: read
steps:
- uses: actions/checkout@v4
- name: Run cfn-guard
# Replace these paths with your own
run: /usr/src/cloudformation-guard/cfn-guard validate -r ./path/to/rules/directory_or_file/ -d ./path/to/data/directory_or_file/ --output-format sarif --show-summary none --structured > results.sarif || true
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
Binary file added images/sarif-gh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8537ff1

Please sign in to comment.