GitHub
GitHub is a platform for hosting source code and versioned files using Git.It allows programmers, utilities or any registered user on the platform to contribute on private or Open Source projects from anywhere in the world.
Through GitHub Actions it is possible to automate, customize and execute software development workflows directly in the repository.
With the senhasegura GitHub, it is possible to intercept all the environment variables and inject the secrets directly into the pipelines during the automation execution step without the need to expose the secrets.
Installing GitHub plugin
To install the senhasegura GitHub plugin you need a Client ID and a Client Secret for API authentication. To create an access key, follow the steps described dsm-register-auth and dsm-view-auth sections of this manual.
Access a project in your GitHub account;
Add the binary and the
senhasegura-mapping.json
file into the project repository;infoThe
senhasegura-mapping.json
can be used to report the senhasegura DSM which variable should be registered as secrets.Edit the
cicd.yml
config file, located at<project_name>/.github/workflows/
into your project directory;At section jobs ➔build ➔steps, add the following source code:
- name: senhasegura
env:
APP: ${{ secrets.APP }}
SYSTEM: ${{ secrets.SYSTEM }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
SENHASEGURA_URL: ${{ secrets.SENHASEGURA_URL }}
SENHASEGURA_CLIENT_ID: ${{ secrets.SENHASEGURA_CLIENT_ID }}
SENHASEGURA_CLIENT_SECRET: ${{ secrets.SENHASEGURA_CLIENT_SECRET }}
run: |
chmod +x senhasegura
./senhasegura $APP $SYSTEM $ENVIRONMENT
source .runb.vars
rm .runb.varsSave the file;
Access the senhasegura Settings ➔ Secrets menu;
Register the following variables: APP, ENVIRONMENT, SYSTEM, SENHASEGURA_URL, SENHASEGURA_CLIENT_ID and SENHASEGURA_CLIENT_SECRET;
At the end, execute the GitHub workflow;
The variables APP
, ENVIRONMENT
and SYSTEM
are used into senhasegura DSM to identify which application is running and which is its environment and system.
GitHub pipeline' secrets injection
After installing the plugin into a project, follow the steps bellow to inject secrets into pipeline:
Click the Actions menu;
Select the desired workflow;
Click at Run workflow section and into Run workflow button;
When the workflow finish its running, click at Build button to display the result;