Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
YouTube Security VideosNeil Patel: The 3-Search Test For Your Business #shorts(24.09.2026 um 20:04 Uhr)
•
YouTube Security VideosLinus Tech Tips: The One Apple Product I Fanboy Over(24.09.2026 um 20:18 Uhr)
•
YouTube Security VideosMicrosoft Mechanics: One Prompt Builds Your Copilot Agent(24.09.2026 um 20:15 Uhr)
••
Sichere ProgrammierungAI-powered fuzzing with the GitHub Security Lab Taskflow Agent(24.09.2026 um 20:26 Uhr)
•••
Sichere ProgrammierungBuilt an Agentic Fraud Investigator using(24.09.2026 um 20:15 Uhr)
•
Sichere ProgrammierungBuilding a fraud investigator that argues with itself(24.09.2026 um 20:15 Uhr)
••
YouTube Security VideosNeil Patel: The 3-Search Test For Your Business #shorts(24.09.2026 um 20:04 Uhr)
•
YouTube Security VideosLinus Tech Tips: The One Apple Product I Fanboy Over(24.09.2026 um 20:18 Uhr)
•
YouTube Security VideosMicrosoft Mechanics: One Prompt Builds Your Copilot Agent(24.09.2026 um 20:15 Uhr)
••
Sichere ProgrammierungAI-powered fuzzing with the GitHub Security Lab Taskflow Agent(24.09.2026 um 20:26 Uhr)
•••
Sichere ProgrammierungBuilt an Agentic Fraud Investigator using(24.09.2026 um 20:15 Uhr)
•
Sichere ProgrammierungBuilding a fraud investigator that argues with itself(24.09.2026 um 20:15 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Init your golang gRPC Services

Hello, After so long time I'm not writing again (last time write on medium), finally I do gather the intention to make an article again. today I want to share how do I creating my grpc services from stracth. for the context I want to…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hello, After so long time I'm not writing again (last time write on medium), finally I do gather the intention to make an article again. today I want to share how do I creating my grpc services from stracth.



for the context I want to create continues article, I will try to build complex system application that will mock like real world problem. but lets see later if I can complete that.



for now lets do focus on how to creating the golang grpc services, I will create really simple application and how to test it.






Install the prerequisites tools



you need to install protoc first, I used linux so to install that need to run




sudo apt install -y protobuf-compiler  






how if I use macos? run this, but I'm not sure if its work because I dont have macos




brew install protobuf






if already installed, please verify by run




protoc --version






it will show the version of protoc, for me I have protoc version libprotoc 3.6.1.

after do that, install the requirement plugin protoc for golang




go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest






and make sure bin for protoc-gen-go and protoc-gen-go-grpc already on your path.






Path Structure



so this is my structure my project, btw this path structure will look like complicated, because I want to make continues app later in this project, so just bear with it



Tree Folder



little breakdawn what inside the folder.

agent -> it will the base applications. basically I want to make app using state-machine pattern

agent/client -> it will hold the client type and the handler for GRPC

proto -> this will based proto files for our grpc. the files *.pb.go and *_grpc.pb.go will generated automaticall, we just need to write .proto files for service definition of rpc





Make your syntax proto



Lets make your syntax proto



proto/agent.proto




syntax = "proto3";
option go_package = "github.com/jufianto/state-agent/agentsrv-proto";

enum TaskStatus{
UNKNOWN = 0;
PROCESSING = 1;
FAILED = 2;
SUCCESS = 3;
}

message TaskRequest{
string task_id = 1;
string task_name = 2;
string task_url = 3;
}

message TaskResponse{
string task_id = 1;
string task_result = 2;
TaskStatus task_status = 3;

}

message TaskListResponse{
repeated TaskResponse tasks = 1;
}

message TaskListRequest{
repeated string tasks_id = 1;
}

message TaskNotify{
string task_id = 1;
TaskStatus task_status = 2;
}

message TaskStatusRequest {
string task_id = 1;
}

message TasksStatusResponse {
string task_id = 1;
TaskStatus task_status = 2;
}

service TaskService{
rpc CreateTask(TaskRequest) returns (TaskResponse) {}
rpc ListTask(TaskListRequest) returns (TaskListResponse) {}
rpc StatusTask(TaskStatusRequest) returns (TasksStatusResponse){}
}






what happen on that code?





  • option go_package will be result as your package grpc after .go files generated


  • enum is the type enum of TaskStatus will be
    message will be like the type struct on golang


  • string task_id = 1; is explain the type data of task_id is string and the number should be consistent on the field. the number is need to identify the binary serialize later. so if you want later to add new field, you must not to change the the number on the field, just add it. it can break the backward compability when deserialize later.


  • service TaskService is the defined of service grpc



after you coded that, lets go to folder proto and execute this command to generate the grpc code go




 protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
*.proto







and you will see the result on proto folder have 2 files

agent.pb.go -> the Go struct definitions for messages proto, It also includes methods to serialize/deserialize (marshal/unmarshal) the messages to/from binary or JSON formats.



agent_grpc.ob.go. -> contains the grpc specific code, like the server / client definitions and also list of method / services grpc





Lets do the real code



after generated the grpc code, create files client.go on folder client and fill with this code.



client.go





package client

import (
agentsrv_proto "github.com/jufianto/state-agent/proto"
"google.golang.org/grpc"
)

type AgentService struct {
Key string
agentsrv_proto.UnimplementedTaskServiceServer
}

type TaskResult struct {
TaskID string
TaskResult string
TaskStatus string
}

func NewAgentClient(key string) *AgentService {
return &AgentService{
Key: key,
}
}

func (a *AgentService) RegisterGW(srvGrpc *grpc.Server) {
agentsrv_proto.RegisterTaskServiceServer(srvGrpc, a)
}








and also code the handler.go



handler.go





func (a *AgentService) CreateTask(ctx context.Context, req *agentsrv_proto.TaskRequest) (*agentsrv_proto.TaskResponse, error) {
fmt.Printf("got request %+v \n", req)

return &agentsrv_proto.TaskResponse{
TaskId: req.TaskId,
TaskResult: "waiting for processing",
TaskStatus: agentsrv_proto.TaskStatus_PROCESSING,
}, nil
}

func (a *AgentService) ListTask(ctx context.Context, req *agentsrv_proto.TaskListRequest) (*agentsrv_proto.TaskListResponse, error) {

log.Println("list tasks", req.GetTasksId())

return nil, fmt.Errorf("not yet implemented")

}

func (a *AgentService) StatusTask(ctx context.Context, req *agentsrv_proto.TaskStatusRequest) (*agentsrv_proto.TasksStatusResponse, error) {
log.Println("status tasks", req.GetTaskId())

return nil, fmt.Errorf("not yet implemented")
}







what happen on that code?

so, client.go it the base client for our primary services, it will hold the agentsrv_proto.UnimplementedTaskServiceServer interface to make sure the handler will implemented the services grpc.



the real thing gRPC is coming from this code agentsrv_proto.RegisterTaskServiceServer(srvGrpc, a) it will make the grpc server registered on this handler and can be used later as grpc services.



and for the handler.go it will impelented from grpc generated code from the rpc we defined on protofiles. on the proto files, you can see you have rpc services look like this




    rpc CreateTask(TaskRequest) returns (TaskResponse) {}
rpc ListTask(TaskListRequest) returns (TaskListResponse) {}
rpc StatusTask(TaskStatusRequest) returns (TasksStatusResponse){}






and all of this method grpc need to be implemented as you can see from the handler.go



Finally, lets write the main.go



main.go





package main

import (
"fmt"
"log"
"net"

"github.com/jufianto/state-agent/agent/client"

"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)

func main() {

srvGrpc := grpc.NewServer()

srv := client.NewAgentClient("key123")
srv.RegisterGW(srvGrpc)

fmt.Println("service listening....")

net, err := net.Listen("tcp", ":3333")
if err != nil {
log.Fatalf("failed to register grpc: %v", err)
}

reflection.Register(srvGrpc)
srvGrpc.Serve(net)

}








srvGrpc := grpc.NewServer() will be init the grpc server, and srv.RegisterGW will be registered the handler to server grpc and finally do serve on srvGrpc.Serve(net) with port 3333



reflection.Register(srvGrpc) it just for helper to check what all the services on grpc services.






Run your services



to run your services, please do run

go run agent/main.go and it will looks like



Running Services



and you need to test it by postman



Test Postman



you can see from the list down on postman, there have option list Create Task, ListTask, thats the use of reflection package. it will help us to check what all the method on the gRPC services.






FAQ



Q: usually on Rest API services, I see there have routing that help route the services based on the path we called. but Why I dont see on here?

A: that's the magic of grpc, basically its not based on routing but based on the method implemented. the method handler it should be same with the method we defined on the grpc generated code or can be simplified based on the proto rpc services defined.



The Github Repo for this Projects




[!NOTE]

if you have anything to ask please reach me on twitter and if you confuse with my bad writing you also can comment

and all of this explanation based my experience, so feel free to correct me if I share the miss information




twitter: https://x.com/jufiantohenri

linkedin: https://www.linkedin.com/in/jufianto/

CTI Threat Relationship Graph4 Knoten / 3 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Remote Code Execution (RCE) Defense
title: Detect Exploitation - Init your golang gRPC Services
id: f92c0b59-7eb7-4179-b85f-4707810201dd
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Init your golang gRPC Services" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Init your golang gRPC Services.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Init your golang gRPC Services

Thematisch verwandte Begriffe: Init, your, golang, gRPC · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-57175 | Python Social Auth is a social authentication/registration mechanism. Pr…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle