Skip to content

Commit 4869c2f

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/implement-hashicorp-vault
Signed-off-by: dviejokfs <[email protected]>
2 parents ec3a8fb + 8799a58 commit 4869c2f

File tree

8 files changed

+135
-10
lines changed

8 files changed

+135
-10
lines changed

go.mod

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/kfsoftware/hlf-operator
22

3-
go 1.23.0
4-
5-
toolchain go1.23.5
3+
go 1.23.5
64

75
require (
86
github.com/IBM/idemix v0.0.0-20220113150823-80dd4cb2d74e
@@ -238,5 +236,5 @@ require (
238236

239237
replace (
240238
github.com/hyperledger/fabric-config => github.com/kfsoftware/fabric-config v0.0.0-20240819184344-a0b16ca530c2
241-
github.com/hyperledger/fabric-sdk-go => github.com/kfsoftware/fabric-sdk-go v0.0.0-20240114221414-98466038585d
242-
)
239+
github.com/hyperledger/fabric-sdk-go => github.com/kfsoftware/fabric-sdk-go v0.0.0-20250318193343-db7cb6f42306
240+
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,8 @@ github.com/kfsoftware/fabric-config v0.0.0-20240819184344-a0b16ca530c2 h1:6wb4m/
528528
github.com/kfsoftware/fabric-config v0.0.0-20240819184344-a0b16ca530c2/go.mod h1:1ZfjDrsuMoM4IPKezQgTByy2vXUj8bgTXaOXaGXK5O4=
529529
github.com/kfsoftware/fabric-sdk-go v0.0.0-20240114221414-98466038585d h1:HcMV8Lve3QkZUIWYHP+rVIR4xtTdDPooj7Id0IdBj0o=
530530
github.com/kfsoftware/fabric-sdk-go v0.0.0-20240114221414-98466038585d/go.mod h1:JRplpKBeAvXjsBhOCCM/KvMRUbdDyhsAh80qbXzKc10=
531+
github.com/kfsoftware/fabric-sdk-go v0.0.0-20250318193343-db7cb6f42306 h1:1HeRlKS4qdrC26HAe8ZqRiuBUPiGFDY7taHuehyraRE=
532+
github.com/kfsoftware/fabric-sdk-go v0.0.0-20250318193343-db7cb6f42306/go.mod h1:JRplpKBeAvXjsBhOCCM/KvMRUbdDyhsAh80qbXzKc10=
531533
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
532534
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
533535
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=

kubectl-hlf/cmd/channel/inspect.go

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import (
55
"fmt"
66
"io"
77

8+
"github.com/golang/protobuf/proto"
89
"github.com/hyperledger/fabric-config/protolator"
10+
"github.com/hyperledger/fabric-protos-go/common"
911
"github.com/hyperledger/fabric-sdk-go/pkg/client/resmgmt"
1012
"github.com/hyperledger/fabric-sdk-go/pkg/core/config"
1113
"github.com/hyperledger/fabric-sdk-go/pkg/fab/resource"
@@ -20,6 +22,8 @@ type inspectChannelCmd struct {
2022
channelName string
2123
userName string
2224
ordererName string
25+
raw bool
26+
genesis bool
2327
}
2428

2529
func (c *inspectChannelCmd) validate() error {
@@ -56,10 +60,35 @@ func (c *inspectChannelCmd) run(out io.Writer) error {
5660
if c.ordererName != "" {
5761
resmgmtOptions = append(resmgmtOptions, resmgmt.WithOrdererEndpoint(c.ordererName))
5862
}
59-
block, err := resClient.QueryConfigBlockFromOrderer(c.channelName, resmgmtOptions...)
60-
if err != nil {
61-
return err
63+
64+
var block *common.Block
65+
if c.genesis {
66+
block, err = resClient.GenesisBlock(c.channelName, resmgmtOptions...)
67+
if err != nil {
68+
return fmt.Errorf("failed to fetch genesis block: %v", err)
69+
}
70+
} else {
71+
// Fetch latest config block
72+
block, err = resClient.QueryConfigBlockFromOrderer(c.channelName, resmgmtOptions...)
73+
if err != nil {
74+
return fmt.Errorf("failed to fetch config block: %v", err)
75+
}
6276
}
77+
78+
if c.raw {
79+
// Output raw block
80+
blockBytes, err := proto.Marshal(block)
81+
if err != nil {
82+
return err
83+
}
84+
_, err = out.Write(blockBytes)
85+
if err != nil {
86+
return err
87+
}
88+
return nil
89+
}
90+
91+
// Output JSON format (default)
6392
cmnConfig, err := resource.ExtractConfigFromBlock(block)
6493
if err != nil {
6594
return err
@@ -92,6 +121,8 @@ func newInspectChannelCMD(out io.Writer, errOut io.Writer) *cobra.Command {
92121
persistentFlags.StringVarP(&c.channelName, "channel", "c", "", "Channel name")
93122
persistentFlags.StringVarP(&c.configPath, "config", "", "", "Configuration file for the SDK")
94123
persistentFlags.StringVarP(&c.ordererName, "orderer", "o", "", "Orderer endpoint to fetch config from (optional)")
124+
persistentFlags.BoolVarP(&c.raw, "raw", "r", false, "Output raw block instead of JSON format")
125+
persistentFlags.BoolVarP(&c.genesis, "genesis", "g", false, "Fetch genesis block (block 0) instead of config block")
95126
cmd.MarkPersistentFlagRequired("channel")
96127
cmd.MarkPersistentFlagRequired("user")
97128
cmd.MarkPersistentFlagRequired("peer")

website-docs/docs/grpc-proxy/enable-orderers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
# Enable GRPC proxy on the orderers
22
## Enable GRPC proxy for Fabric Operations Console
33

44
In order to enable the GRPC Web, needed to connect the peer to the Fabric Operations console, we need to add the `grpcProxy` property with the following attributes:

website-docs/docs/grpc-proxy/enable-peers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
# Enable GRPC proxy on the peers
22
## Enable GRPC proxy for Fabric Operations Console
33

44
In order to enable the GRPC Web, needed to connect the peer to the Fabric Operations console, we need to add the `grpcProxy` property with the following attributes:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"label": "Security"
3+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
id: revoke-identities
3+
title: Revoking Identity Credentials
4+
---
5+
6+
> **Note:** This feature requires HLF Operator version 1.12.0 or later.
7+
8+
# Revoking Identity Credentials
9+
10+
This guide walks you through the process of revoking identity credentials in a Hyperledger Fabric network managed by HLF Operator. Identity revocation is a critical security operation when credentials are compromised or when users leave your organization.
11+
12+
## Before You Begin
13+
14+
To revoke credentials, you must have an admin identity with the proper permissions. The following attributes are required:
15+
16+
```yaml
17+
identities:
18+
- affiliation: ''
19+
attrs:
20+
hf.AffiliationMgr: false
21+
hf.GenCRL: true
22+
hf.IntermediateCA: false
23+
hf.Registrar.Attributes: '*'
24+
hf.Registrar.Roles: '*'
25+
hf.Registrar.DelegateRoles: '*'
26+
hf.Revoker: true
27+
name: ${ADMIN_NAME}
28+
pass: ${ADMIN_PASSWORD}
29+
type: admin
30+
```
31+
32+
The critical attributes for revocation are:
33+
- `hf.GenCRL: true` - Allows generation of Certificate Revocation Lists
34+
- `hf.Revoker: true` - Grants permission to revoke certificates
35+
- `hf.Registrar.Roles: '*'` - Manages roles for the CA
36+
37+
## Step-by-Step Revocation Process
38+
39+
### 1. Configure Environment Variables
40+
41+
First, set up your environment to connect to the Certificate Authority:
42+
43+
```bash
44+
# Set CA URL
45+
export FABRIC_CA_CLIENT_URL=https://${CA_HOST}:${CA_PORT}
46+
47+
# Set TLS certificate path
48+
# You can obtain this from the `status.tls_cert` field of the CA custom resource
49+
export FABRIC_CA_CLIENT_TLS_CERTFILES=${PWD}/${TLS_CERT_FILE}
50+
```
51+
52+
### 2. Authenticate as Admin
53+
54+
Enroll the admin user that has revocation privileges:
55+
56+
```bash
57+
fabric-ca-client enroll -u https://${ADMIN_NAME}:${ADMIN_PASSWORD}@${CA_HOST}:${CA_PORT}
58+
```
59+
60+
### 3. Execute the Revocation
61+
62+
Revoke the target identity using its enrollment ID:
63+
64+
```bash
65+
fabric-ca-client revoke -e ${TARGET_IDENTITY}
66+
```
67+
68+
### 4. Generate and Apply the CRL
69+
70+
After revoking the identity, create a Certificate Revocation List:
71+
72+
```bash
73+
fabric-ca-client gencrl
74+
```
75+
76+
Apply the generated CRL to your FabricFollowerChannel custom resource:
77+
78+
```yaml
79+
apiVersion: hlf.kungfusoftware.es/v1alpha1
80+
kind: FabricFollowerChannel
81+
metadata:
82+
name: ${CHANNEL_NAME}
83+
spec:
84+
# ...other configuration...
85+
revocationList:
86+
- |
87+
<CRL_GENERATED_ABOVE>
88+
```

website-docs/sidebars.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const sidebars: SidebarsConfig = {
3838
"chaincode-development/architecture",
3939
"chaincode-development/getting-started",
4040
],
41+
"Security": [
42+
"security/revoke-identities",
43+
],
4144
"Chaincode deployment": [
4245
"chaincode-deployment/getting-started",
4346
"chaincode-deployment/external-chaincode-as-a-service",

0 commit comments

Comments
 (0)