Loading...
Loading...
A dedicated skill for security code review of OpenHarmony distributed systems. Triggered when users make requests such as "review code security implementation", "code security audit", "security code review" or similar distributed system code security review requests. This skill provides detailed review guidance for 18 security design rules for OpenHarmony distributed services, covering security areas such as authorization control, state machines, data transmission, permission management, and trusted relationships. Using this skill, you can conduct specialized security reviews for OpenHarmony distributed systems based on general cybersecurity rules.
npx skill4agent add openharmonyinsight/openharmony-skills oh-distributed-security-design-reviewGrep patterns examples:
- "auth", "authorize", "permission" for authorization checks
- "PIN", "secret", "key" for sensitive data
- "state", "status" for state machine
- "random", "generate" for secret generation// The object side directly uses the flag passed from the subject side to control the pop-up dialog
void handleAuthRequest(bool showPopup) {
if (!showPopup) {
// Skip the authorization pop-up directly
grantAccess();
}
}// The object side independently decides whether authorization is required
void handleAuthRequest() {
if (isSystemBusinessAndRegistered()) {
// Registered business exempt from authorization
grantAccess();
} else {
// Pop-up is required by default
showAuthorizationDialog();
}
}// Transmit PIN code in plaintext
message.pin_code = userPin;
sendToRemote(message);// Transmit after encryption
encryptedPin = encryptPin(userPin, sessionKey);
message.encrypted_pin = encryptedPin;
sendToRemote(message);// Judge trusted relationship by comparing account information directly
bool isTrusted() {
return localAccount == remoteAccount;
}// Rely on HiChain query
bool isTrusted() {
CredentialType type = HiChain.queryCredentialType(remoteDevice);
return type == CredentialType.SAME_ACCOUNT;
}// Default to allow
bool enableSecurityCheck = true; // Enabled by default// Default to disable
bool enableSecurityCheck = false; // Disabled by default, need explicit enabling