This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from scmn-dev/main
merge with `abdfnx/secman` fork repo
- Loading branch information
Showing
54 changed files
with
2,142 additions
and
1,577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
zshrc text eol=lf | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: Secman CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
|
||
jobs: | ||
bfs: # build from source | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Set up `Task` | ||
uses: arduino/setup-task@v1 | ||
|
||
- name: Building From Source | ||
run: task bfs | ||
|
||
- name: Run Help | ||
run: secman help | ||
|
||
bfs_windows: # build from source (windows) | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Set up `Task` | ||
uses: arduino/setup-task@v1 | ||
|
||
- name: Building From Source | ||
run: | | ||
task build-core | ||
task link-core | ||
.\scripts\bfs.ps1 | ||
echo "::add-path::C:\Users\runneradmin\AppData\Local\secman\bin\;" | ||
- name: Show Information | ||
run: secman info | ||
|
||
from_script: | ||
needs: [ bfs ] | ||
|
||
strategy: | ||
matrix: | ||
oses: [ macos-latest, ubuntu-latest ] | ||
|
||
runs-on: ${{ matrix.oses }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install from script | ||
run: curl -sL https://u.secman.dev | bash | ||
|
||
- name: Generate a password | ||
run: secman generate --length 20 | ||
|
||
from_script_windows: | ||
needs: [ bfs_windows ] | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install from script | ||
run: | | ||
iwr -useb https://w.secman.dev | iex | ||
echo "::add-path::C:\Users\runneradmin\AppData\Local\secman\bin\;" | ||
- name: Run Secman Doctor | ||
run: secman doctor | ||
|
||
homebrew: | ||
needs: [ bfs ] | ||
|
||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get Secman via homebrew | ||
run: brew install scmn-dev/tap/secman | ||
|
||
- name: Show Version | ||
run: secman version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Secman Docker CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
SM_DOCKER_REPO: https://github.com/scmn-dev/docker | ||
SM_CONTAINER_DH_IMAGE: smcr/secman | ||
SM_CONTAINER_GHCR_IMAGE: ghcr.io/scmn-dev/secman | ||
SM_CLI_IMAGE: smcr/secman-cli | ||
|
||
jobs: | ||
# Secman Container Docker Image `smcr/secman` | DockerHub | ||
sm_container_build_dh: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_ID }} | ||
password: ${{ secrets.DOCKER_SECMAN_TOKEN }} | ||
|
||
- name: Run Build | ||
run: | | ||
docker pull $SM_CONTAINER_DH_IMAGE:latest | ||
git clone $SM_DOCKER_REPO | ||
docker build -t $SM_CONTAINER_DH_IMAGE --cache-from $SM_CONTAINER_DH_IMAGE:latest --file ./docker/container/Dockerfile . | ||
docker push $SM_CONTAINER_DH_IMAGE | ||
sm_container_run_dh: | ||
needs: [ sm_container_build_dh ] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: smcr/secman:latest | ||
|
||
steps: | ||
- name: Run Secman in Docker Container | ||
run: | | ||
sudo secman | ||
# Secman Container Docker Image `smcr/secman` | GitHub Packages | ||
sm_container_build_ghcr: | ||
needs: [ sm_container_build_dh ] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to Github Packages | ||
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
|
||
- name: Run Build | ||
run: | | ||
docker pull $SM_CONTAINER_GHCR_IMAGE:latest | ||
git clone $SM_DOCKER_REPO | ||
docker build -t $SM_CONTAINER_GHCR_IMAGE --cache-from $SM_CONTAINER_GHCR_IMAGE:latest --file ./docker/container/Dockerfile . | ||
docker push $SM_CONTAINER_GHCR_IMAGE | ||
sm_container_run_ghcr: | ||
needs: [ sm_container_build_ghcr ] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: ghcr.io/scmn-dev/secman:latest | ||
|
||
steps: | ||
- name: Run Secman in Github Docker Container | ||
run: | | ||
sudo secman | ||
# Secman CLI Docker Image `smcr/secman-cli` | ||
sm_cli_build: | ||
needs: [ sm_container_build_dh, sm_container_run_dh, sm_container_build_ghcr, sm_container_run_ghcr ] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_ID }} | ||
password: ${{ secrets.DOCKER_SECMAN_TOKEN }} | ||
|
||
- name: Build Secman CLI | ||
run: | | ||
docker pull $SM_CLI_IMAGE:latest | ||
git clone $SM_DOCKER_REPO | ||
docker build -t $SM_CLI_IMAGE --cache-from $SM_CLI_IMAGE:latest --file ./docker/cli/Dockerfile . | ||
docker push $SM_CLI_IMAGE | ||
sm_cli_run: | ||
needs: [ sm_cli_build ] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run Secman CLI in Docker Container | ||
run: | | ||
# run `secman` | ||
docker run --rm -i $SM_CLI_IMAGE | ||
# run `secman version` | ||
docker run --rm -i $SM_CLI_IMAGE -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ release: | |
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
- go mod tidy -compat=1.17 | ||
|
||
builds: | ||
- <<: &build_defaults | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.