{"id":23074721,"url":"https://github.com/acile067/project_oib_smart_meter","last_synced_at":"2026-02-07T04:02:30.770Z","repository":{"id":267438165,"uuid":"900353041","full_name":"Acile067/Project_OIB_Smart_Meter","owner":"Acile067","description":"Projekat iz predmeta Osnove informacione bezbednosti IS (oib). Pametno brojilo.","archived":false,"fork":false,"pushed_at":"2025-01-04T14:59:43.000Z","size":211,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T11:45:34.293Z","etag":null,"topics":["certificates","cssharp","ftn","groups-manager","json","rbac","securtiy","users","wcf","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Acile067.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-08T15:06:48.000Z","updated_at":"2025-01-04T14:59:47.000Z","dependencies_parsed_at":"2024-12-10T11:22:29.572Z","dependency_job_id":"2f7d9d1f-e30f-4ffe-a00b-aa44e1659575","html_url":"https://github.com/Acile067/Project_OIB_Smart_Meter","commit_stats":null,"previous_names":["acile067/project_oib_smart_meter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Acile067/Project_OIB_Smart_Meter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acile067%2FProject_OIB_Smart_Meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acile067%2FProject_OIB_Smart_Meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acile067%2FProject_OIB_Smart_Meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acile067%2FProject_OIB_Smart_Meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Acile067","download_url":"https://codeload.github.com/Acile067/Project_OIB_Smart_Meter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acile067%2FProject_OIB_Smart_Meter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29186050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T03:35:06.566Z","status":"ssl_error","status_checked_at":"2026-02-07T03:34:57.604Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificates","cssharp","ftn","groups-manager","json","rbac","securtiy","users","wcf","windows"],"created_at":"2024-12-16T08:29:15.108Z","updated_at":"2026-02-07T04:02:30.765Z","avatar_url":"https://github.com/Acile067.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Meter\n\nDeveloped as a project for the course 'Fundamentals of Information Security', the system processes smart meter readings and stores data on the recorded consumption. Security is achieved through the use of certificates, RBAC (Role-Based Access Control), and an event logger.\n\n## Built using\n\n- \u0026nbsp; \u003cimg src=\"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRxo1QGx_G_1-2qBwh3RMPocLoKxD782w333Q\u0026usqp=CAU\" align=\"center\" width=\"28\" height=\"28\"/\u003e \u003ca href=\"https://dotnet.microsoft.com/en-us/download/dotnet/8.0\"\u003e .NET 8 \u003c/a\u003e\n\n## Installation:\n\n1. **Install .NET SDK**:  \n   Download and install the .NET SDK 8.0 for your operating system from [here](https://dotnet.microsoft.com/en-us/download/dotnet/8.0).\n\n2. **Verify installation**:  \n   Run the following command in your terminal to confirm:\n   ```bash\n   dotnet --list-sdks\n   ```\n\n## How to run:\n\n\u003cdetails\u003e\n  \u003csummary\u003ePreparation:\u003c/summary\u003e\n\n### 1. Create Users and Groups\n\n1. **Navigate to**:  \n   **Computer Management** → **Local Users and Groups**  \n\n2. **Create Users**:  \n   - **Administrator1** (password: `1234`)  \n   - **Operator1** (password: `1234`)  \n   - **SuperAdministrator1** (password: `1234`)  \n   - **MainService** (password: `1234`)  \n   - **LoadBalancer** (password: `1234`)  \n   - **Worker1** (password: `1234`)  \n   - **Worker2** (password: `1234`)  \n\n3. **Create Groups**:  \n   - **Admin** → Add **Administrator1**  \n   - **Operator** → Add **Operator1**  \n   - **Super-administrator** → Add **SuperAdministrator1**  \n\n---\n\n### 2. Create and Install Certificates\n\n1. **Locate `makecert.exe`**:  \n   Navigate to `C:\\Program Files (x86)\\Windows Kits\\10\\bin` and find the folder corresponding to your version (e.g., `\\10.0.22621.0\\x86`).  \n\n2. **Open Command Prompt**:  \n   Run **Command Prompt** as Administrator and move to the directory with `makecert.exe`:  \n\n   ```bash\n   cd \"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x86\"\n   ```\n\n---\n   \n### 3. Generate Certificates:\n\n   - Self-Signed Certificate:\n     ```bash\n     makecert -n \"CN=TestCA\" -r -sv TestCA.pvk TestCA.cer\n     ```\n\n   - Worker and LoadBalancer Certificates:\n\n     Generate `.pvk` and `.cer` files:\n\n     ```bash\n     makecert -sv Worker1.pvk -iv TestCA.pvk -n \"CN=Worker1\" -pe -ic TestCA.cer Worker1.cer -sr localmachine -ss My -sky exchange\n     ```\n     ```bash\n     makecert -sv Worker2.pvk -iv TestCA.pvk -n \"CN=Worker2\" -pe -ic TestCA.cer Worker2.cer -sr localmachine -ss My -sky exchange\n     ```\n     ```bash\n     makecert -sv LoadBalancer.pvk -iv TestCA.pvk -n \"CN=LoadBalancer\" -pe -ic TestCA.cer LoadBalancer.cer -sr localmachine -ss My -sky exchange\n     ```\n\n     Generate .pfx Files:\n\n     ```bash\n     pvk2pfx.exe /pvk Worker1.pvk /pi 1234 /spc Worker1.cer /pfx Worker1.pfx\n     ```\n     ```bash\n     pvk2pfx.exe /pvk Worker2.pvk /pi 1234 /spc Worker2.cer /pfx Worker2.pfx\n     ```\n     ```bash\n     pvk2pfx.exe /pvk LoadBalancer.pvk /pi 1234 /spc LoadBalancer.cer /pfx LoadBalancer.pfx\n     ```\n\n---\n\n### 4. Install Certificates:\n\n#### TestCA Certificate\n\n1. Locate `TestCA.cer`, double-click, and choose **Install Certificate**.  \n2. Select **Local Machine** → Place in **Trusted Root Certification Authorities** → Next → Finish.  \n\n---\n\n#### Worker and LoadBalancer Certificates\n\n1. Locate `.pfx` files (e.g., `Worker1.pfx`), double-click, and follow these steps:  \n   - Select **Local Machine**.  \n   - Enter password `1234`.  \n   - Check **Mark this key as exportable**.  \n   - Place in **Personal** store.  \n\n2. Locate `.cer` files (e.g., `Worker1.cer`), double-click, and follow these steps:  \n   - Select **Local Machine**.  \n   - Place in **Trusted People**.  \n   - Click Finish.\n\n3. Repeat these steps for `Worker2` and `LoadBalancer`.  \n\n---\n\n### 5. Manage Certificates in MMC:\n\n1. Open MMC:  \n   - Press `Windows + R`, type `mmc`, and hit Enter.  \n\n2. Add Certificates Snap-in:  \n   - Go to **File** → **Add/Remove Snap-ins**.  \n   - Select **Certificates**.  \n   - Choose **Computer Account** → **Local Computer** → Finish.  \n\n3. Configure Worker1 Certificate:  \n   - Locate `Worker1` under **Personal \u003e Certificates**.  \n   - Right-click the certificate → Select **Manage Private Keys**.  \n   - Add `Worker1` user → Click OK.  \n\n4. Repeat these steps for `Worker2` and `LoadBalancer`.  \n \n---\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eRun:\u003c/summary\u003e\n\n### 1. Clone the project:\n\n   Clone the repository and navigate to the appropriate directory:\n\n   ```bash\n   git clone https://github.com/Acile067/Project_OIB_Smart_Meter.git\n   cd Project_OIB_Smart_Meter/Smart_Meter\n   ```\n\n### 2. Build the Project\n\n#### Build using MSVC:\n1. Open the **Developer Command Prompt for VS 2022**.\n2. Build the project using the following command:\n\n```bash\nmsbuild Smart_Meter.sln /p:Configuration=Debug /p:Platform=x64\n```\n\n### 3. Set Security Permissions\n\n1. Navigate to the `Project_OIB_Smart_Meter` folder.\n2. Right-click on the `Smart_Meter` folder → Select **Properties**.\n3. Go to the **Security** tab and add all created users with **Full Control** permissions.\n\n### 4. Run the Project\n\n#### Important Notes:\n- **First-Time Run:** The service must be run as an administrator the first time to allow it to create the Event Log File.\n- For subsequent runs, use the specific accounts mentioned below.\n\n#### Steps:\n1. **Run the Service**:\n   - Navigate to: `\\Smart_Meter\\Service\\bin\\Debug`.\n   - Hold **Shift + Right-Click** on `Service.exe` → Select **Run as different user**.\n   - For the **first run**, select the **Administrator** account. For subsequent runs, use the **MainService** account.\n\n2. **Run the Load Balancer**:\n   - Navigate to: `\\Smart_Meter\\LoadBalancer\\bin\\Debug`.\n   - Hold **Shift + Right-Click** on `LoadBalancer.exe` → Select **Run as different user** → Use the **LoadBalancer** account.\n\n3. **Run Workers**:\n   - Navigate to: `\\Smart_Meter\\Worker\\bin\\Debug`.\n   - Hold **Shift + Right-Click** on `Worker.exe` → Select **Run as different user**.\n   - Run two instances:\n     - One using the **Worker1** account.\n     - One using the **Worker2** account.\n\n4. **Run Clients**:\n   - Navigate to: `\\Smart_Meter\\Client\\bin\\Debug`.\n   - Hold **Shift + Right-Click** on `Client.exe` → Select **Run as different user**.\n   - Run instances using the following accounts:\n     - **Administrator1**\n     - **SuperAdministrator1**\n     - **Operator1**\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facile067%2Fproject_oib_smart_meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facile067%2Fproject_oib_smart_meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facile067%2Fproject_oib_smart_meter/lists"}