SShortSingh.
Back to feed

Docker Can Silently Bypass UFW Firewall Rules, Exposing Container Ports Publicly

0
·1 views

A known but widely overlooked security flaw causes Docker to bypass UFW firewall rules on Linux servers, leaving container ports exposed to the public internet even when UFW is configured to block them. The issue stems from Docker injecting its own iptables rules at startup, which take precedence over UFW's deny rules before they are evaluated. As a result, services like admin dashboards mapped to ports such as 8080 remain publicly accessible despite firewall restrictions. The fix involves appending a custom iptables configuration block to UFW's after.rules file and reloading the firewall, which forces Docker traffic through a chain that respects UFW rules. Once applied, standard UFW commands can be used to control container port access, including restricting specific ports to trusted IP addresses only.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Six Prompting Tactics That Help Reduce AI Hallucinations in Everyday Use

AI hallucinations occur because large language models predict plausible-sounding text rather than retrieving verified facts, making them prone to generating confident but false information. Experts suggest that while hallucinations cannot be fully eliminated, specific prompting strategies can significantly reduce their frequency and make errors easier to detect. Key tactics include requiring the model to cite sources, explicitly permitting it to admit uncertainty, and narrowing the scope of questions to well-defined topics. Asking the model to reason step by step or self-audit its own claims can also surface weaker or uncertain parts of a response. The most reliable approach is to supply source material directly in the prompt, shifting the model's role from fact retrieval to text analysis and eliminating retrieval-based hallucinations by design.

0
ProgrammingDEV Community ·

Few-Shot Prompting: How Giving AI Examples Produces Better, Consistent Output

Few-shot prompting is a technique where users provide an AI model two to five worked examples within a prompt before posing their actual question, allowing the model to infer the desired format, tone, and structure without lengthy instructions. Unlike zero-shot prompting, which relies solely on the model's general training, few-shot prompting demonstrates a clear pattern that the AI can replicate consistently. The approach requires no special tools, APIs, or fine-tuning — only well-structured examples using consistent delimiters such as 'Input/Output' or 'Q/A'. It is particularly effective for format-sensitive tasks like generating structured data, maintaining a specific brand voice, or performing domain-specific classifications. Experts recommend using as few examples as needed to make the pattern unambiguous, with three consistent examples typically outperforming a single inconsistent one.

0
ProgrammingDEV Community ·

St-core.fscss Lets Developers Build Line Charts Using Pure CSS Alone

St-core.fscss is an open-source charting library that renders multi-line charts without JavaScript, SVG, or Canvas. It relies on CSS custom properties for data points, clip-path polygons for line shapes, and FSCSS mixins to generate the required styles at compile or runtime. Developers declare a single renderer and assign up to eight Y-axis data points per line using CSS variables on a 0–100 scale. Because data is stored in CSS properties, lines can be updated dynamically via JavaScript's setProperty, triggering automatic browser repaints with no charting library overhead. The project is available on GitHub and aims to deliver an extremely lightweight, near-zero JS runtime charting solution.

0
ProgrammingDEV Community ·

Dev Packages Reusable FastAPI Pattern From Side Project Into Sellable Tool

A backend developer built Materia AI to address menu and inventory management challenges observed during his time working as a waiter. While developing the product, he noticed that his FastAPI structure and AI service layer had standalone value, so he extracted and packaged it separately. He trimmed the product description to reflect only what the code actually does, finding that honesty felt more defensible than over-promising features. Writing clear documentation for unfamiliar users helped him articulate the real value proposition: pre-made architectural decisions, not just boilerplate code. He launched at a low price point deliberately, prioritising user feedback over revenue optimisation in the early stage.