- On a single project’s Details page in Semgrep AppSec Platform.
- On multiple projects at once from the Projects page in Semgrep AppSec Platform.
- Through the Semgrep API.
- In your repository’s
.semgrepconfig.ymlfile.
Tag a project in Semgrep AppSec Platform
To add or remove tags on one project, follow these steps:1
Sign in to Semgrep AppSec Platform and go to the Projects page.
2
Find the project you want to modify, then click its icon under Details.
3
Click the Settings tab.
4
Add or remove tags in the Tags section.
5
Click Save.
Edit tags for multiple projects
You can add, remove, or replace tags on several projects at once from the Projects page.Prerequisites
- You have permission to manage project settings for every project you select. If any selected project lacks this permission or is pending deletion, Edit tags is unavailable.
1
Sign in to Semgrep AppSec Platform and go to the Projects page.
2
Select the checkbox next to each project you want to edit.
3
Click Edit (N selected), then click Edit tags. The Edit tags dialog appears.
4
Choose Add tags or Replace all. The two modes work differently. For more information, see Add tags mode and Replace all mode.
5
Update the tags in the Tags box.
6
Review every tag in the Tags box, including tags you didn’t add.
7
Click Apply on N projects. A notification confirms the number of projects that Semgrep updated.
Add tags mode
The Edit tags dialog opens in Add tags mode. The Tags box is pre-filled with every tag applied to any selected project, even if only one project has that tag. In Add tags mode:- A tag you add to the Tags box applies to all selected projects.
- A pre-filled tag that you leave in the Tags box stays only on the projects that already have it. Semgrep doesn’t add it to the other selected projects.
- A pre-filled tag that you remove from the Tags box is removed from every selected project that has it. This happens whether you click the tag’s X or clear its checkbox in the dropdown.
- A pre-filled tag that you remove and then add back counts as a new tag, so it applies to all selected projects. To undo a removal, click Cancel and reopen the Edit tags dialog.
Replace all mode
In Replace all mode, the tags in the Tags box become the complete set of tags for every selected project. Semgrep removes any existing tag that isn’t in the Tags box from all selected projects. When you switch to Replace all, Semgrep clears the Tags box. If the selected projects have existing tags, Semgrep asks you to confirm the switch and lists any policies the projects leave as a result.Tags with special behavior
- Semgrep-managed tags, such as
managed-scan, stay on each project in both modes. You can’t remove them from the Edit tags dialog. - Tags marked with a shield icon control policy membership. Adding or removing one of these tags adds the selected projects to, or removes them from, the linked policies. Semgrep asks you to confirm the change.
- The dialog shows the maximum number of tags a project can have. You can’t apply a change that puts any selected project over that limit.
Set tags through the API
To add tags to one project without removing its existing tags, see Add tags to project. To replace a project’s tags, see Update project details. To edit tags on multiple projects, see Bulk edit selected projects and Bulk edit projects by filter. These endpoints are experimental and subject to change.Set tags in .semgrepconfig.yml
To set tags in your repository, follow these steps:
1
Create a
.semgrepconfig.yml file in the root directory of your repository.2
Add your tags to the file. For example:
.semgrepconfig.yml apply only during full scans, and appear on the Projects page after the next full scan. Changes you make on the Projects page don’t update .semgrepconfig.yml, and the next full scan overwrites them.