Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,3 @@ updates:
day: "sunday"
time: "21:00"
timezone: "America/Los_Angeles"

- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
day: "sunday"
time: "21:00"
timezone: "America/Los_Angeles"
groups:
actions-deps:
patterns:
- "*"
92 changes: 9 additions & 83 deletions .github/workflows/main.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these changes are not correct. It seems to me that you are using an older version of the webconsole. The Latest version has to have the permissions you are removing. Please revert these changes

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 Canonical Ltd.
# Copyright 2024 Intel Corporation
name: CI Pipeline

on:
pull_request:
branches:
Expand All @@ -11,121 +9,49 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build:
permissions:
contents: read
actions: read
security-events: write
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/build.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/build.yml@main
with:
branch_name: ${{ github.ref }}

build-ui:
permissions:
contents: read
actions: read
security-events: write
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/webconsole-build-ui.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/webconsole-build-ui.yml@main
with:
branch_name: ${{ github.ref }}

docker-build:
permissions:
contents: read
packages: write
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/docker-build.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/docker-build.yml@main
with:
branch_name: ${{ github.ref }}

static-analysis:
permissions:
contents: read
security-events: write
actions: read
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/static-analysis.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/static-analysis.yml@main
with:
branch_name: ${{ github.ref }}

lint:
permissions:
contents: read
checks: write
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/lint.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/lint.yml@main
with:
branch_name: ${{ github.ref }}

hadolint:
permissions:
contents: read
security-events: write
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/hadolint.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/hadolint.yml@main
with:
branch_name: ${{ github.ref }}

license-check:
permissions:
contents: read
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/license-check.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/license-check.yml@main
with:
branch_name: ${{ github.ref }}

fossa-scan:
permissions:
contents: read
security-events: write
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/fossa-scan.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/fossa-scan.yml@main
with:
branch_name: ${{ github.ref }}

unit-tests:
permissions:
contents: read
checks: write
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/unit-test.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/unit-test.yml@main
with:
branch_name: ${{ github.ref }}

analysis:
if: github.repository_owner == 'omec-project'
permissions:
actions: read
artifact-metadata: read
attestations: read
checks: read
contents: read
deployments: read
discussions: read
id-token: write
issues: read
models: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: write
statuses: read
uses: omec-project/.github/.github/workflows/scorecard-analysis.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
with:
branch_name: ${{ github.ref }}
33 changes: 5 additions & 28 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,38 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2024 Intel Corporation
# Copyright 2025 Canonical Ltd.
name: Release Pipeline

on:
push:
branches:
- main
paths:
- "VERSION"

permissions:
contents: read

jobs:
tag-github:
permissions:
contents: write
actions: read
id-token: write
uses: omec-project/.github/.github/workflows/tag-github.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/tag-github.yml@main
secrets: inherit

release-image:
needs: tag-github
permissions:
contents: read
packages: write
actions: read
id-token: write
attestations: write
uses: omec-project/.github/.github/workflows/release-image.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/release-image.yml@main
with:
changed: ${{ needs.tag-github.outputs.changed }}
version: ${{ needs.tag-github.outputs.version }}
docker_repository: "network5gcore/"
secrets: inherit

update-version:
needs: tag-github
permissions:
contents: write
pull-requests: write
actions: read
id-token: write
uses: omec-project/.github/.github/workflows/update-version.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/update-version.yml@main
with:
changed: ${{ needs.tag-github.outputs.changed }}
version: ${{ needs.tag-github.outputs.version }}
secrets: inherit

branch-release:
needs: tag-github
permissions:
contents: write
actions: read
id-token: write
uses: omec-project/.github/.github/workflows/branch-release.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/branch-release.yml@main
with:
release_branch: ${{ needs.tag-github.outputs.release_branch }}
version_branch: ${{ needs.tag-github.outputs.version_branch }}
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,9 @@ on:
schedule:
- cron: "0 0 * * *"

permissions:
issues: write
pull-requests: write
contents: read

jobs:
stale:
permissions:
issues: write
pull-requests: write
contents: read
actions: read
uses: omec-project/.github/.github/workflows/stale-issue.yml@76c248f1621bfe102956c558ea8cecfe5df143bf # v0.0.3
uses: networkgcorefullcode/.github/.github/workflows/stale-issue.yml@main
with:
days_before_stale: 120
days_before_close: 15
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ cscope.*
# debug
*.log
*.pcap

