This topic describes how to create and enable an access control rule for a service.
- Log on to the SOFAStack MS Platform console, choose Microservices > Service management.
- On the page that appears, enter the target app or service name in the search bar and click the search icon. In the list of services found, click the target service ID.
- On the service details page that appears, click the Service governance tab.
Select an access control mode.
- Whitelist: Only service access requests that meet the whitelist rules are allowed. All other requests are rejected.
- Blacklist: Service access requests that meet the blacklist rules are rejected. All other requests are allowed.
Click Add rule. Enter a rule name, which can contain Chinese characters, letters, digits, and underscores (_).
Edit the match conditions. The procedure is as follows:
Select the field type and field name.
- System field: The following fields are provided: app name of the caller, IP address of the caller, app name of the service provider, service name of the service provider, and method name of the service provider.
- Custom field: You can customize fields based on your needs.
Specify the logical relationships.
- Does Not Equal
- Is Part Of
- Is Not Part Of
- Regular expression: You can configure a regular expression to match requests.
- Enter the field value to be matched.
- Click Save.
- Click Enable.