Skip to content

Commit aedaa19

Browse files
authored
feat: add aws lint iam policies workflow (#187)
1 parent d9eda34 commit aedaa19

2 files changed

Lines changed: 64 additions & 20 deletions

File tree

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