Skip to content

Commit f241424

Browse files
committed
feat: add aws lint iam policies workflow
1 parent d9eda34 commit f241424

2 files changed

Lines changed: 63 additions & 20 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint AWS IAM policies
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
directory:
7+
type: string
8+
required: true
9+
minimum_severity:
10+
type: string
11+
default: HIGH
12+
13+
jobs:
14+
# https://github.com/duo-labs/parliament
15+
lint_policies:
16+
runs-on: ubuntu-latest-arm64
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Setup python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
- name: Install dependencies
25+
run: |
26+
pip install parliament
27+
- name: Lint AWS IAM policies
28+
run: |
29+
parliament --directory ${{ inputs.directory }} --include_policy_extension json --minimum_severity ${{ inputs.minimum_severity }}

README.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -311,34 +311,20 @@ jobs:
311311
db_instance: my-instance-name
312312
```
313313

314-
### node-module-cache
314+
## IAM policy linter
315315

316-
This action handles `node_modules` caching after installing dependencies for javascript projects. This has to be called
317-
while merging a main branch so further GitHub action execution can benefit from this cache later on.
316+
This action will lint a directory containing IAM policies in JSON format.
318317

319318
```yaml
320-
---
321-
name: Update node_modules cache
322-
323-
on:
324-
push:
325-
branches:
326-
- master
327-
paths:
328-
- package-lock.json
329-
- package.json
330319
jobs:
331-
update_cache:
332-
uses: sencrop/github-workflows/.github/workflows/node_modules_cache-v1.yml@master
320+
db:
321+
uses: sencrop/github-workflows/.github/workflows/aws-iam-policy-lint-v1.yml@master
333322
secrets: inherit
334323
with:
335-
use_legacy_peer_deps: false
336-
use_ignore_scripts: true
324+
directory: policies/
325+
minimum_severity: MEDIUM
337326
```
338327

339-
Once the `node_modules` cache is filled in, it can be used later on to prevent unnecessary dependencies install
340-
operations (see [npm-ci-with-cache](README.md#npm-ci-with-cache)).
341-
342328
## Standard actions
343329

344330
Standard actions can be reused in any custom or standard workflows.
@@ -430,3 +416,31 @@ see [node-module-cache](README.md#node-module-cache)):
430416
use_legacy_peer_deps: false
431417
use_ignore_scripts: true
432418
```
419+
420+
### node-module-cache
421+
422+
This action handles `node_modules` caching after installing dependencies for javascript projects. This has to be called
423+
while merging a main branch so further GitHub action execution can benefit from this cache later on.
424+
425+
```yaml
426+
---
427+
name: Update node_modules cache
428+
429+
on:
430+
push:
431+
branches:
432+
- master
433+
paths:
434+
- package-lock.json
435+
- package.json
436+
jobs:
437+
update_cache:
438+
uses: sencrop/github-workflows/.github/workflows/node_modules_cache-v1.yml@master
439+
secrets: inherit
440+
with:
441+
use_legacy_peer_deps: false
442+
use_ignore_scripts: true
443+
```
444+
445+
Once the `node_modules` cache is filled in, it can be used later on to prevent unnecessary dependencies install
446+
operations (see [npm-ci-with-cache](README.md#npm-ci-with-cache)).

0 commit comments

Comments
 (0)