Semgrep
What is Semgrep
Semgrep: An application security solution that combines SAST, SCA, and secret detection.
Preparation
The following placeholders will be used:
authentik.company
is the FQDN of the authentik install.devcompany
is the organization name on Semgrep Cloud platform.
authentik configuration
- Log in to your authentik instance as an administrator.
- Go to the admin interface.
- Navigate to Customization -> Property mappings.
- Create a new SAML property mapping with these parameters:
- Name:
semgrep-name
- SAML Attribute name:
name
- Expression:
return request.user.name
- Name:
- Create another SAML property mapping with these parameters:
- Name:
semgrep-email
- SAML Attribute name:
email
- Expression:
return request.user.email
- Name:
- Navigate to System -> Certificates.
- Generate a new RSA certificate.
- Download the generated certificate, as you will need it later.
- Create a new SAML provider under Applications -> Providers using the following settings:
- ACS URL:
https://semgrep.dev/api/auth/saml/devcompany/
- Issuer:
https://authentik.company
- Audience:
semgrep-dev
- Service Provider Binding:
Post
- Signing Keypair: Choose the RSA certificate you generated earlier.
- Property mappings:
semgrep-name
andsemgrep-email
- ACS URL:
- Create a new application under Applications -> Applications, pick a name and a slug, and assign the provider that you just created.
Semgrep configuration
- Log in to Semgrep Cloud platform as an administrator.
- Click Settings on bottom left corner.
- Navigate to Access -> Login methods.
- Locate Single sign-on entry, click Add SSO configuration, select SAML2 SSO from the drop down.
- Fill in the following:
- Display name: Anything you like.
- Email domain:
company
- IdP SSO URL:
https://authentik.company/application/saml/<semgrep slug>/sso/binding/post/
- IdP Issuer ID:
https://authentik.company
- Upload/paste certificate: Downloaded from the previous step.
Verification
- Open an Incognito window and navigate to
https://semgrep.dev/login
- Click Use SSO on the login screen.
- Enter the email address associated with the domain you provided earlier.
- Log in to authentik.
- You will be redirected to the home screen of Semgrep Cloud platform.