Security Best Practices
Security is crucial when automating your Figma plugin deployment. This guide covers best practices to keep your deployment process secure.Credential Management
GitHub Secrets
Always store sensitive information in GitHub Secrets:FIGMA_EMAILFIGMA_PASSWORDFIGMA_TOTP_SECRET
Never store these credentials in your repository files or expose them in logs.
Access Control
-
Repository Access
- Limit repository access to necessary team members
- Use repository roles to control permissions
- Regularly audit repository access
-
Workflow Permissions
- Configure minimal required permissions for workflows
- Use environment protection rules
- Enable required reviewers for protected environments
Dedicated Publishing Account
Following the principle of least privilege, we strongly recommend creating a dedicated Figma account for plugin publishing:-
Account Setup
- Create a new Figma account using a company email
- Use a strong, unique password
- Enable two-factor authentication (mandatory for plugin publishing)
- Document account details in a secure location
-
Permission Configuration
- Grant access only to plugin management features
- Remove unnecessary team/organization access
- Configure plugin-specific permissions only
-
Access Management
- Maintain a list of team members with access to this account
- Implement a process for access revocation
- Regularly review and update access permissions
- Consider using a password manager for team access
-
Security Considerations
- Use this account exclusively for plugin publishing
- Avoid using this account for design work or other Figma activities
- Monitor account activity regularly
- Update credentials if team members with access leave the organization
Never share this account’s credentials through unsecured channels like email
or chat. Use a secure password manager or your organization’s secret
management system.
Environment Configuration
Environment Protection
Set up protected environments in GitHub:- Go to Repository Settings > Environments
- Create environments (e.g., staging, production)
- Configure protection rules:
- Required reviewers
- Wait timer
- Deployment branches
Secret Rotation
Implement regular credential rotation:- Generate new credentials periodically
- Update GitHub Secrets
- Verify deployment after updates
- Remove old credentials
Secure Workflow Practices
Input Validation
Validate all inputs in your workflow:Dependency Security
- Action Versions
- Pin action versions using SHA
- Regularly update dependencies
- Monitor security advisories
- Dependency Scanning
- Use GitHub’s dependency scanning
- Implement automated security updates
- Review dependency changes
Monitoring and Auditing
Workflow Logs
Monitor workflow execution:- Review workflow logs regularly
- Set up notifications for failures
- Monitor unusual patterns
- Configure log retention policies
Audit Trail
Maintain deployment records:- Use detailed commit messages
- Tag releases properly
- Document deployment issues
- Keep change logs updated
Common Security Issues
Credential Exposure
Credential Exposure
- Check workflow logs for exposed secrets - Review public repository content
- Monitor GitHub Security alerts
Unauthorized Access
Unauthorized Access
Dependency Vulnerabilities
Dependency Vulnerabilities
- Monitor dependency advisories - Update dependencies regularly - Review automated security updates
Security Checklist
Store credentials in GitHub Secrets
Configure protected environments
Implement secret rotation
Pin action versions
Monitor workflow logs
Regular security audits