Skip to content

Commit c4a5449

Browse files
ci: add pre-commit check ensuring FIPS compliance
this commit adds a new pre-commit hook to scan for non-FIPS compliant function usage within llama-stack Assisted-by: claude-4-sonnet Signed-off-by: Nathan Weinberg <[email protected]>
1 parent 471b1b2 commit c4a5449

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.pre-commit-config.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ repos:
153153
files: ^src/llama_stack/ui/.*\.(ts|tsx)$
154154
pass_filenames: false
155155
require_serial: true
156-
157156
- id: check-log-usage
158157
name: Ensure 'llama_stack.log' usage for logging
159158
entry: bash
@@ -172,7 +171,22 @@ repos:
172171
exit 1
173172
fi
174173
exit 0
175-
174+
- id: fips-compliance
175+
name: Ensure llama-stack remains FIPS compliant
176+
entry: bash
177+
language: system
178+
types: [python]
179+
pass_filenames: true
180+
args:
181+
- -c
182+
- |
183+
grep -EnH '^[^#]*\b(md5|sha1|uuid3|uuid5)\b' "$@" && {
184+
echo;
185+
echo "❌ Do not use any of the following functions: hashlib.md5, hashlib.sha1, uuid.uuid3, uuid.uuid5"
186+
echo " These functions are not FIPS-compliant"
187+
echo;
188+
exit 1;
189+
} || true
176190
ci:
177191
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
178192
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate

0 commit comments

Comments
 (0)