com um clique
security
For secrets, tokens, TLS, signatures, and 1C privileges
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
For secrets, tokens, TLS, signatures, and 1C privileges
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
When writing or reviewing BSL, apply 1C standards
При написании или ревью BSL применять стандарты 1С
Orchestrator: routing work and agent phases
Оркестратор: маршрутизация работы и фаз агентов
BSL LSP navigation: definitions, refs, call graph
Rules for using RLM tools for project search and navigation in 1C/BSL
| name | security |
| description | For secrets, tokens, TLS, signatures, and 1C privileges |
| alwaysApply | false |
This skill is a map of topics on the security of 1C application code. Platform API specifics are moved into references/. Here are the trust boundaries, typical mistakes, and stop-rules that any agent (architect / developer-code / reviewer) must follow when working with sensitive data.
Security in 1C is not a separate subsystem, but an end-to-end property of the code:
БезопасноеХранилище, not in code/configuration/logs.МенеджерКриптографии + an explicit provider (CryptoPro CSP / ViPNet) with an explicit GOST version.| Trigger | Action |
|---|---|
| You see work with a password/token/secret in a procedure parameter or in a code string | Read references/secrets.md, move it to БезопасноеХранилище, check masking in logs |
You see work with МенеджерКриптографии, СертификатКриптографии, ХранилищеСертификатовКриптографии, or ПараметрыПодписиCMS | Read references/crypto.md, check the provider, GOST version, context (client/server), and the private key lifecycle |
| You see an HTTP call to an external API, OpenID/OAuth, basic-auth, or a client TLS certificate | Read references/auth.md, check error semantics and credential storage |
| You are reviewing code that touches rights, RLS, privileged mode, or external integrations | Use references/review-checklist.md as a mandatory filter before the final answer |
| You need to design a new integration/service with authentication | First define the trust boundary (see below), then choose the API |
Before writing or reviewing code, explicitly define which boundary it crosses:
HTTPСоединение, OpenID/OAuth, client certificate, TLS.МенеджерКриптографии, CryptoPro CSP / ViPNet, access to the certificate store under the rphost/srv1cv8 account.БезопасноеХранилище, or an external vault through a connector.If the boundary is not named, the skill is applied incorrectly: go back to the design stage.
БезопасноеХранилище → references/secrets.mdОбщегоНазначения.ЗаписатьДанныеВБезопасноеХранилище(Владелец, Данные, Ключ = "Пароль") and ПрочитатьДанныеИзБезопасногоХранилища(Владелец, Ключи = "Пароль", ...); storage is the information register БезопасноеХранилищеДанных, direct access to it is forbidden.УстановитьПривилегированныйРежим(Истина) in a targeted way (not for the whole module).references/crypto.mdМенеджерКриптографии(ИмяПровайдера, ТипПровайдера) — the provider is chosen explicitly (CryptoPro CSP, ViPNet CSP).СертификатКриптографии, ХранилищеСертификатовКриптографии, ПараметрыПодписиCMS.Хранилище.Значение.ЭлектроннаяПодпись, ЭлектроннаяПодписьСлужебный) is the preferred path if БСП is present in the configuration.references/auth.md"ИнтернетПользователи").HTTPСоединение/HTTPЗапрос, the token and refresh-token are stored in БезопасноеХранилище.БезопасноеХранилище, and the header is assembled on the server.СертификатКлиентаФайл, СертификатКлиентаWindows, СертификатКлиентаOpenSSL in HTTPСоединение.missing credentials, expired token, invalid certificate, provider unavailable, denied rights, tenant mismatch, remote auth failure.references/review-checklist.mdA stack-neutral checklist that the agent-reviewer must pass before the final answer if the code touches any of the topics above.
These rules are strict. A violation means a blocking review comment and code rewrite.
A password/token/private key must not be passed through a procedure parameter that has a "client ↔ server" boundary
Пароль parameter.A private key / cryptography container is not stored in a common module, directory attribute, or constant
Константа.КлючШифрования, in a layout.МенеджерКриптографии.УстановитьПривилегированныйРежим(Истина) around work with БезопасноеХранилище is mandatory and targeted
УстановитьПривилегированныйРежим, ОбщегоНазначения.ПрочитатьДанныеИзБезопасногоХранилища will fail on permissions for an ordinary user.УстановитьПривилегированныйРежим(Ложь) must be set immediately after reading, in the same Попытка/Исключение block.Logs and the registration log do not contain tokens, passwords, private keys, or full Authorization headers
ЗаписьЖурналаРегистрации, Сообщить, or the agent response, only masked values (***, last 4 characters, certificate fingerprint) are allowed.An authentication error is different from a validation error and a business error
401/403 from an external API does not become "failed to perform the operation". It is a separate error type with separate handling (refresh, re-login, escalation).Context: You need to call an external REST API with OAuth 2.0 (client credentials).
Steps:
client_secret and refresh_token go into БезопасноеХранилище, owner = reference to the directory item.УстановитьПривилегированныйРежим.Authorization header on the server; the header is not returned to the client.expired token → refresh, invalid client → configuration error (no retry), provider unavailable → retry with backoff.client_id is visible, client_secret/access_token are masked (last 4 characters).references/review-checklist.md.Context: You need to sign XML/PDF with a qualified digital signature under GOST R 34.10-2012.
Steps:
МенеджерКриптографии manually.МенеджерКриптографии("Crypto-Pro GOST R 34.10-2012 Cryptographic Service Provider", 80) with an explicit ТипПровайдера.Отпечаток), not by "the first suitable one".ПараметрыПодписиCMS (detached/attached, encoding).ДанныеПодписи in full; log the certificate Отпечаток and the business object identifier.Context: A УстановитьПривилегированныйРежим(Истина) appeared in the PR.
Steps:
УстановитьПривилегированныйРежим(Ложь) in the same scope and in Попытка/Исключение.references/review-checklist.md.// Сервер. Чтение токена внешнего API из безопасного хранилища.
// Привилегированный режим — точечный, только вокруг чтения секрета.
Функция ПолучитьТокенДоступа(УчётнаяЗапись) Экспорт
УстановитьПривилегированныйРежим(Истина);
Попытка
ДанныеСекрета = ОбщегоНазначения.ПрочитатьДанныеИзБезопасногоХранилища(УчётнаяЗапись, "access_token");
Исключение
УстановитьПривилегированныйРежим(Ложь);
ВызватьИсключение;
КонецПопытки;
УстановитьПривилегированныйРежим(Ложь);
Если ДанныеСекрета = Неопределено Тогда
ВызватьИсключение НСтр("ru = 'Токен не настроен для учётной записи.'");
КонецЕсли;
Возврат ДанныеСекрета;
КонецФункции
// АНТИПАТТЕРН: пароль пересекает границу клиент/сервер в открытом параметре.
// АНТИПАТТЕРН: пароль попадает в журнал регистрации.
&НаСервереБезКонтекста
Функция ОтправитьДокумент(URL, Логин, Пароль, ТелоЗапроса) Экспорт
ЗаписьЖурналаРегистрации("Интеграция",
УровеньЖурналаРегистрации.Информация,
,
,
"Отправка: URL=" + URL + ", Логин=" + Логин + ", Пароль=" + Пароль);
// ... вызов внешнего API ...
КонецФункции
| Mistake | Consequence | How to avoid |
|---|---|---|
| Password/token in the parameter of an exported server procedure | Leak over the network, in dumps, in client logs | Pass only the secret owner (reference), read the secret on the server |
УстановитьПривилегированныйРежим(Истина) for the whole module/function | Bypassing RLS and role checks across all business logic | A targeted block only around work with БезопасноеХранилище |
Storing access_token in a directory attribute / constant / layout | Any user with directory read permission gets the token | БезопасноеХранилище + owner = reference to the directory item |
МенеджерКриптографии() without an explicit provider and type | The code works in the test environment, fails in production with a different provider | Explicit ИмяПровайдера + ТипПровайдера, GOST version fixed |
| The certificate is chosen as "the first one in the store" | Signature with the wrong certificate at rotation time | Search strictly by Отпечаток |
401 from an external API → Сообщить("Ошибка при сохранении") | It is impossible to distinguish an expired token from a data error | Separate authentication error type + refresh handling |
| Logging the entire HTTP request/response body | Passwords/tokens/PII are stored in the registration log | Sanitization before logging, masking sensitive fields |
error-handling — the general error model, including distinguishing technical and business errors.integration-patterns — patterns for HTTP services and external integrations that authentication is attached to.ssl-patterns — БСП modules (including "Электронная подпись", "ИнтернетПользователи").coding-standards — general rules for formatting server code.