bin/
# build
bin/
public/
!/frontend/public/*.license
.coverage/
vendor/
config/webuicfg.yaml
server.exe
webconsole.exe
webconsole.exe~
webconsole
*.crt
*.key
*.pem
*.csr
38 changes: 30 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#

FROM golang:1.25.5-bookworm@sha256:09f53deea14d4019922334afe6258b7b776afc1d57952be2012f2c8c4076db05 AS builder
FROM golang:1.24.5-bookworm AS builder

RUN apt-get update && \
apt-get -y install --no-install-recommends \
Expand All @@ -20,23 +20,45 @@ RUN apt-get update && \
unzip && \
apt-get clean

RUN go install github.com/go-task/task/v3/cmd/task@latest

WORKDIR $GOPATH/src/webconsole

COPY go.mod .
COPY go.sum .
COPY Taskfile.yml .

RUN task mod-start


COPY . .
RUN make all && \
CGO_ENABLED=0 go build -a -installsuffix nocgo -o webconsole -x server.go

FROM alpine:3.23@sha256:51183f2cfa6320055da30872f211093f9ff1d3cf06f39a0bdb212314c5dc7375 AS webui
ARG BUILD_UI=true
RUN if [ "$BUILD_UI" = "true" ]; then \
task webconsole-ui; \
else \
task all; \
fi
Comment on lines +23 to +41
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Dockerfile installs and executes the task build tool via go install github.com/go-task/task/v3/cmd/task@latest, which pulls arbitrary mutable code at build time (@latest) and then runs it as part of the build pipeline. If the upstream module or its supply chain is compromised, an attacker could execute code during image builds with access to build secrets and artifacts. To reduce this risk, pin task to a specific, audited version (e.g., a fixed tag or commit) and treat it as a normal dependency rather than fetching @latest dynamically in the build stage.

Copilot uses AI. Check for mistakes.

FROM alpine:3.22 AS webui

LABEL maintainer="Aether SD-Core <dev@lists.aetherproject.org>" \
description="ONF open source 5G Core Network" \
version="Stage 3"

ARG DEBUG_TOOLS
ARG BUILD_UI=true

# Install debug tools ~85MB (if DEBUG_TOOLS is set to true)
RUN if [ "$DEBUG_TOOLS" = "true" ]; then \
apk update && apk add --no-cache -U vim strace net-tools curl netcat-openbsd bind-tools; \
fi
apk update && apk add --no-cache -U vim strace net-tools curl netcat-openbsd bind-tools; \
fi

# Copy executable - choose the right binary based on BUILD_UI
RUN if [ "$BUILD_UI" = "true" ]; then \
echo "Copying UI-enabled binary"; \
else \
echo "Copying standard binary"; \
fi

# Copy executable
COPY --from=builder /go/src/webconsole/webconsole /usr/local/bin/.
COPY --from=builder /go/src/webconsole/bin/* /usr/local/bin/.
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@


PROJECT_NAME := sdcore
DOCKER_VERSION ?= $(shell cat ./VERSION)
#DOCKER_VERSION ?= $(shell cat ./VERSION)
PROJECT_VERSION ?= $(shell cat ./VERSION)

## Docker related
DOCKER_REGISTRY ?=
Expand Down Expand Up @@ -49,27 +50,36 @@ $(WEBCONSOLE): $(GO_BIN_PATH)/$(WEBCONSOLE)

$(GO_BIN_PATH)/$(WEBCONSOLE): server.go $(WEBCONSOLE_GO_FILES)
@echo "Start building $(@F)...."
go build -o $(ROOT_PATH)/$@ ./server.go
CGO_ENABLED=0 go build -o $(ROOT_PATH)/$@ ./server.go

vpath %.go $(addprefix $(GO_SRC_PATH)/, $(GO_NF))
$(GO_BIN_PATH)/$(WEBCONSOLE)-ui: server.go $(WEBCONSOLE_GO_FILES)
@echo "Start building $(@F) with UI...."
CGO_ENABLED=0 go build --tags ui -o $(ROOT_PATH)/$@ ./server.go

webconsole-ui: $(GO_BIN_PATH)/$(WEBCONSOLE)-ui

$(GO_BIN_PATH)/$(WEBCONSOLE)-ui: server.go $(WEBCONSOLE_GO_FILES)
@echo "Start building $(@F)...."
go build --tags ui -o $(ROOT_PATH)/$@ ./server.go
vpath %.go $(addprefix $(GO_SRC_PATH)/, $(GO_NF))

clean:
rm -rf $(ROOT_PATH)/$(GO_BIN_PATH)/$(WEBCONSOLE)
rm -rf $(ROOT_PATH)/$(GO_BIN_PATH)/$(WEBCONSOLE)-ui

print-branch:
@echo ${DOCKER_REPOSITORY}5gc-${DOCKER_TARGETS}-${DOCKER_TAG}

print-tag:
@echo ${DOCKER_REPOSITORY}5gc-${DOCKER_TARGETS}:${DOCKER_TAG}

print-target:
@echo ${DOCKER_TARGETS}

docker-build:
@go mod vendor
for target in $(DOCKER_TARGETS); do \
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker build $(DOCKER_BUILD_ARGS) \
--target $$target \
--tag ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}5gc-$$target:${DOCKER_TAG} \
--build-arg org_label_schema_version="${DOCKER_VERSION}" \
--build-arg org_label_schema_version="${PROJECT_VERSION}" \
--build-arg org_label_schema_vcs_url="${DOCKER_LABEL_VCS_URL}" \
--build-arg org_label_schema_vcs_ref="${DOCKER_LABEL_VCS_REF}" \
--build-arg org_label_schema_build_date="${DOCKER_LABEL_BUILD_DATE}" \
Expand Down
Loading