Skip to content

Commit 2838f29

Browse files
committed
Initial commit
0 parents  commit 2838f29

File tree

14 files changed

+26615
-0
lines changed

14 files changed

+26615
-0
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test my typescript action
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-18.04
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
# - name: Test
17+
# run: npm run test
18+
19+
- name: Build
20+
run: npm run build
21+
22+
- name: Pull docker image
23+
run: docker pull alpine:3.10.3
24+
25+
- uses: ./
26+
with:
27+
token: ${{ github.GITHUB_TOKEN }}
28+
image: alpine:3.10.3

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
__tests__/runner/*
2+
3+
# comment out in distribution branches
4+
node_modules/
5+
6+
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
7+
# Logs
8+
logs
9+
*.log
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# Diagnostic reports (https://nodejs.org/api/report.html)
16+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
17+
18+
# Runtime data
19+
pids
20+
*.pid
21+
*.seed
22+
*.pid.lock
23+
24+
# Directory for instrumented libs generated by jscoverage/JSCover
25+
lib-cov
26+
27+
# Coverage directory used by tools like istanbul
28+
coverage
29+
*.lcov
30+
31+
# nyc test coverage
32+
.nyc_output
33+
34+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
35+
.grunt
36+
37+
# Bower dependency directory (https://bower.io/)
38+
bower_components
39+
40+
# node-waf configuration
41+
.lock-wscript
42+
43+
# Compiled binary addons (https://nodejs.org/api/addons.html)
44+
build/Release
45+
46+
# Dependency directories
47+
jspm_packages/
48+
49+
# TypeScript v1 declaration files
50+
typings/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional REPL history
62+
.node_repl_history
63+
64+
# Output of 'npm pack'
65+
*.tgz
66+
67+
# Yarn Integrity file
68+
.yarn-integrity
69+
70+
# dotenv environment variables file
71+
.env
72+
.env.test
73+
74+
# parcel-bundler cache (https://parceljs.org/)
75+
.cache
76+
77+
# next.js build output
78+
.next
79+
80+
# nuxt.js build output
81+
.nuxt
82+
83+
# vuepress build output
84+
.vuepress/dist
85+
86+
# Serverless directories
87+
.serverless/
88+
89+
# FuseBox cache
90+
.fusebox/
91+
92+
# DynamoDB Local files
93+
.dynamodb/

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2019 GitHub, Inc. and contributors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Gitrivy
2+
3+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/homoluctus/gitrivy?color=brightgreen)
4+
![GitHub](https://img.shields.io/github/license/homoluctus/gitrivy?color=brightgreen)
5+
6+
This is a GitHub Actions to scan vulnerability using [Trivy](https://github.com/aquasecurity/trivy).<br>
7+
8+
## Usage
9+
10+
## Example Workflow
11+
12+
Detect your docker image vulnerability everyday at 9:00 (UTC).
13+
14+
```yaml
15+
name: Vulnerability Scan
16+
17+
on:
18+
schedule:
19+
- cron: '0 9 * * *'
20+
21+
jobs:
22+
scan:
23+
name: Daily Vulnerability Scan
24+
runs-on: ubuntu-18.04
25+
steps:
26+
- name: Pull docker image
27+
run: docker pull sample
28+
29+
- uses: homoluctus/[email protected]
30+
with:
31+
image: sample
32+
```

action.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 'Scan docker image vulnerability using Trivy'
2+
description: 'Scan docker image vulnerability and create issue'
3+
author: 'homoluctus'
4+
inputs:
5+
token:
6+
description: 'GitHub access token'
7+
required: true
8+
trivy_version:
9+
description: 'Trivy version'
10+
default: 'latest'
11+
required: false
12+
image:
13+
description: 'The target image name of vulnerability scan'
14+
required: true
15+
severity:
16+
description: 'sevirities of vulunerabilities (separeted by commma)'
17+
default: 'HIGH,CRITICAL'
18+
required: false
19+
vuln_type:
20+
description: 'target vlunerability [os,library] (separeted by commma)'
21+
default: 'os,library'
22+
required: false
23+
ignore_unfixed:
24+
description: 'Ignore unfixed vulnerabilities [true, false]'
25+
default: 'false'
26+
required: false
27+
issue_title:
28+
description: 'Issue title'
29+
default: 'Security Alert'
30+
required: false
31+
issue_label:
32+
description: 'Issue label (separeted by commma)'
33+
default: 'trivy,vulnerability'
34+
required: false
35+
issue_assignee:
36+
description: 'Issue assignee (separeted by commma)'
37+
required: false
38+
39+
outputs:
40+
issue_number:
41+
description: 'The created issue number'
42+
html_url:
43+
description: 'The URL to view the issue'
44+
45+
runs:
46+
using: 'node12'
47+
main: 'dist/index.js'
48+
49+
branding:
50+
icon: 'search'
51+
color: 'blue'

0 commit comments

Comments
 (0)