Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docker-ci
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UNL ITS
docker-ci
Commits
3094f8d1
Commit
3094f8d1
authored
5 years ago
by
Jose Raul Barreras
Browse files
Options
Downloads
Patches
Plain Diff
improve doc
parent
c4ca4056
No related branches found
Branches containing commit
No related tags found
4 merge requests
!34
develop to master
,
!18
sync dependency-check with secrets-detection
,
!17
Resolve "Add Dependency Check"
,
!16
Resolve "Add Automated Secrets Detection"
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
detect-secrets/Dockerfile
+1
-2
1 addition, 2 deletions
detect-secrets/Dockerfile
detect-secrets/entrypoint.sh
+24
-11
24 additions, 11 deletions
detect-secrets/entrypoint.sh
examples/Detect-Secrets.md
+11
-2
11 additions, 2 deletions
examples/Detect-Secrets.md
with
37 additions
and
16 deletions
README.md
+
1
−
1
View file @
3094f8d1
...
@@ -27,4 +27,4 @@ This file is automatically updated after execute `git commit` based on the conte
...
@@ -27,4 +27,4 @@ This file is automatically updated after execute `git commit` based on the conte
-
its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:python
-
its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:python
_Last update: Thu May 30 1
6:58:18
CDT 2019_
_Last update: Thu May 30 1
7:47:26
CDT 2019_
...
...
This diff is collapsed.
Click to expand it.
detect-secrets/Dockerfile
+
1
−
2
View file @
3094f8d1
...
@@ -20,7 +20,6 @@ RUN apk update && apk upgrade && \
...
@@ -20,7 +20,6 @@ RUN apk update && apk upgrade && \
COPY
entrypoint.sh /usr/local/bin/
COPY
entrypoint.sh /usr/local/bin/
RUN
chmod
+x /usr/local/bin/entrypoint.sh
RUN
chmod
+x /usr/local/bin/entrypoint.sh
#ENTRYPOINT ["/usr/local/bin/detect-secrets"]
ENTRYPOINT
["/usr/local/bin/entrypoint.sh"]
ENTRYPOINT
["/usr/local/bin/entrypoint.sh"]
CMD
["/usr/local/bin/detect-secrets"
, "scan"
]
CMD
["/usr/local/bin/detect-secrets"]
This diff is collapsed.
Click to expand it.
detect-secrets/entrypoint.sh
+
24
−
11
View file @
3094f8d1
#!/bin/sh
#!/bin/sh
set
-e
set
-e
OPT
=
""
ENTROPY
=
"4"
while
[
-n
"
$1
"
]
;
do
while
[
-n
"
$1
"
]
;
do
case
"
$1
"
in
case
"
$1
"
in
-s
)
-s
)
OUTPUT
=
`
/usr/local/bin/detect-secrets scan
`
OPT
=
"scan"
echo
${
OUTPUT
}
| jq
RESULT
=
`
echo
${
OUTPUT
}
| jq
'.results | length == 0'
`
if
[
"
${
RESULT
}
"
=
"true"
]
;
then
exit
0
else
exit
1
fi
;;
*
)
exec
/bin/sh
;;
;;
-e
)
shift
ENTROPY
=
"
$1
"
;;
*
)
echo
"Invalid parameter(s)"
echo
"Usage:"
echo
"docker run --rm -v "
${
PWD
}
:/work
" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s -e 3"
echo
""
exit
2
esac
esac
shift
shift
done
done
if
[
${
OPT
}
=
"scan"
]
;
then
OUTPUT
=
`
/usr/local/bin/detect-secrets scan
--base64-limit
${
ENTROPY
}
`
echo
${
OUTPUT
}
| jq
RESULT
=
`
echo
${
OUTPUT
}
| jq
'.results | length == 0'
`
if
[
"
${
RESULT
}
"
=
"true"
]
;
then
exit
0
else
exit
1
fi
fi
This diff is collapsed.
Click to expand it.
examples/Detect-Secrets.md
+
11
−
2
View file @
3094f8d1
# Secrets detection example
# Secrets detection example
## Parameters
| Argument | Description |
| :------- | :--------------------------- |
| -s | Scans the current directory |
| -e value | Entropy threshold (allowed randomness); Default value 4 |
## Detects secrets in the current project
## Detects secrets in the current project
-
One 'analysis' stage with one job
-
One 'analysis' stage with one job
```
yml
```
yml
stages
:
stages
:
-
analysis
-
analysis
...
@@ -11,5 +20,5 @@ variables:
...
@@ -11,5 +20,5 @@ variables:
tags
:
tags
:
-
docker
-
docker
script
:
script
:
-
docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s
-
docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s
-e 4.5
```
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment